- Joined
- Feb 2, 2009
- Messages
- 213
Hello friends, I am currently working on a spawn based RTS and I need a bit of help making an efficient spawn trigger for the units. Currently i'm using a 'for loop' to spawn multiple units in accordance to the amount of quarters (spawn amount upgrade), while issuing an order to each unit to move to the rally point of the spawn from the spawn point (Spawn Arthas Landing).
My problem is this; I have a multitude of these spawn triggers in the map and they all trigger on the same periodic timer. I need to add many more so for the sake of time is there some way to store the player who owns each spawn at the start of the variable, but in a way that will allow these triggers to run at the same time? I considered just using a basic player variable labeled 'owner', and then using the Wait function between each spawn trigger in the periodic trigger to allow each one to run without problems but I get the feeling there could be a more graceful solution.
Any help would be greatly appreciated!
-
BoatSpawn
- Events
-
Conditions
- (Count non-structure units controlled by (Owner of Arthas' Ship 0008 <gen>) (Exclude incomplete units)) Less than UnitCap
- (Arthas' Ship 0008 <gen> is alive) Equal to True
- (Arthas' Ship 0008 <gen> has buff Inactive Spawn ) Equal to False
-
Actions
-
For each (Integer A) from 1 to (QuarterArthasLanding + 3), do (Actions)
-
Loop - Actions
- Unit - Create 1 BasicUnitArray[(Player number of (Owner of Arthas' Ship 0008 <gen>))] for (Owner of Arthas' Landing 0057 <gen>) at (Center of Spawn Arthas Landing <gen>) facing Default building facing degrees
- Unit - Order (Last created unit) to Move To (Rally-Point of Arthas' Ship 0008 <gen> as a point)
-
Loop - Actions
-
For each (Integer A) from 1 to (QuarterArthasLanding + 1), do (Actions)
-
Loop - Actions
- Unit - Create 1 MageUnitArray[(Player number of (Owner of Arthas' Ship 0008 <gen>))] for (Owner of Arthas' Ship 0008 <gen>) at (Center of Spawn Arthas Landing <gen>) facing Default building facing degrees
- Unit - Order (Last created unit) to Move To (Rally-Point of Arthas' Ship 0008 <gen> as a point)
- Unit - Create 1 RangedUnitArray[(Player number of (Owner of Arthas' Ship 0008 <gen>))] for (Owner of Arthas' Ship 0008 <gen>) at (Center of Spawn Arthas Landing <gen>) facing Default building facing degrees
- Unit - Order (Last created unit) to Move To (Rally-Point of Arthas' Ship 0008 <gen> as a point)
- Unit - Create 1 MageUnitArray[(Player number of (Owner of Arthas' Ship 0008 <gen>))] for (Owner of Arthas' Ship 0008 <gen>) at (Center of Spawn Arthas Landing <gen>) facing Default building facing degrees
- Unit - Order (Last created unit) to Move To (Rally-Point of Arthas' Ship 0008 <gen> as a point)
-
Loop - Actions
-
For each (Integer A) from 1 to (QuarterArthasLanding + 3), do (Actions)
Any help would be greatly appreciated!