• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

in need help makeing a incresseing income

Status
Not open for further replies.

thghost91

T

thghost91

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
 
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]".
 
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])
 
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 by a moderator:
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.
Back
Top