# need help with money generation trig

Status
Not open for further replies.

#### eltsoldier

Level 1
i need to know how to make money generation trigger work for multiple buildings unstead of just 1 plz help =)

#### Nestharus

Level 31

there are many types of functions and triggers that can relate to money generation..

Do you want them to just produce gold?

What would you like?

Please also say the type of map you are thinking of ^_^

#### eltsoldier

Level 1
ok i got it working for one building i want to make it where when i build that building it adds to the income like it should and itsa map im improving on "so a edit" and they are already producing gold just when i make more then 1 they wont produce gold after the 1st one

#### Nestharus

Level 31
Dude, just add a trigger that when a building is finished being built, add income x to total income for player variable y. When a building is destroyed, remove x

x + y

x - y

the building should only add to the original variable. Use player slots or player numbers as the index and make it an array variable. I could make a 1 minute function for you to call up, but it's just too easy, especially if you got one working...

Every time building w/e is finished, add the income it adds to your income variable for that player, all done ^_^

#### eltsoldier

Level 1
ya but its hard when ur not rly familiar with it and ur using variables u didn make so i need 2 variables for this?cuz its like
event
Unit - A unit owned by Player 1 (Red) Finishes construction "its for all players"
condition
(Unit-type of (Triggering unit)) Equal to Money Farm L-1
action
Set timegold[(Player number of (Triggering player))] = (2 x 2)

and when i do this it works once but after building the 2nd one it doesnt give the same effect i just get +4 over and over unstead of +6 or more so after the second 1 its useless....

#### Nestharus

Level 31
Set timegold[(Player number of (Triggering player))] = (2 x 2)

look at the 2x2, your equation is messed up

instead of a 2, set it to to timegold[(player number of(triggeringplayer))] + 2 or x2 or w/e

that should fix it ^_^

so change that first 2 into your variable

change the second into whatever you want to add to it : P

Like I said, quick fix ^_^

Status
Not open for further replies.

Replies
0
Views
448
Replies
3
Views
646
Replies
0
Views
534
Replies
1
Views
478
Replies
2
Views
580