• 🏆 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!

Building income?

Status
Not open for further replies.
Level 2
Joined
Jul 9, 2009
Messages
4
Okay i need help creating a trigger so that each farm i have creates 250 gold each 30 seconds or so. And yes I've tried the search and tried pretty much every single trigger for income and it still wont work
 
Level 6
Joined
Jan 31, 2009
Messages
166
Income triger

I belive this shold work for you

  • Income
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Set TempFarms[(Player number of Player 1 (Red))] = (Units owned by Player 1 (Red) of type Farm)
      • Player - Set Player 1 (Red) Current gold to ((Player 1 (Red) Current gold) + ((Number of units in TempFarms[(Player number of (Triggering player))]) x 250))
      • Custom script: call DestroyGroup(udg_TempFarms)

You also must create the variable (golden X box at top of trigger editor) TempFarms make it a unit group and check the array box this must be done to avert a data leak and it must be made an array so the trigger can be used for more than one player

Also if you want it to work for more than one player just copy the trigger and replace all instances of player 1 with player 2 and so on

P.S. 250 gold per farm every 30 seconds is alot if you want to change it set the x 250 to whatever you want it to be
 
Status
Not open for further replies.
Top