HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need help with variable trigger

01-24-2004, 03:52 PM#1
ABM
I have 4 ressource in my map:

Food(gold) Wood(wood) Gold(variable) Stone(variable)

Food and Wood are legal ressource
Gold and Stone are (integer variable)

if i use any of the two legal ressource i got no problem making unit, building, upgrading, etc...

but when i use the variable it become hell:

how can i train an unit wich cost 40 Food(gold) and 30 Gold(variable) , because no matter what i do the game will only check the Food ressource and say ok to build even if the Gold(variable) is not enough to build.


for building i did: (Stone House) cost 100 wood 50 stone

E: unit is starting building
C:
A:if, then, else:
if C: unit type of constructing structure = stone house
C: Stone(player(owner of constructing structure) < 50
then A: select- constructing structure for owner of constructing structure.
A:Game- force owner of constructing structure press key.(???)
A:Game-display to player owner of constructing structure the text: not enough ressource.
else A: do nothing.

if, then, else:
if C: unit type of constructing structure = stone house
C: Stone(player(owner of constructing structure) >= 50
then A:set stone(owner of constructing structure) = stone(owner of constructing structure) - 50.
A:leaderboard- change value for stone in leaderboard of player(owner of constructing unit) to stone(owner of constructing unit)
else A: do nothing.

What is the KEY to cancel ? what should i type in?


This trigger doesn't work for training unit could you tell me a way to cancel a training unit before it is trained if the gold(variable) or stone(variable) is not enough ?

Help me build unit and building.....please....
01-24-2004, 04:15 PM#2
Narwanza
it wouold be Game - Force UI cancel
01-24-2004, 04:29 PM#3
ABM
I AM Stupid not to seen it before....

But still need help for a train/upgrade trigger to build unit or upgrade building requiring Variable ressource...
01-24-2004, 04:54 PM#4
Narwanza
ABM, this is what I did, and it worked.

Events:
Unit is issued order w/no target

Conditions:
Issued order = (order(footman))

Actions:
if (stone < 50) then
Wait .5 secs
Game - Force (owner of(ordered Unit)) to cancel
else
do nothing

now the order footman is one i figured out using floating text to tell me what an order was when it was recieved. You might have to do the same thing to find out the orders for units that you are going to have require an integer variable rescource. The same thing can be done to find out what the order is when an upgrade is researched.