• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

in need help makeing a incresseing income

Status
Not open for further replies.
Level 1
Joined
Jan 4, 2011
Messages
3
iv been trying to make a incresesing income that increses when you train a unit, for 2 days now.
all i have been able to do now is a lot of ways to hava a income.i want the income kinda like the income in wc3 hero line wars.
any help would be vary thankfull
 
Level 12
Joined
Mar 10, 2008
Messages
869
Well first off you make a Variable. Make it an integer and an array and make the array maximum to be however many players you have in your game.
Then, when a unit is trained, you get the player who trained it, and then increase "Income[player number]" by however much income the unit gives.

When you want to give the players the income say at a 30 second duration, do like you normally give them income, except make it give each player the variable "Income[player number]".
 
Level 1
Joined
Jan 4, 2011
Messages
3
ok i did all that and now i got a income that dose increse but by way to mutch per unit. like 180. but i dont have a number that is not a 1 on the triggers
 
Just make an integer variable for each player, then make a trigger

Event -> Unit is trained
Condition ->
Action -> set ([variable] current value [variable] + 1)

Set the +# to whatever you want the income increase to be.

Next,

Event -> Every 60 seconds of Game Time
Condition ->
Action -> Modify (player #) resources, ([current value] + [variable])
 
Level 1
Joined
Jan 4, 2011
Messages
3
thanks i i got it down a lil bit ago, i just cept changeing lil things to it till it worked.
now i got a nuther problem i cant get it to display the income value on the leaderboard.
this is what iv basiculy tried

add text to(last created leaderboard) collom 2 row 1, convert integer to real, income,(1)

and all it dose is display a 0 there.
 
Last edited:
Level 12
Joined
Mar 10, 2008
Messages
869
you need to create the leaderbord before you add stuff to it. Shouldn't it be convert integer to string? Or you don't even need to convert it to make it show up as a value on the leaderboard...

when you post your triggers, right click them and click copy as text then paste them into [ trigger ] [ /trigger ] brackets so it is easier for me to understand what you have really done...
 
Status
Not open for further replies.
Top