[Trigger] cancle unit training with a trigger

Status
Not open for further replies.
Level 5
Joined
May 23, 2008
Messages
123
I need to cancel a unit from being trained with a trigger. Answer is fine in GUI or JASS.(i would like answer in GUI if possable)
 
This might not be the best solution but,
replace the building that's constructing the unit with the same type of building. This mgiht work for canceling all the units but not a single unit.

Edit: You could use variables for the units that are being constructing and somehow make the replaced unit rebuild them. If you want ot cancel single units
 
To cancel training of a unit, or researching of a tech, use this:

JASS:
call IssueImmediateOrderById(u, 851976)

where u is the unit that is currently doing the training or the researching.

i tryed that and it did not work? maybe i entered it wrong?
  • Custom script: call IssueImmediateOrderById(GetTriggerUnit(), 851976)
Also slaydon i cant find those triggers anywere in WE. There is a trigger to STOP which does nothing to biuldings, you need to cancel it.
 
If you're using that code in a trigger that fires on the Unit Starts Training event, you need to wait a bit before running that code because technically the unit has not yet started training at the time the trigger fires. Start a one-shot timer that times out in 0.03 seconds and once it times out, issue the order.
 
Status
Not open for further replies.
Back
Top