HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Generate gold over time

01-01-2007, 02:47 AM#1
warbucket
I was wondering if anyone had some time to help me with a trigger. I always manage to mess my triggers up. I guess it because I'm totally new to it.

Here goes:

For every Farm that a player owns, that player gains (50 gold)(# of Farms) every 30 seconds.

Fairly simple, is it not?
01-01-2007, 02:59 AM#2
darkwulfv
Oh! I can do this quite easily. I'll post the trigger in a minute or 2.
Make sure you set the variable farm_number ahead of time though. It's fairly easy, you should be able to do it yourself.
Trigger:
Untitled Trigger 001
Collapse Events
Time - Every 30.00 seconds of game time
Conditions
Collapse Actions
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Collapse For each (Integer A) from 1 to farm_number, do (Actions)
Collapse Loop - Actions
Player - Add 50 to (Picked player) Current gold

And thank you for the rep, I now have enough for a user title, im so happy.
01-01-2007, 03:01 AM#3
Pyrogasm
Trigger:
Farm Income
Collapse Events
Time - Every 30.00 seconds of game time
Conditions
Collapse Actions
Player Group - Pick every player in (All players) and do (Player - Add ((Number of living Farm units owned by (Picked player)) x 50) to (Picked player) Current gold)

Easy, I don't see why you couldn't have done it yourself...


EDIT: Beat ya to it, Darkwulfv
01-01-2007, 03:08 AM#4
darkwulfv
No you didn't!
Mines easier!
01-01-2007, 03:09 AM#5
Pyrogasm
Quote:
Originally Posted by darkwulfv
No you didn't!
Mines easier!
Am I missing something here? Mine's only 1 line and it doesn't use a variable...

01-01-2007, 03:11 AM#6
darkwulfv
...Fine, be that way. Mine has less clicking =p
I suppose it doesn't matter which way you do it, as you just need to replace the variable with Player - number of living farms etc..

Ok you win, yours is easier. >=(
01-01-2007, 03:17 AM#7
Pyrogasm
And here I was going to rep you for letting me win but I've got to "spread some more rep around" first. Damn.

Good show though, ol' chap. Good show.

Now... figure out a witty custom title!
01-01-2007, 03:19 AM#8
darkwulfv
I can't... I can't find the damn field to fill in to do so!!! gah and I worked so hard to get that rep too... I already know what its going to be, I jsut need to figure out where the little box you put it in is located... I checked like everywere...
I know where it's supposed to be, but it isn't there... not fair... at all...
Hah, finally showed up! How do ya like it? Now i need a new avatar to match...
01-01-2007, 03:39 AM#9
warbucket
Gratz Wufly on the rep gain! + + + the custom title. And thanks all for the script. Don't think I'm just taking advantage of you, because I'm really learning from all these posts.
01-01-2007, 03:42 AM#10
darkwulfv
I don't care, ask all you like. Help is help as far as im concerned. We all didn't know something at one point in time.

And thanks again for that rep. How do you like the avatar + user title?
You get rep... I dunno how much you had before, but the rep you just got boosted you a nice chunk.
01-01-2007, 03:49 AM#11
warbucket
Ok. Now everything works except for the first Event.

How can I get for every 30 seconds of game time? I can't seem to find that.
01-01-2007, 03:51 AM#12
darkwulfv
Event - Time - Periodic Event

aand the x 50... is kinda complicated, ill add it in a second.

it's the arithmatic. Putthe first value as that long "Player - Number of living farms" and then set the + to a x, and the second value is 50.
01-01-2007, 03:52 AM#13
warbucket
Oh, ok. I was making a new "Action" and looking for "Time", when I should have been creating a new "Event." That was just a mistake.
01-01-2007, 03:54 AM#14
darkwulfv
XD it happens, ive done that far too many times. Which is why i do JASS now...
01-01-2007, 04:01 AM#15
warbucket
And there we go. A few minutes and its completely functional. Thanks a lot for the effort.