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

[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)
 
Level 4
Joined
May 14, 2009
Messages
104
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
 
Level 5
Joined
May 23, 2008
Messages
123
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.
 
Level 11
Joined
Feb 22, 2006
Messages
752
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.
Top