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

[Solved] Stun interrupts move order - fix?

Status
Not open for further replies.

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
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.
Top