• 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.

Quick problem with my TD.

Status
Not open for further replies.
Level 6
Joined
May 27, 2007
Messages
162
Hey there, with out revealing too much, i'm working on a nice tower defence map in which one of the towers has a knockback abilitiy.

The knockback ability works like:
  • Knockback
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Yur'teh Devourer
    • Actions
      • Set x = 0
      • Set Target = (Attacked unit)
      • Set Caster = (Attacking unit)
      • Trigger - Turn on KnockbackMove <gen>
Then

  • KnockbackMove
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set TempLock00 = (Position of Caster)
      • Set TempLock01 = (Position of Target)
      • Set TempLock02 = (TempLock01 offset by 5.00 towards ((Facing of Target) - 180.00) degrees)
      • Unit - Turn collision for Target Off
      • Unit - Move Target instantly to TempLock02
      • Custom script: call RemoveLocation(udg_TempLock00)
      • Custom script: call RemoveLocation(udg_TempLock01)
      • Custom script: call RemoveLocation(udg_TempLock02)
      • Set x = (x + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • x Greater than 50
        • Then - Actions
          • Unit - Turn collision for Target On
          • Trigger - Turn off (This trigger)
        • Else - Actions
However, I know that if more than one unit is attacked the knockback ability will be cut short on whoever is currently being knocked back. This is okay since my TD only allows a limited number of these towers, and otherwise, the tower would become far too imbalanced.

My problem is this:

Because of how the knock-back effect works, the Unit forgets his last order (move to a region in the map), and attacks the tower once he's been knocked back. Now, thats not what is supposed to happen - after the knockback effect has happened, all i want is to give him his last order.

But I've no idea how the 'order' variable works, I havn't managed to find a way to issue a unit a variable as an order. So i cant just be like 'give him the order he had 1 second ago'.

Any help? Much appreciated!
 
Level 8
Joined
Dec 29, 2006
Messages
359
This might not be what you want, but you could just use wait (x) seconds (depending on how long your knockback lasts) then use the 'pick every unit in region and do actions-' action, picking every unit in the region, (the region being the row that the creeps walk along) and ordering all picked units to move to the end of the row.
Btw, the name of the tower in the trigger is cool Yur'teh Devourer, lookin forward to playing it :D
 
Status
Not open for further replies.
Top