• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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