HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger Query

05-11-2004, 07:34 PM#1
HEZZA
I started a trigger for my map for ships....a sort of Tax system....For those of u have ever played the Game : cossask, you will know that for every ship u posses it costs gold per seconds...thats what ive done in my map

Example
If i made a Transport i would have to pay 1 gold every 10 seconds for as long as that boat is alive and i have cash, so far ive not got very far with this trigger ive managed to simple to do:
Galley
Events
Unit - A unit Finishes training a unit
Conditions
(Unit-type of (Trained unit)) Equal to Galley
Actions
Set IntergetSHIPtransport[(Player number of (Owner of (Trained unit)))] = IntergetSHIPtransport[((Player number of (Owner of (Trained unit))) + 1)]

All that does is set it into an interger variable
im trying to do a trigger that detects depending on how many boats u have, X amount of gold will be taken away from u....but im having trouble finiding the right action

its actualy simple im just busy with exams atm so im a bit brain dead :(
05-11-2004, 08:01 PM#2
ThyFlame
I would say.


Unit enters entire map

Unit == ship

set taxAmount[player number of (owner of (entering-unt))] = taxAmount[player number of (owner of (entering-unt))] + 10


Just don't forget to subtract 10 when the ship dies/is sold/whatever.



Every 1.00 seconds

For each integer A (1 to 12)
--set property - gold for player[Integer A] = gold for player[Integer A] - taxAmount[Integer A]
05-11-2004, 08:13 PM#3
HEZZA
forget the enter map bit its trained unit :P
that parts fine


its just taking the gold off the player thats the problem....

lets say i created 5 ships and each ship costs 1 gold per 10 secs to run
i would like it to take 5 gold off every 10 seconds

u see?
05-11-2004, 08:13 PM#4
CynicalYouth
You need two more triggers from what I can tell

Boat Dies
Event:
Unit - A unit Dies
Conditions:
Unit Type of Triggering Unit Equal to Galley
Actions:
Set IntergetSHIPtransport[(Player number of (Owner of (Trained unit)))] = IntergetSHIPtransport[((Player number of (Owner of (Trained unit))) - 1)]

And a periodic event
Apply Tax
Event:
Time - Every 10 seconds of game time
Actions:
For each Integer A from 1 to Number of Players
Player - Add (Number of boats[Integer A] x -1) to Player[IntegerA)
current gold

This will add the negative of the number of boats they control to their current gold every 10 seconds.
05-11-2004, 08:31 PM#5
HEZZA
DIES?!?!?!?

awww christ sakes stop confusing me :(
05-11-2004, 09:26 PM#6
CynicalYouth
Sorry if I confused you. You need a trigger for when a boat dies because you want the tax rate to go down. If you dont have a dies trigger then if a person build ten boats and they all died he would still be charged the tax for them even though he no longer has them.

It is the same as the trigger you wrote except that I subtract one instead of add one.