- Joined
- Jun 2, 2005
- Messages
- 5
I'm trying to make a -repick command, so that a player can repick their race in the TD that I'm making. The trigger is supposed to order all the player's towers to sell, thereby destroying them, then destroys the person's tower builder, and finally creates a hero selection building for the hero. I would also appreciate any leak help I could get. I'm not sure if I covered all of them or not.
EDIT:I've got it solved, so... nevermind.
Code:
Change Race
Events
Player - Player 1 (Red) types a chat message containing -Repick as An exact match
Player - Player 2 (Blue) types a chat message containing -Repick as An exact match
Player - Player 3 (Teal) types a chat message containing -Repick as An exact match
Player - Player 4 (Purple) types a chat message containing -Repick as An exact match
Player - Player 5 (Yellow) types a chat message containing -Repick as An exact match
Player - Player 6 (Orange) types a chat message containing -Repick as An exact match
Player - Player 7 (Green) types a chat message containing -Repick as An exact match
Player - Player 8 (Pink) types a chat message containing -Repick as An exact match
Player - Player 9 (Gray) types a chat message containing -Repick as An exact match
Player - Player 10 (Light Blue) types a chat message containing -Repick as An exact match
Conditions
Actions
-------- Order All Towers To Sell --------
Set LocalUnitGroup = (Units owned by (Triggering player) matching (((Triggering unit) is A structure) Equal to True))
Unit Group - Pick every unit in LocalUnitGroup and do (Actions)
Loop - Actions
Unit - Order (Picked unit) to train/upgrade to a Sell (50%)
Custom script: call DestroyGroup(udg_LocalUnitGroup)
Custom script: set udg_LocalUnitGroup = null
-------- Remove Builder --------
Set LocalUnit = (Random unit from (Units owned by (Triggering player) matching (((Triggering unit) is A peon-type unit) Equal to True)))
Unit - Remove LocalUnit from the game
Custom script: set udg_LocalUnit = null
-------- Create New Race Selector --------
Set LocalPoint = ((Center of StartRegion[(Player number of (Triggering player))]) offset by (0.00, -1000.00))
Unit - Create 1 Race Selecter for (Triggering player) at LocalPoint facing Default building facing degrees
Custom script: call RemoveLocation(udg_LocalPoint)
Custom script: set udg_LocalPoint = null
EDIT:I've got it solved, so... nevermind.