• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger Debugging Help

Status
Not open for further replies.
Level 2
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.

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.
 
Level 3
Joined
Jul 23, 2004
Messages
58
What if the player enters -repick but has not yet picked a race? Maybe you should add an boolean flag.
 
Status
Not open for further replies.
Top