Gold and Lumber income?

Murkatal

New Member
Reaction score
3
For gold and Lumber income is it a trigger like, for every 1 (building) add 10 gold every 15 seconds, or is it something that is included in the game and is changed in editor?
 

Murre

New Member
Reaction score
14
Do you want like every time someone buys a creep they get increased income that occurs every X seconds? Or just a steady income of, let's say 50 gold every X seconds?
 

jig7c

Stop reading me...-statement
Reaction score
123
what map are you talking about!
you can change the gold/lumber value to anything u want!
 

Murkatal

New Member
Reaction score
3
I want it so that for every lets say for every farm you get 10 gold added to a steady income. so If a player had 10 farms they would get 100 gold every 30 seconds or whatever.
 

Murre

New Member
Reaction score
14
Okay, I'll edit this post in a sec.
Edit: Done...

Trigger:
  • Map Init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set Gold_Income_Integer = 0
      • Set Lumber_Income_Integer = 0
      • -------- Change these if you want a starter income. --------



Trigger:
  • Income
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add Gold_Income_Integer to Player 1 (Red) Current gold
      • Player - Add Lumber_Income_Integer to Player 1 (Red) Current lumber



Trigger:
  • Each farm
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Farm
    • Actions
      • Set Gold_Income_Integer = (Gold_Income_Integer + 10)
      • -------- Change the "10" to whatever increase for each farm you want. --------
      • Set Lumber_Income_Integer = (Lumber_Income_Integer + 10)


If you need help with finding any of the "functions" used for each thing, like "(Gold_Income_Integer + 10)" is done through "Arithmetic" :p (Since I had these problems when asking for help. :))
 

Murkatal

New Member
Reaction score
3
Ok I'm not sure how you got the set gold_income_integer thing on the first trigger.

NVM I figured it out :D
 

jig7c

Stop reading me...-statement
Reaction score
123
Okay, I'll edit this post in a sec.
Edit: Done...

Trigger:
  • Map Init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set Gold_Income_Integer = 0
      • Set Lumber_Income_Integer = 0
      • -------- Change these if you want a starter income. --------



Trigger:
  • Income
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add Gold_Income_Integer to Player 1 (Red) Current gold
      • Player - Add Lumber_Income_Integer to Player 1 (Red) Current lumber



Trigger:
  • Each farm
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Farm
    • Actions
      • Set Gold_Income_Integer = (Gold_Income_Integer + 10)
      • -------- Change the "10" to whatever increase for each farm you want. --------
      • Set Lumber_Income_Integer = (Lumber_Income_Integer + 10)


If you need help with finding any of the "functions" used for each thing, like "(Gold_Income_Integer + 10)" is done through "Arithmetic" :p (Since I had these problems when asking for help. :))

this will work for only player 1 thought: keep that in mind!
 

tooltiperror

Super Moderator
Reaction score
232
I would suggest using JASS for this to save a lot of space.
 

Murre

New Member
Reaction score
14
this will work for only player 1 thought: keep that in mind!
Oh sorry! :p
Forgot to make it all players ^^ I'll make a new, and edit this post in a sec.
Edit: There will be a lot of triggers, depending on how many players you are going to use :p However this is how to do it :):

Set the Integer Array Variables :p
Trigger:
  • Map Init
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to (Number of players in (All players)), do (Actions)
        • Loop - Actions
          • Set Gold_Income_Integer[(Integer A)] = 0
          • Set Lumber_Income_Integer[(Integer A)] = 0


Example of player income triggers, 1
Trigger:
  • Income Player 1
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add Gold_Income_Integer[1] to Player 1 (Red) Current gold
      • Player - Add Lumber_Income_Integer[1] to Player 1 (Red) Current lumber


Example of player income triggers, 2
Trigger:
  • Income Player 7
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add Gold_Income_Integer[7] to Player 7 (Green) Current gold
      • Player - Add Lumber_Income_Integer[7] to Player 7 (Green) Current lumber


Each Farm Trigger
Trigger:
  • Each Farm
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Farm
    • Actions
      • Set Gold_Income_Integer[(Player number of (Owner of (Constructed structure)))] = (Gold_Income_Integer[(Player number of (Owner of (Constructed structure)))] + 10)
      • Set Lumber_Income_Integer[(Player number of (Owner of (Constructed structure)))] = (Lumber_Income_Integer[(Player number of (Owner of (Constructed structure)))] + 10)


Ask if you wonder how to do any of the parts. :p (These are leakless aswell, at least from what I, and Leak Check have found :p)
 

jomik

New Member
Reaction score
17
Orrrr, you can do this :D
Trigger:
  • Income
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add ((Number of living Farm units owned by (Picked player)) x 10) to (Picked player) Current gold
 

jig7c

Stop reading me...-statement
Reaction score
123
Trigger:
  • Income
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • For each Integer A from 1 to 12, do (change the number 12 to however many players you have in your map)
        • Player - Add Gold_Income_Integer[Integer A] to (Player(Player[Integer A] Current gold
        • Player - Add Lumber_Income_Integer[Integer A] to (Player(Player[Integer A])) Current lumber


this will eliminate you from doing individual trigger for each player!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top