- Joined
- Sep 30, 2012
- Messages
- 205
Was making another system that allows you to automatically rebuild your lost units.
However when a unit dies, i can say pick every unit, that is a owned by the player and rebuild the missing unit.
So the problem is if one footman dies, and the player owns two barracks, both barracks want to replace the missing footman.
Can i say: only pick one (barrack for example)?
thx in advance
However when a unit dies, i can say pick every unit, that is a owned by the player and rebuild the missing unit.
So the problem is if one footman dies, and the player owns two barracks, both barracks want to replace the missing footman.
Can i say: only pick one (barrack for example)?
thx in advance
-
Player 1 Enable Auto Rebuild
-
Events
- Player - Player 1 (Red) types a chat message containing -erb as A substring
- Conditions
-
Actions
- Trigger - Turn on Player 1 Rebuild <gen>
- Set Saying_Player = (Player group((Triggering player)))
- Game - Display to Saying_Player the text: Enabled Rebuild
- Custom script: call DestroyForce (udg_Saying_Player)
-
Events
-
Player 1 Disable Auto Rebuild
-
Events
- Player - Player 1 (Red) types a chat message containing -drb as A substring
- Conditions
-
Actions
- Trigger - Turn off Player 1 Rebuild <gen>
- Set Saying_Player = (Player group((Triggering player)))
- Game - Display to Saying_Player the text: Disabled Rebuild
- Custom script: call DestroyForce (udg_Saying_Player)
-
Events
-
Player 1 Rebuild
-
Events
- Unit - A unit Dies
-
Conditions
- (Owner of (Dying unit)) Equal to Player 1 (Red)
-
Actions
- Game - Display to (All players matching ((Owner of (Dying unit)) Equal to Player 1 (Red))) the text: (Auto Rebuild: + (Name of (Dying unit)))
-
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Owner of (Picked unit)) Equal to Player 1 (Red)
-
Then - Actions
- Unit - Order (Picked unit) to train/upgrade to a (Unit-type of (Dying unit))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Events
Last edited: