• 🏆 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 upgrade by trigger.

Status
Not open for further replies.
Level 6
Joined
Oct 4, 2009
Messages
160
I am trying to force upgrade cancel when it's requirements are not meant during it's upgrade but it doesn't seem to be bothered with Order - Stop. Any idea how to do it?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You can also use this to detect order ids.

  • OrderID
    • Events
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg(OrderId2String(GetIssuedOrderId()) + " ---- " + I2S(GetIssuedOrderId()))
 
Level 6
Joined
Oct 4, 2009
Messages
160
Set your unit to the variable CancelUnit then use this

  • Custom script: call IssueImmediateOrderById (udg_CancelUnit, 851976)

Works very well. How do I now detect this order issued?

  • Wall 2 cancel
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Wall 2
      • (Issued order) Equal to (Order(851976))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set RedLumber = (RedLumber + 1000)
        • Else - Actions
This of course didn't work.
 
Level 16
Joined
Dec 15, 2011
Messages
1,423
Works very well. How do I now detect this order issued?

Here you go. Be careful as this is the order id of Cancel.

  • Wall 2 cancel
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Wall 2
    • Actions
      • Custom script: if GetIssuedOrderId () == 851976 then
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set RedLumber = (RedLumber + 1000)
        • Else - Actions
      • Custom script: endif
 
Status
Not open for further replies.
Top