Staredit Network > Forums > SC2 Assistance > Topic: Efficient award system
Efficient award system
Feb 28 2011, 3:12 pm
By: playpong  

Feb 28 2011, 3:12 pm playpong Post #1



Hi all, I've made a map that's sort of like Risk. There are Auto-Turrets in the center of 12 territories, and a timer that counts down. When the timer hits 0, it awards the owner of each territory with the territories default unit award. Some territories spawn 2 units, others spawn 1.

I have it all set up and working correctly by whenever a turret dies, it grabs it's custom value (which is set to it's original starting position on the map) and then creates a new turret for killing player at those coordinates, and then sets the new turret's custom values to match. Then, when the timer runs out, it checks the owner of each territory (through 12 different if/then) and gives the hard-coded unit award to the owner of the turret at the center of the region that the turret is in.

The issue I have with it is, while yes it works but, i feel it could be a lot more efficient.

Ideally I guess, it would be nice to have a Region Group somehow, so I can spawn a turret at Center of Picked Region instead of having to specify which region and which coordinates specifically.

Then it would be nice to have variables set, one for each territory, that contain an array of unit types and the quantity of each unit type that will be awarded for their corresponding territory.

Does that seem like a better solution? If so, I can't seem to figure out how to get that group effect with regions, so any help or ideas on the matter would be really helpful!



None.

Feb 28 2011, 4:41 pm Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

There are only groups for players and units. :(

You can use a global array (variable that is an array on the left side where your triggers are) to store all regions or points (seems like you need points only to set spawn points).

For the unit types + quantity you would need 2 arrays unittype[areaID] and quantity[areaID].




Feb 28 2011, 5:13 pm playpong Post #3



So something like this?


globalTerritory[x, y]

Group all turrets on the map (?)

playerStart[player, x, y]

Group all user players into playerGroup

awardType[unit type]
awardQty[1,2,3]

for each globalTerritory[] create unit Auto-Turret at X of globalTerritory[x] and Y of globalTerritory[y]

pick each player in player group, give control of turret (at globalTerritory[playerStart[x] , playerStart[y]]) to playerStart[player]...

...
...

if turret dies, then
-create turret at X of custom value 1 of triggering unit and Y of custom value 2 of triggering unit
...
...

when timer expires, then
-for each turret in turretGroup, create unitQty[] of unitType[] at globalTerritory[x,y] for owner of unit Picked unit in turretGroup...
...
...



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[2026-4-29. : 2:00 am]
l)ark_ssj9kevin -- hi jamal
[2026-4-29. : 12:18 am]
Heinermann -- memes
[2026-4-28. : 10:08 pm]
NudeRaider -- skeet-skeet, motherfucker
[2026-4-28. : 4:24 pm]
Vrael -- NudeRaider
NudeRaider shouted: Vrael boy, if you're not careful I'll moderate your sorry ass too!
gotta catch me first! skeet skeet skeet
[2026-4-26. : 1:58 pm]
lil-Inferno -- ya
[2026-4-25. : 11:50 pm]
JamaL -- Glad to see SEN will never die. Kudos to whoever is paying the hosting fees these days!
[2026-4-25. : 3:37 pm]
NudeRaider -- (-.-,)
[2026-4-25. : 3:35 pm]
Zoan -- ;o I thought that was a monkey emote
[2026-4-25. : 3:34 pm]
Zoan -- :mods:
[2026-4-25. : 3:34 pm]
Zoan -- :mods"
Please log in to shout.


Members Online: Revenant