• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Stun interrupts move order - fix?

Status
Not open for further replies.
That seems to only happen if the unit is owned by Neutral Hostile and if it's beyond it's Guard Distance (gameplay constant) - At least that's what happened when I tested it on version 1.36.

You can adjust the Guard Distance to fix it. That or use triggers.

I believe there's a way to detect when a unit becomes stunned using the "stun order", which you'd have to look up. Combine that with a system for tracking a unit's destination and you can easily update it's orders whenever it gets stunned. Here's an example:
  • Spawn
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Neutral Hostile at (Center of (Playable map area)) facing Default building facing degrees
      • Set TempUnit = (Last created unit)
      • Set CV = (Custom value of TempUnit)
      • Set TempPoint = (Random point in (Playable map area))
      • Set X[CV] = (X of TempPoint)
      • Set Y[CV] = (Y of TempPoint)
      • Unit - Order TempUnit to Move To TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
  • Stun
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(the order for stun))
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set CV = (Custom value of TempUnit)
      • Set TempPoint = (Point(X[CV], Y[CV]))
      • Unit - Order TempUnit to Move To TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
The Custom Value stuff is meant to be used with a Unit Indexer system.
 
That seems to only happen if the unit is owned by Neutral Hostile and if it's beyond it's Guard Distance (gameplay constant) - At least that's what happened when I tested it on version 1.36.

You can adjust the Guard Distance to fix it. That or use triggers.

I believe there's a way to detect when a unit becomes stunned using the "stun order", which you'd have to look up. Combine that with a system for tracking a unit's destination and you can easily update it's orders whenever it gets stunned. Here's an example:
  • Spawn
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Neutral Hostile at (Center of (Playable map area)) facing Default building facing degrees
      • Set TempUnit = (Last created unit)
      • Set CV = (Custom value of TempUnit)
      • Set TempPoint = (Random point in (Playable map area))
      • Set X[CV] = (X of TempPoint)
      • Set Y[CV] = (Y of TempPoint)
      • Unit - Order TempUnit to Move To TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
  • Stun
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(the order for stun))
      • (Owner of (Triggering unit)) Equal to Neutral Hostile
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set CV = (Custom value of TempUnit)
      • Set TempPoint = (Point(X[CV], Y[CV]))
      • Unit - Order TempUnit to Move To TempPoint
      • Custom script: call RemoveLocation(udg_TempPoint)
The Custom Value stuff is meant to be used with a Unit Indexer system.
oh, if it was that simple - just doesn't have to be neutral hostile! Thanks for the detailed trigger though.
 
Status
Not open for further replies.
Back
Top