• 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.

Gold income increased every

Status
Not open for further replies.
Level 6
Joined
Jul 23, 2018
Messages
243
Hello,
I need help with making a trigger that gives gold income every time. And every x minute, it would increase the amount of gold income every time.
I tried doing multiple triggers but it doesn't seem infinite.
 
Level 29
Joined
Sep 26, 2009
Messages
2,609
The trigger for that is quite simple, though you may need to adjust it a bit to fit your needs, since you didn't provide much details.

Anyway, what you need is basically a trigger with periodic time event, an integer variable that represents how much income you should get and another variable that counts how many minutes have passed in order to determine if you should increase the gold income or not.

Set up the base gold income in map ini:
  • Map Ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet GoldIncome = 70

Have a periodic timer trigger that gives a player his income and if needed, increases the income player gets every X minutes.
  • Periodic Gold Income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet MinutesPassedSinceGoldIncrease = ((MinutesPassedSinceGoldIncrease + 1) mod 5)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MinutesPassedSinceGoldIncrease Equal to 0
        • Then - Actions
          • Set VariableSet GoldIncome = (GoldIncome + 10)
        • Else - Actions
      • Player - Add GoldIncome to Player 1 (Red).Current gold
In this trigger, every minute a player 1 Red gets GoldIncome amount of gold (starting with 70 gold as that is set in map initialization trigger).
Every 5 minutes the gold income is increased by 10.
If you want to change it from 5 minutes to some other amount, you need to change the number '5' in the following action to some other amount:
  • Set VariableSet MinutesPassedSinceGoldIncrease = ((MinutesPassedSinceGoldIncrease + 1) mod 5)

At the moment, the trigger is set up to work in minutes. If you wanted to for example give gold income every 30 seconds and increase gold income every 5 minutes, then you would need to also update the action above and change the number '5' for number '10'... since 10 * 30 = 300 seconds which is 5 minutes.
 
Status
Not open for further replies.
Top