• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Cancel Entangle

Status
Not open for further replies.
I've tried several methods and this will display the error message but not stop the structure from casting. It is a unit based on the Tree of Life. Animation - Cast point is greater than 0.00.

  • Naga TH Distance C
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(entangle))
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Sunken Temple
          • (Unit-type of (Triggering unit)) Equal to Tidal Temple
          • (Unit-type of (Triggering unit)) Equal to Maelstrom Temple
    • Actions
      • Set Naga_Flood_Point_B = (Position of (Triggering unit))
      • Set Naga_Flood_Point_C = (Position of (Target unit of issued order))
      • Set ErrorPlayer = (Owner of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between Naga_Flood_Point_B and Naga_Flood_Point_C) Greater than 1500.00
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Set ErrorMessage = BLAH BLAH BLAH
          • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Naga_Flood_Point_B)
      • Custom script: call RemoveLocation(udg_Naga_Flood_Point_C)
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
To understand what is going on, you have to understand the order in which the actions are done in the background.

To make it short, you either have to have a delay before you run the stop order, or you have to pause, order stop and unpause the unit. (You also have to turn the trigger off and on to prevent unnecessary execution looping.)
 
  • Like
Reactions: Kam
To understand what is going on, you have to understand the order in which the actions are done in the background.

To make it short, you either have to have a delay before you run the stop order, or you have to pause, order stop and unpause the unit. (You also have to turn the trigger off and on to prevent unnecessary execution looping.)

I tried a Wait - 0.00 with no success and then went with your second option which worked. Thank you.

  • Naga TH Distance C
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(entangle))
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Sunken Temple
          • (Unit-type of (Triggering unit)) Equal to Tidal Temple
          • (Unit-type of (Triggering unit)) Equal to Maelstrom Temple
    • Actions
      • Set Naga_Flood_Point_B = (Position of (Triggering unit))
      • Set Naga_Flood_Point_C = (Position of (Target unit of issued order))
      • Set ErrorPlayer = (Owner of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between Naga_Flood_Point_B and Naga_Flood_Point_C) Greater than 1500.00
        • Then - Actions
          • Unit - Pause (Triggering unit)
          • Unit - Order (Triggering unit) to Stop
          • Unit - Unpause (Triggering unit)
          • Set ErrorMessage = BLAH BLAH BLAH
          • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
          • Trigger - Turn off (This trigger)
          • Trigger - Turn on (This trigger)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Naga_Flood_Point_B)
      • Custom script: call RemoveLocation(udg_Naga_Flood_Point_C)
 
Status
Not open for further replies.
Top