Str4ndb3rg
Cool Member
- Reaction score
- 0
Okay i want the human farm building to generate 10 gold every 20 secounds when build.
But i don't know how to do it some help please?
But i don't know how to do it some help please?
Trigger
Events
Time - Every 0.2 seconds of game time
Conditions
Actions
Player - Pick all players in (All Players) and do (Actions)
Loop - Actions
Set Temp_Group = Units of type Farm matching (Matching Unit) belongs to (Picked Player) equal to true
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Player - Add 10 gold to (Picked Player)
Custom Script: call DestroyGroup (udg_Temp_Group)
Code:Trigger Events Time - Every 0.2 seconds of game time Conditions Actions Player - Pick all players in (All Players) and do (Actions) Loop - Actions Set Temp_Group = Units of type Farm matching (Matching Unit) belongs to (Picked Player) equal to true Unit Group - Pick every unit in Temp_Group and do (Actions) Loop - Actions Player - Add 10 gold to (Picked Player) Custom Script: call DestroyGroup (udg_Temp_Group)
Waits work fine for this. And you can change the frequency (Time) to whatever you like.
No need for hashtables.
Code:Trigger Events Time - Every 0.2 seconds of game time Conditions Actions Player - Pick all players in (All Players) and do (Actions) Loop - Actions Set Temp_Group = Units of type Farm matching (Matching Unit) belongs to (Picked Player) equal to true Unit Group - Pick every unit in Temp_Group and do (Actions) Loop - Actions Player - Add 10 gold to (Picked Player) Custom Script: call DestroyGroup (udg_Temp_Group)
Input which? As suggested, there are 3 methods, waits timers and hashtables.
Set Temp_Group = Units of type Farm matching (Matching Unit) belongs to (Picked Player) equal to true
Trigger
Events
Time - Every 20.00 seconds of game time
Conditions
Actions
Set Temp_Group = (Units of type Gold Farm)
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Player - Add 1 to (Owner of (Picked unit)) Current gold
Game - Display to (All players) the text: Gold Time!
Custom script: call DestroyGroup (udg_Temp_Group)
''temp_group doesn't exist'' why?