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

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,243
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