HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Question cancel action...

01-22-2004, 10:57 PM#1
ABM
I would like to know if it is possible in trigger or throw trigger to give a cancel action order to an unit?

ex: E: unit start building
C: unit-type of constucting units = granary
A: if <stone>(owner of(constructing unit)) < 50 then do (cancel building) else do set <Stone>(owner of(constructing unit)) = <Stone>(owner of( constructing unit)) - 50.

in this example i build a granary that cost 100 wood and 50 of a new ressource <stone> wich is an integer variable.

if the unit don't have the ressource to build it cancel the building (the gameplay constant are changed so a cancelled building return 100% ressource.

the only problem is i can't find the cancel order.

i could the do this trigger:(Hunter000)

E: unit start building
C: unit-type of constucting units = granary
A: if then else multiple function:
if <stone>(owner of(constructing unit)) < 50
then do order triggering unit to stop
unit- remove constructing unit
set player(owner of(constructing unit) wood = player(owner of(constructing unit) wood + 100
else do set <Stone>(owner of(constructing unit)) = <Stone>(owner of( constructing unit)) - 50.

this trigger work well but.....

i cannot apply this to a unit that i am training and that would also cost <Stone>.
E: unit is training an unit
C: unit type of training unit = stone golem
A: ??????

or a research has sarted but not enough gold.....????



How can i use the easier cancel order and is it possible without very advanced jass trigger.
01-22-2004, 11:44 PM#2
Darimus
Have it select the unit, then have to force the ESCAPE Key

Game - Force UI Cancel