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

trigger or else

Status
Not open for further replies.
  • gold
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Add (100 x (Number of units in (Units owned by (Player((Integer A))) of type Farm))) to (Player((Integer A))) Current gold
edit: added map so u can copy-paste :D
 

Attachments

Last edited:
"For each (Integer A) from 1 to 12" means that Integer A will take the values 1, 2, 3, ..., 12 every time the event fires. Effectively this means that the Loop - Actions will look like this when they are fired.

Player - Add (100 x (Number of units in (Units owned by (Player((1))) of type Farm))) to (Player((Integer A))) Current gold
Player - Add (100 x (Number of units in (Units owned by (Player((2))) of type Farm))) to (Player((Integer A))) Current gold
Player - Add (100 x (Number of units in (Units owned by (Player((3))) of type Farm))) to (Player((Integer A))) Current gold

.
.
.


Player - Add (100 x (Number of units in (Units owned by (Player((12))) of type Farm))) to (Player((Integer A))) Current gold

In other words the action in Loop - Actions will run once for each value that Integer A takes. So YES, this will affect all players from 1 to 12. And this is how you loop actions. There is no other way to loop actions in GUI triggers except these "For Each" actions.
 
Yes WhiteDeath is right, to fix this all you have to do is have three triggers, and a unitgroup. One of the triggers is when the structure has been completed then add it to the unitgroup. After that you make the other trigger with the peroidic timer event or timer expires event, and pick every unit in the unitgroup then add the gold from number of picked units. Then the third trigger to detect when the unit dies to remove it from the unitgroup. I think that is how it is done, well somewhat close because it isn't specific.
 
Status
Not open for further replies.
Back
Top