• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Need Gold Income System

Status
Not open for further replies.

Pantsu-kun

P

Pantsu-kun

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:
 
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
 
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.
 
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.
Back
Top