Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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!
I am looking for anything that can refer to the unit being cancelled in the event 'unit cancels training a unit'. I looked all over the helper but couldn't find anything that gives an answer.
A unit starts training a unit.
-> Save the unit somewhere (hashtable for example)
A unit finishes training a unit.
-> Remove that unit from the hashtable.
A unit cancels training a unit.
-> The unit that would be trained (the unit from the hashtable) is the one you want.
The point is that it is not a unit. The unit is not created so it has no id.
The thing you want is a unit-type.
Make a new action "create unit" and go to the unit type. There you can see the event response "Trained Unit-Type"
(I bet that you dont want to create the unit but just to show you where it is.)
Okay I think I get it. I first used the event 'a unit is issued an order with no target' and then put in the condition that the given order is a unit type converted to a string. If yes, then I used a variable and set an integer to 1. In another trigger which starts with 'unit cancels training a unit' the condition is 'if integer is equal to 1'. Then the integer is set back to 0.
You can convert unit types into strings indeed but I would use "A unit starts training a unit" as the event rather than "A unit is issued an order with no target".
The canceling is done through a separate trigger that refers to the integer variable and resets it. 'unit cancels producing a unit', 'triggering unit is equal to (your building)', 'if integer equals 1 then revert effects of the starting of unit production'.
I cannot reference the 'cancelled unit' or the 'training unit' because no such event responses exist. Thus, I resort to using the production of a particular unit type as an order and set an integer to a particular value which is what I use to reference the cancelling unit (since cancelling a unit is not an order like producing a unit).
When you order the barracks to recruit a unit.
That unit is not yet created, so it has no id, no location, no owner, no nothing.
You cannot kill nothing, give nothing an ability, set nothing's health or let nothing do an order.
That is why they respond to Unit-Type rather than Unit.
The barracks sets his training value to that unit type.
Unit-Type is the event response.
When you order the barracks to recruit a unit.
That unit is not yet created, so it has no id, no location, no owner, no nothing.
You cannot kill nothing, give nothing an ability, set nothing's health or let nothing do an order.
That is why they respond to Unit-Type rather than Unit.
The barracks sets his training value to that unit type.
Unit-Type is the event response.
I really don't understand what you mean. When I go the condition 'unit-type comparison' I can set a unit responding to an event e.g. triggering unit to be a certain unit type. Without an event response to the training of the unit I cannot make use of that comparison.
If you mean to say that using the comparison 'Unit type of (trained unit) equals to 'some unit'' actually works you are wrong. I just tried it now again to make sure and it does not work. It references the unit type of the trained unit, not the training unit, and responds to the event 'a unit finishes training' rather than 'a unit begins training'.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.