• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Lane Spawning Problem

Status
Not open for further replies.
Level 4
Joined
Jul 20, 2011
Messages
77
I made spawners at each base and have units that spawn move to the next point in the path, but the problem is, whenever one becomes stuck or stunned it will forget the "Movement" Order, does anyone know how to fix this?
 
Level 20
Joined
Jun 27, 2011
Messages
1,864
  • Move
    • Events
      • Time - Every X seconds of game time
    • Conditions
    • Actions
      • Set Temp_Point = (Somewhere)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (YourGroup) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To Temp_Point
      • Custom script: call RemoveLocation( udg_Temp_Point )
It will be like that...
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You can try adding this condition

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Current order of (Picked unit)) Not equal to (Order(attack))
    • Then - Actions
      • Game - Display to Player Group - Player 1 (Red) for 5.00 seconds the text: Order to attack
    • Else - Actions

Because
a) Units that are attacking don't need to be ordered again
b) Ordering too many units at a time can cause issues fir the game engine

It can introduce some issues, for example if the units have some active abilities.

Alternatively you can try

  • (Current order of (Picked unit)) Equal to (Order(<Empty String>))
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
OR you can simply save each units' order in a hashtable or something.
IF the order is holdposition (which is likely to happen if you are stunned), just load the initial order given to the unit and re-order the unit with the loaded order.

It's quite tedious but it works.

But compared to this, I would rather follow Maker's suggestion.
 
Status
Not open for further replies.
Top