HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Why does this trigger doesn't work?

02-01-2004, 11:15 AM#1
ABM
Event:
Unit - A unit get an order without target
Condition:
Action:
If, Then, Else (multiple action)

If - C:
((Issued order) Egal to (Order(custom_h019))) or ((Issued order) Egal to_ (Order(custom_h00B)))
Gold[(Player number of (Owner of (Ordered unit)))] <_30
Then - A:
Select - Select (Ordered unit) for (Owner of (Ordered unit))
Game - Force (Owner of (Ordered unit)) to press Escape/Cancel
Game - Display to (Player group((Owner of (Ordered unit)))) for 5.00 seconds the text: You Have Not enough ressource.
Else - A:
Do nothing

the Order custom (h019 and h00B) are train unit A and Train unit B order.
the text you have not enough ressource appear clearly but the build unit isn't cancelled, please could someone tell me whats wrong with this trigger?

INFO: gold is a integer variable and this trigger is supposed to cancelled a build unit order if the variable gold is lower than 30.

open to any help, suggestion....emote_sweat


EDIT............................................................................................

well this trigger doesn't work but this one does:

Event:
Unit - A unit get an order without target
Condition:
Action:
If, Then, Else (multiple action)
If - C:
((Issued order) Egal to_ (Order(custom_h00F))) or (((Issued order) Egal to_ (Order(custom_h00E)))
Stone[(Player number of (Owner of (Ordered unit)))] <_50
Then - A:
Game - Force (Owner of (Ordered unit)) to press Escape/Cancel
Game - Display to (Player group((Owner of (Ordered unit)))) for 5.00 seconds the text: You Have Not enough ressource.
Else - A:
Do nothing

INFO: here the custom order are build structure order, so why does it work to cancel structure order and why doesn't it work when cancel a train unit order.

Chemo i didn't understand your catch player order but i should be more precise in telling you that Gold and Stone are integer deploy variable that should each auto detect and apply to the triggering player.....

please someone help.....
:(
02-01-2004, 11:42 AM#2
chemo
what is the event ?

and second of all why dont u store the player number in variable ?
ex.
set Player = Owner of Ordered Unit

then set ur action beneath and insert the player variable
02-01-2004, 01:27 PM#3
linkmaster23
Whats with all that custom stuff in GUI? Care to explain?
02-01-2004, 02:00 PM#4
ABM
Well all command and order are cast by command.
ex: when you train a footman in the casern you just click on the icon of footman. but in the game when you click the icon an order is called and this order create the footman. when you click on a footman the order string is footman.
when your peon click on a tree the order is harvest and when he return the wood to the building the order is resumeharvesting.
whatever you do there always will be an order cast: when u use an ability, when u start to build, when u start to train an unit, when u research or upgrade.

but for custom unit and ability the order string is unknow so u have to find it to use it.
to find an order do:
create a variable integer: TempInt

E:
a unit owned by player1 is issued an order targeting an object
a unit owned by player1 is issued an order targeting an point
a unit owned by player1 is issued an order with no target
C:
A:
custom script: set udg_TempInt=GetissuedOrderIdBJ().
Game-display to (all player) the text: (Ordername: +((string((issuedOrder))) + (OrderID: +((string((TempInt))).

now whenever u give an order to an unit the order will appear in a text that will give the name and the id.
custome unit order name is always: custom_xxxx and Id vary upon what kind of order it is. (but the Id is not important here becuse i don't use it)

when u have done this create a custom unit that is trained in a custom building and then click on the unit..a text will appear.
now replace the (custom_h00F) with your (custom_xxxx) and do the trigger with something else as condition. if you want to do same you will need to create and integer deploy called Stone and one Gold, and then create a trigger to increase your stone or gold so u will be able to check what happen if you have more than 50 stone and what if you have less. same for Gold (more or less than 30)

the second trigger work the build trigger wich need stone, the first wich need Gold doesn't because the first is a train unit order and i can't figure out why the train order don't cancel???