- Joined
- Apr 23, 2011
- Messages
- 527
so, i have a trigger that sets off a timer and runs triggers (set to an array variable) that spawns units at random intervals and another trigger that makes them attack move either a player-owned building or a town (1/5 chance of happening).
however, when the attack trigger is run, it doesn't work most of the time. randomly it works, though.
variables needed to be set up are set in map initialization. units spawned in tested waves contain less than 12 units.
hopefully i explained everything that i need.
-
wave timer
-
Events
- Time - t expires
- Conditions
-
Actions
- Set r = (Random real number between 45.00 and 55.00)
- Countdown Timer - Start t as a One-shot timer that will expire in r seconds
- Set currentwave = (currentwave + 1)
- Trigger - Run wavetrigger[currentwave] (ignoring conditions)
- Trigger - Run wave attack <gen> (ignoring conditions)
-
Events
-
wave attack
- Events
- Conditions
-
Actions
- Set g[1] = (Units in dragonspawn <gen>)
- Set i = (Random integer number between 1 and 5)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- i Less than or equal to 4
-
Then - Actions
- Set i = (Random integer number between 1 and maxplayers)
- Set g[2] = (Units owned by (Player(i)) matching (((Matching unit) is A structure) Equal to True))
- Set attacktarget = (Random unit from g[2])
- Set attack[0] = (Position of attacktarget)
- Unit Group - Order g[1] to Attack-Move To attack[0]
- Custom script: call RemoveLocation(udg_attack[0])
- Custom script: call DestroyGroup(udg_g[2])
-
Else - Actions
- Set i = (Random integer number between 1 and towns)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- i Equal to 1
-
Then - Actions
- Unit Group - Order g[1] to Attack-Move To attack[1]
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- i Equal to 2
-
Then - Actions
- Unit Group - Order g[1] to Attack-Move To attack[2]
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If - Conditions
- Custom script: call DestroyGroup(udg_g[1])
hopefully i explained everything that i need.
Last edited: