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

[General] Detect build order event

Status
Not open for further replies.
I've searched but I couldn't find any examples or solutions.

I want to detect when a player clicks the Build button.

This test trigger works for every order except the Build buton. I have no idea why it isn't working ;(
  • Events
    • Unit - A unit Finishes casting an ability
    • Unit - A unit Begins casting an ability
    • Unit - A unit Is issued an order with no target
  • Conditions
    • Multiple ConditionsOr - Any (Conditions) are true
      • Conditions
        • (Unit-type of (Ordered unit)) Equal to (==) Peasant (Advanced)
        • (Unit-type of (Casting unit)) Equal to (==) Peasant (Advanced)
  • Actions
    • Quest - Display to (All players) the Quest Update message: zadada

thanks
 
Use this trigger to find out what the order id of the build event is

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg(I2S(GetIssuedOrderId()))
Then do something like this to check

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • -------- set integer variable to the order id --------
      • Set integer = 81029
      • Custom script: if (GetIssuedOrderId() == udg_integer) then
      • -------- actions go in here --------
      • Game - Display to (All players) the text: Build order detected
      • Custom script: endif
EDIT You can find a list of order id's here.
 
Thanks, I tried it:

  • Events
    • Unit - A unit Is issued an order with no target
  • Actions
    • Custom script: if (GetIssuedOrderId() == 851995) then
    • Quest - Display to (All players) the Quest Update message: zadada
    • Custom script: endif
Still no go. It won't even work without any conditions at all.

Edit:
  • Events
    • Game - The 'Build Structure' button is clicked
This does the trick, but I'm not sure if it's a good solution. I'd still need to know which unit's build button is pushed.
 
Last edited:
Status
Not open for further replies.
Top