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

Make income on how many units do you have

Status
Not open for further replies.
Level 4
Joined
Mar 12, 2008
Messages
89
I need make income for my map ..every 30 seconds it will add golds by
income how many units of type do you have * 100 can somebody help me ? I made something it works..but if there are more players it is bugged :(:cry::cry:
 
Level 11
Joined
Oct 20, 2007
Messages
342
  • Income
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Set sys_ALLplayer = (All players)
      • Player Group - Pick every player in sys_ALLplayer and do (Actions)
        • Loop - Actions
          • Set Temp_UnitGroup1 = (Units in (Playable map area) owned by (Picked player))
          • Player - Add (Number of units in Temp_UnitGroup1) to (Picked player) Current gold
 
Level 11
Joined
Feb 22, 2006
Messages
752
No need to set the player group to a global if you're using All Players (that function just returns a global constant player group)

EDIT: Just saw your last post. Just change the units in region owned by player function to units owned by player matching condition and set the condition to be (Matching Unit is of type Ancient).
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
  • Income
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • For each Integer A from 1 to *max player* do:
        • Loop - Actions
          • Set Temp_UnitGroup = (Units in (Playable map area) owned by Player(Integer A) of type *ancient*
          • Player - Add (Number of units in Temp_UnitGroup) to Player(Integer A) Current gold
          • Custom script: call DestroyGroup(udg_Temp_UnitGroup)
icon_biggrin.gif
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You loop for all players that it is to affect and pick all their units that are of the type that they give money and count them. Afterwhich you simply use maths to work out the ammount of gold to give and then give that ammount of gold to that player. The loop would mean it does that for all players.

Ofcourse you do that every 30 seconds.
 
Level 4
Joined
Mar 12, 2008
Messages
89
hm ....but I wanna easy income...I want to know what variables that are.... and yea I know bollan variable ..but what for it ? units ((Triggering unit)is Ancient)equal to TRUE
I can´t give to that condition type Triggering unit.... ....:cry:
 
Status
Not open for further replies.
Top