• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

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 25
Joined
Sep 26, 2009
Messages
2,385
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