HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help required, Hero Selection system. Trigger info inside.

05-18-2004, 03:37 PM#1
eva01
I'm having trouble with my Hero select system. The way I made this system is to Click on the Hero owned by Player 1(red) then change ownership of it to the triggering player. However that works at the start but my problem is I want unlimited reselect of Heroes when a player types "-repick".

Once they type "-repick" the Hero will be stripped of all items, reverted back to original location, given a tome of retraining item and issue an order to use that tome, reset ability cooldowns, set the level back to 1 and change ownership back to Player 1(red) setting a boolean(in this case Repick[player#] array of that player to true.

The problem that is occurring is. Once -repick is typed everything occurs like I want but I can't reselect a new Hero. So i'm wondering if the problem was caused by two people selecting 2 different Heroes at the same time thus the reason why I ask if I should just make 5 triggers of the type below for the specific player.

Here are the triggers:

Code:
SelectHeroBE
    Events
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        Player - Player 4 (Purple) Selects a unit
        Player - Player 5 (Yellow) Selects a unit
        Player - Player 6 (Orange) Selects a unit
    Conditions
        And - All (Conditions) are true
            Conditions
                ((Triggering unit) is A Hero) Equal to True
                ((Triggering unit) is owned by Player 1 (Red)) Equal to True
                ((Triggering player) Food used) Equal to 0
                Or - Any (Conditions) are true
                    Conditions
                        ((Triggering player) Equal to Player 2 (Blue)) and (Repick[1] Equal to True)
                        ((Triggering player) Equal to Player 3 (Teal)) and (Repick[2] Equal to True)
                        ((Triggering player) Equal to Player 4 (Purple)) and (Repick[3] Equal to True)
                        ((Triggering player) Equal to Player 5 (Yellow)) and (Repick[4] Equal to True)
                        ((Triggering player) Equal to Player 6 (Orange)) and (Repick[5] Equal to True)
    Actions
        Set TempPoint[31] = (Center of BloodElf revive region <gen>)
        Set SelectedUnit = (Triggering unit)
        Set SelectedHeroPlayer = (Triggering player)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of SelectedUnit) Equal to Tinker
            Then - Actions
                Do nothing
            Else - Actions
                Unit - Change ownership of Tinker 0016 <gen> to Neutral Passive and Change color
                Unit - Set SelectedUnit acquisition range to 650.00
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (SelectedHeroPlayer Equal to Player 2 (Blue)) and (Repick[1] Equal to True)
            Then - Actions
                Camera - Pan camera for Player 2 (Blue) to TempPoint[31] over 2.00 seconds
                Unit - Make SelectedUnit Vulnerable
                Unit - Move SelectedUnit instantly to TempPoint[31]
                Unit - Change ownership of SelectedUnit to SelectedHeroPlayer and Change color
                Unit - Set SelectedUnit acquisition range to 650.00
                Set Player_Hero[1] = SelectedUnit
                Trigger - Run Activate Trigger Spells Blood Elf <gen> (checking conditions)
                Set Repick[1] = False
                Trigger - Turn on New Hero Player 1 <gen>
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (SelectedHeroPlayer Equal to Player 3 (Teal)) and (Repick[2] Equal to True)
                    Then - Actions
                        Camera - Pan camera for Player 3 (Teal) to TempPoint[31] over 2.00 seconds
                        Unit - Make SelectedUnit Vulnerable
                        Unit - Move SelectedUnit instantly to TempPoint[31]
                        Unit - Change ownership of SelectedUnit to SelectedHeroPlayer and Change color
                        Unit - Set SelectedUnit acquisition range to 650.00
                        Set Player_Hero[2] = SelectedUnit
                        Trigger - Run Activate Trigger Spells Blood Elf <gen> (checking conditions)
                        Set Repick[2] = False
                        Trigger - Turn on New Hero Player 2 <gen>
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (SelectedHeroPlayer Equal to Player 4 (Purple)) and (Repick[3] Equal to True)
                            Then - Actions
                                Camera - Pan camera for Player 4 (Purple) to TempPoint[31] over 2.00 seconds
                                Unit - Make SelectedUnit Vulnerable
                                Unit - Move SelectedUnit instantly to TempPoint[31]
                                Unit - Change ownership of SelectedUnit to SelectedHeroPlayer and Change color
                                Unit - Set SelectedUnit acquisition range to 650.00
                                Set Player_Hero[3] = SelectedUnit
                                Trigger - Run Activate Trigger Spells Blood Elf <gen> (checking conditions)
                                Set Repick[3] = False
                                Trigger - Turn on New Hero Player 3 <gen>
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (SelectedHeroPlayer Equal to Player 5 (Yellow)) and (Repick[4] Equal to True)
                                    Then - Actions
                                        Camera - Pan camera for Player 4 (Purple) to TempPoint[31] over 2.00 seconds
                                        Unit - Make SelectedUnit Vulnerable
                                        Unit - Move SelectedUnit instantly to TempPoint[31]
                                        Unit - Change ownership of SelectedUnit to SelectedHeroPlayer and Change color
                                        Unit - Set SelectedUnit acquisition range to 650.00
                                        Set Player_Hero[4] = SelectedUnit
                                        Trigger - Run Activate Trigger Spells Blood Elf <gen> (checking conditions)
                                        Set Repick[4] = False
                                        Trigger - Turn on New Hero Player 4 <gen>
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (SelectedHeroPlayer Equal to Player 6 (Orange)) and (Repick[5] Equal to True)
                                            Then - Actions
                                                Camera - Pan camera for Player 5 (Yellow) to TempPoint[31] over 2.00 seconds
                                                Unit - Make SelectedUnit Vulnerable
                                                Unit - Move SelectedUnit instantly to TempPoint[31]
                                                Unit - Change ownership of SelectedUnit to SelectedHeroPlayer and Change color
                                                Unit - Set SelectedUnit acquisition range to 650.00
                                                Set Player_Hero[5] = SelectedUnit
                                                Trigger - Run Activate Trigger Spells Blood Elf <gen> (checking conditions)
                                                Set Repick[5] = False
                                                Trigger - Turn on New Hero Player 5 <gen>
                                            Else - Actions
                                                Do nothing
        Hero - Create Tome of Retraining and give it to SelectedUnit
        Hero - Order SelectedUnit to use (Last created item)
05-18-2004, 04:02 PM#2
ThyFlame
You say this works once, right?

Check the value of the booleans each time it is run.
You probably aren't resetting them to false.


No, you don't need more than 1 trigger because there are no waits.
05-18-2004, 04:47 PM#3
eva01
Quote:
Originally Posted by ThyFlame
You say this works once, right?

Check the value of the booleans each time it is run.
You probably aren't resetting them to false.


No, you don't need more than 1 trigger because there are no waits.

I just ran a testmap and everything worked fine. The booleans to reset them to true are in the -repick trigger(new hero player #). This trigger runs fine. Its the other trigger that seems something is wrong. Is it possible that it skips a function if someone lags?

This is the Repick Trigger for Player 2 (Blue)

Code:
New Hero Player 1
    Events
        Player - Player 2 (Blue) types a chat message containing -repick as An exact match
    Conditions
        (Player 2 (Blue) Food used) Equal to 5
    Actions
        Set HeroStartLocation[1] = (Center of HeroselectWise <gen>)
        Set HeroStartLocation[2] = (Center of HeroselectJubei <gen>)
        Set HeroStartLocation[3] = (Center of HeroselectSylphie <gen>)
        Set HeroStartLocation[4] = (Center of HeroselectElementalist <gen>)
        Set HeroStartLocation[5] = (Center of HeroselectElite <gen>)
        Set HeroStartLocation[6] = (Center of HeroselectDreamweaver <gen>)
        Set HeroStartLocation[7] = (Center of HeroselectNightshade <gen>)
        Set HeroStartLocation[8] = (Center of HeroselectAdvisor <gen>)
        Set HeroStartLocation[9] = (Center of HeroselectDraconian <gen>)
        Set HeroStartLocation[10] = (Center of HeroselectNeves <gen>)
        Set HeroStartLocation[11] = (Center of HeroSelectHiro <gen>)
        Set HeroStartLocation[12] = (Center of HeroselectBalgus <gen>)
        Set TempPoint[2] = (Center of BE Start <gen>)
        Set TempPoint[1] = (Center of FN Start <gen>)
        Game - Display to Player 2 (Blue), at offset (0.00, 0.00) for 10.00 seconds the text: Select a new Hero.
        Cinematic - Ping minimap for Player Group - Player 2 (Blue) at TempPoint[2] for 1.00 seconds
        Sound - Play Hint <gen> at 100.00% volume, located at TempPoint[2] with Z offset 0.00
        Unit - Change ownership of Player_Hero[1] to Player 1 (Red) and Change color
        Hero - Set Player_Hero[1] Hero-level to 1, Hide level-up graphics
        Unit - Set Player_Hero[1] acquisition range to 0.00
        Unit - Make Player_Hero[1] Invulnerable
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of Player_Hero[1]) Equal to Advisor
            Then - Actions
                Unit - Move Player_Hero[1] instantly to HeroStartLocation[8], facing (Player 2 (Blue) start location)
                Set HeroFlags[8] = False
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of Player_Hero[1]) Equal to Blood Mage
                    Then - Actions
                        Unit - Move Player_Hero[1] instantly to HeroStartLocation[11], facing (Player 2 (Blue) start location)
                        Set HeroFlags[1] = False
                        Trigger - Turn off Blood Eternal <gen>
                        Trigger - Turn off Sound Bloodseeker <gen>
                        Trigger - Turn off Fiery Maelstrom Skill <gen>
                        Trigger - Turn off Fiery Maelstrom <gen>
                        Player - Set the current research level of Fiery Maelstrom Damage  to 0 for Player 2 (Blue)
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Unit-type of Player_Hero[1]) Equal to Swordmaster
                            Then - Actions
                                Unit - Move Player_Hero[1] instantly to HeroStartLocation[12], facing (Player 2 (Blue) start location)
                                Set HeroFlags[11] = False
                                Trigger - Turn off Reincarnation Skill <gen>
                                Trigger - Turn off Charging Slash Skill <gen>
                                Trigger - Turn off Charging Slash <gen>
                                Trigger - Turn off Blade Stomp <gen>
                                Player - Set the current research level of Charging Slash Damage  to 0 for Player 2 (Blue)
                                Player - Set the current research level of Going out with a Bang  to 0 for Player 2 (Blue)
                            Else - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Unit-type of Player_Hero[1]) Equal to Elementalist
                                    Then - Actions
                                        Unit - Move Player_Hero[1] instantly to HeroStartLocation[4], facing (Player 2 (Blue) start location)
                                        Set HeroFlags[3] = False
                                        Trigger - Turn off Assistant Cold <gen>
                                        Trigger - Turn off Assistant Heat <gen>
                                        Trigger - Turn off Electrical Discharge Upgrade <gen>
                                        Trigger - Turn off Electrical Discharge <gen>
                                        Trigger - Turn off Clash of the Elements <gen>
                                        Trigger - Turn off Clash Fire Upgrade <gen>
                                        Player - Set the current research level of Electrical Discharge Upgrade  to 0 for Player 2 (Blue)
                                        Player - Set the current research level of Clash of the Elements Upgrade  to 0 for Player 2 (Blue)
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (Unit-type of Player_Hero[1]) Equal to Nightshade
                                            Then - Actions
                                                Unit - Move Player_Hero[1] instantly to HeroStartLocation[7], facing (Player 2 (Blue) start location)
                                                Set HeroFlags[2] = False
                                                Trigger - Turn off Call of Ibuki <gen>
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        (Unit-type of Player_Hero[1]) Equal to Elite
                                                    Then - Actions
                                                        Unit - Move Player_Hero[1] instantly to HeroStartLocation[5], facing (Player 2 (Blue) start location)
                                                        Set HeroFlags[12] = False
                                                        Trigger - Turn off Infusion <gen>
                                                        Trigger - Turn off Holy Light Skill <gen>
                                                        Trigger - Turn off Holy Light <gen>
                                                        Trigger - Turn off Sound Lucias Fury <gen>
                                                    Else - Actions
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                (Unit-type of Player_Hero[1]) Equal to Strider
                                                            Then - Actions
                                                                Unit - Move Player_Hero[1] instantly to HeroStartLocation[2], facing (Player 2 (Blue) start location)
                                                                Set HeroFlags[4] = False
                                                                Trigger - Turn off Blade Dance <gen>
                                                                Trigger - Turn off Dash <gen>
                                                                Trigger - Turn off Bushido Slash Skill <gen>
                                                                Trigger - Turn off Bushido Slash <gen>
                                                                Trigger - Turn off Mana Blade <gen>
                                                                Player - Set the current research level of Bushido Slash Damage  to 0 for Player 2 (Blue)
                                                            Else - Actions
                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                    If - Conditions
                                                                        (Unit-type of Player_Hero[1]) Equal to Water Priestess
                                                                    Then - Actions
                                                                        Unit - Move Player_Hero[1] instantly to HeroStartLocation[3], facing (Player 2 (Blue) start location)
                                                                        Set HeroFlags[10] = False
                                                                        Trigger - Turn off Shards of Ice <gen>
                                                                        Trigger - Turn off Water Nova <gen>
                                                                    Else - Actions
                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                            If - Conditions
                                                                                (Unit-type of Player_Hero[1]) Equal to Wise
                                                                            Then - Actions
                                                                                Unit - Move Player_Hero[1] instantly to HeroStartLocation[1], facing (Player 2 (Blue) start location)
                                                                                Set HeroFlags[6] = False
                                                                                Trigger - Turn off Judgement <gen>
                                                                                Trigger - Turn off Protection of the Absolute <gen>
                                                                            Else - Actions
                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                    If - Conditions
                                                                                        (Unit-type of Player_Hero[1]) Equal to Draconian
                                                                                    Then - Actions
                                                                                        Unit - Move Player_Hero[1] instantly to HeroStartLocation[9], facing (Player 2 (Blue) start location)
                                                                                        Set HeroFlags[9] = False
                                                                                        Trigger - Turn off Escaflowne <gen>
                                                                                        Trigger - Turn off Blood Pact <gen>
                                                                                        Trigger - Turn off Ispano Skin <gen>
                                                                                    Else - Actions
                                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                            If - Conditions
                                                                                                (Unit-type of Player_Hero[1]) Equal to Dreamweaver
                                                                                            Then - Actions
                                                                                                Unit - Move Player_Hero[1] instantly to HeroStartLocation[6], facing (Player 2 (Blue) start location)
                                                                                                Set HeroFlags[5] = False
                                                                                                Trigger - Turn off Monsoon <gen>
                                                                                            Else - Actions
                                                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                    If - Conditions
                                                                                                        (Unit-type of Player_Hero[1]) Equal to Silent
                                                                                                    Then - Actions
                                                                                                        Unit - Move Player_Hero[1] instantly to HeroStartLocation[10], facing (Player 2 (Blue) start location)
                                                                                                        Set HeroFlags[7] = False
                                                                                                        Trigger - Turn off Sound Clone <gen>
                                                                                                    Else - Actions
                                                                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                                                            If - Conditions
                                                                                                                (Unit-type of Player_Hero[1]) Equal to Tinker
                                                                                                            Then - Actions
                                                                                                                Unit - Change ownership of Tinker 0016 <gen> to Neutral Passive and Change color
                                                                                                                Unit - Move Player_Hero[1] instantly to TempPoint[2], facing (Player 2 (Blue) start location)
                                                                                                                Unit - Move Tinker 0217 <gen> instantly to TempPoint[1], facing (Player 8 (Pink) start location)
                                                                                                                Set HeroFlags[25] = False
                                                                                                                Unit - Unhide Tinker 0217 <gen>
                                                                                                            Else - Actions
                                                                                                                Do nothing
        For each (Integer B) from 1 to 8, do (Actions)
            Loop - Actions
                Item - Remove (Item carried by Player_Hero[1] in slot (Integer B))
        Set Repick[1] = True
        Unit - Reset ability cooldowns for Player_Hero[1]
        Camera - Pan camera for Player 2 (Blue) to TempPoint[2] over 2.00 seconds
        Unit - Set life of Player_Hero[1] to 100.00%
        Unit - Set mana of Player_Hero[1] to 100.00%
        Unit - Remove All buffs from Player_Hero[1]
        Hero - Create Tome of Retraining and give it to Player_Hero[1]
        Hero - Order Player_Hero[1] to use (Last created item)
        Point - Remove TempPoint[2]
        Point - Remove TempPoint[1]
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                Point - Remove HeroStartLocation[(Integer A)]
        Trigger - Turn off New Hero Player 1 <gen>