Ordered build

Skippy

Active Member
Reaction score
39
Hi again,
Is there any way how to detect when a unit has been ordered to build a building?
Thanks.
 

Jedi

New Member
Reaction score
63
Boolean comparasion
Trigger:
  • ((Target unit of issued order) is A structure) Equal to True
 

Moridin

Snow Leopard
Reaction score
144
Event:

Unit - A unit has been given an order targeting a unit

Condition

Current order Equal to Order(smart)
Current order Equal to Order(attack)
(Targeted unit is a structure) Equal to True

would that work?
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
@moridin: that wouldnt work at all because a units order cannot be "smart" and "attack" at once. (your condition uses 'and')
 

HydraRancher

Truth begins in lies
Reaction score
197
Simply, check if the units current order is the buildings "code". Make it build the building, and use a trigger to check the order. If it's something like Custom_A001, then that's the right code.
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
what hydrarancher said but without a 'A'. the prefix 'A' is for abilities, not units.

the order for building something is actually a string containing the units raw code (for custom units only!, standard wc3 units go a special code).
the order string looks like this:
"custom_" + Units raw code.

if you copy + paste a human farm in an empty map its raw code should be "h000", the 'h' is for human, it indicates that you simply copied a human unit and the 000 is just some index number. with newgen you can set the raw code yourself to whatever value you like when creating new units.
you can get the raw code by pressing ctrl + D in the object editor.

here is a simple trigger to check what order building a specific structure is:
Trigger:
  • CheckPointOrder
    • Event
      • Unit - A unit is issued a point targeting order
    • Conditions
    • Actions
      • Game- Display to (All players) the text: (String((Issued order)))
 

Skippy

Active Member
Reaction score
39
Ok, thanks.
I mean: Is there an event that is executed immediately after ordering unit to build a building?
When I use A unit is issued a point targeting order, it doesn't start.

EDIT: Yes, it starts. I just displayed wrong message :)
Thanks for help
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
well, for me "A unit is issued a point targeting order" does start right the moment i issue the order to build something. are you sure your trigger is right?
 

Moridin

Snow Leopard
Reaction score
144
@moridin: that wouldnt work at all because a units order cannot be "smart" and "attack" at once. (your condition uses 'and')
I meant for it to be an or :p. My mistake when i was typing.
 

Skippy

Active Member
Reaction score
39
Ok, now I can detect when a unit has been ordered, but how can I found where the unit is ordered to build it?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top