• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

Need Gold Income System

Status
Not open for further replies.
Level 1
Joined
Aug 21, 2009
Messages
3
So I'm trying to get a trigger that would give me income from a certain building example a Farm.

I got the farm the give 5 gold income but when I built another farm it stayed as 5.

So basically I'm searching for a system that counts "Income Base Amount per Building x Amount of Farms" :con:
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

  • Income
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Your Farm)) and do (Actions)
        • Loop - Actions
          • Player - Add 5 to (Owner of (Picked unit)) Current gold
 
Level 2
Joined
Mar 9, 2009
Messages
21
does that work? should it be 5*Integer(Numberofunits in Last Created Group)?

In my opinion this one is a better solution. You don't even have to create a unit group, just create it in a variable. Then refer to the variable and not to 'last created unit group' and destroy it afterwards. Should work perfectly fine.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
In my opinion this one is a better solution. You don't even have to create a unit group, just create it in a variable. Then refer to the variable and not to 'last created unit group' and destroy it afterwards. Should work perfectly fine.

I didnt say Booms suggestion was good I just wanted to know if it got 5 gold for each and every farm or not?

Yes using temporary groups and destroy afterwards are alot better
 
Status
Not open for further replies.
Top