1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

GUI Switch System v1.4

Submitted by Tiche3
This bundle is marked as approved. It works and satisfies the submission rules.
Thanks to Drenferalis for the vote system.

What does this system do? Allows the players to switch between teams. In other words, switches players
Do i need anything else but WE? No, only WE

The things you need to import is the Switcher_Number, Switched, Switcher, Switch_Votes, Switch_Vote (boolean), Switch_On, Switch_Check_Loop, Switch_Check_Integer and the rest (multiboards, etc) use them from your map.

Here are the triggers, i tried to explain everything :)
Switch Check
  • Switch Check
    • Events
      • Player - Player 2 (Blue) types a chat message containing - as A substring
      • Player - Player 3 (Teal) types a chat message containing - as A substring
      • Player - Player 4 (Purple) types a chat message containing - as A substring
      • Player - Player 5 (Yellow) types a chat message containing - as A substring
      • Player - Player 6 (Orange) types a chat message containing - as A substring
      • Player - Player 7 (Green) types a chat message containing - as A substring
      • Player - Player 8 (Pink) types a chat message containing - as A substring
      • Player - Player 9 (Gray) types a chat message containing - as A substring
      • Player - Player 10 (Light Blue) types a chat message containing - as A substring
      • Player - Player 11 (Dark Green) types a chat message containing - as A substring
    • Conditions
      • (Entered chat string) Equal to -switch
    • Actions
      • -------- If the guy is the enemy of Player 1 (it's Naga now) so it writes to NATURE TEAM the switching stuff --------
      • For each (Integer Switch_Check_Loop) from 2 to 11, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(Switch_Check_Loop)) is an enemy of (Triggering player)) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(Switch_Check_Loop)) slot status) Equal to Is playing
                • Then - Actions
                  • Set Tah_Player = (Player group((Triggering player)))
                  • Game - Display to Tah_Player the text: (Player_Colored_Names[Switch_Check_Loop] + ( |cff007ACA-switch + ((String(Switch_Check_Loop)) + |r)))
                  • Custom script: call DestroyForce(udg_Tah_Player)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Player(Switch_Check_Loop)) slot status) Equal to Is unused
                    • Then - Actions
                      • Set Tah_Player = (Player group((Triggering player)))
                      • Game - Display to Tah_Player the text: (Player_Colored_Names[Switch_Check_Loop] + (( |cff007ACA-switch + ((String(Switch_Check_Loop)) + |r )) + (|cffFF0000 + ([Unused] + |r))))
                      • Custom script: call DestroyForce(udg_Tah_Player)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Player(Switch_Check_Loop)) slot status) Equal to Has left the game
                        • Then - Actions
                          • Set Tah_Player = (Player group((Triggering player)))
                          • Game - Display to Tah_Player the text: (Player_Colored_Names[Switch_Check_Loop] + (( |cff007ACA-switch + ((String(Switch_Check_Loop)) + |r )) + (|cffFF0000 + ([Left] + |r))))
                          • Custom script: call DestroyForce(udg_Tah_Player)
                        • Else - Actions
            • Else - Actions


The second trigger
Switch Starting
  • Switch Start
    • Events
      • Player - Player 2 (Blue) types a chat message containing -switch as A substring
      • Player - Player 3 (Teal) types a chat message containing -switch as A substring
      • Player - Player 4 (Purple) types a chat message containing -switch as A substring
      • Player - Player 5 (Yellow) types a chat message containing -switch as A substring
      • Player - Player 6 (Orange) types a chat message containing -switch as A substring
      • Player - Player 7 (Green) types a chat message containing -switch as A substring
      • Player - Player 8 (Pink) types a chat message containing -switch as A substring
      • Player - Player 9 (Gray) types a chat message containing -switch as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -switch as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -switch as A substring
    • Conditions
      • (Entered chat string) Not equal to -switch
      • Switch_On Equal to False
    • Actions
      • -------- Switch_On is a boolean variable, which prevents multiple switch commands activation --------
      • -------- Switcher_Number is for after use (multiboard, etc) --------
      • Set Switcher_Number = (Player number of (Triggering player))
      • -------- Switcher is a Player comparison variable, to set the player into variable. For further use --------
      • Set Switcher[Switcher_Number] = (Triggering player)
      • -------- Switched is an integer, to place the targeted player's number in a variable. For All use --------
      • Set Switched = (Integer((Substring((Entered chat string), 9, 10))))
      • -------- This checks if the numbers are x>0, x<>1, x<>12, x<12 and is not an ally player --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Switched Greater than 0
          • Switched Not equal to 12
          • Switched Not equal to 1
          • Switched Less than 12
          • (Switcher[Switcher_Number] is an enemy of (Player(Switched))) Equal to True
        • Then - Actions
          • -------- Sets, the switch_on to prevent using multiple switch at the same time. Writes to inform people about the vote and starts a timer. --------
          • Set Switch_On = True
          • Game - Display to (All players) for 10.00 seconds the text: (|c00FF0000Vote:|r Switch + (Player_Colored_Names[(Player number of (Triggering player))] + ( and + (Player_Colored_Names[Switched] + (? + Then type |cffFFFF35-yes|r)))))
          • Countdown Timer - Start Switch_Time as a One-shot timer that will expire in 60.00 seconds
        • Else - Actions
          • -------- If those conditions aren't true, then write an error message --------
          • Set Tah_Player = (Player group((Triggering player)))
          • Game - Display to Tah_Player for 8.00 seconds the text: This Switch cannot ...
          • Custom script: call DestroyForce(udg_Tah_Player)

The third trigger
Switch Yes
  • Switch Yes
    • Events
      • Player - Player 2 (Blue) types a chat message containing -yes as An exact match
      • Player - Player 3 (Teal) types a chat message containing -yes as An exact match
      • Player - Player 4 (Purple) types a chat message containing -yes as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -yes as An exact match
      • Player - Player 6 (Orange) types a chat message containing -yes as An exact match
      • Player - Player 7 (Green) types a chat message containing -yes as An exact match
      • Player - Player 8 (Pink) types a chat message containing -yes as An exact match
      • Player - Player 9 (Gray) types a chat message containing -yes as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -yes as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -yes as An exact match
    • Conditions
      • Switch_Vote[(Player number of (Triggering player))] Equal to False
      • Switch_On Equal to True
    • Actions
      • -------- Sets the current player, that he has voted already. --------
      • Set Switch_Vote[(Player number of (Triggering player))] = True
      • -------- Informs all players --------
      • Game - Display to (All players) the text: (Player_Colored_Names[(Player number of (Triggering player))] + voted yes)
      • -------- Checks for voted people, adds one vote --------
      • For each (Integer Switch_Loop_Integer) from 2 to 11, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Switch_Vote[Switch_Loop_Integer] Equal to True
            • Then - Actions
              • Set Switch_Votes = (Switch_Votes + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Switch_Votes Greater than or equal to ((Number of players in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))) - 1)
                • Then - Actions
                  • -------- Players voted yes? Then run the switch action :) --------
                  • Trigger - Run Switch Action <gen> (checking conditions)
                • Else - Actions
            • Else - Actions


The fourth trigger
Switch No
  • Switch No
    • Events
      • Player - Player 2 (Blue) types a chat message containing -no as An exact match
      • Player - Player 3 (Teal) types a chat message containing -no as An exact match
      • Player - Player 4 (Purple) types a chat message containing -no as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -no as An exact match
      • Player - Player 6 (Orange) types a chat message containing -no as An exact match
      • Player - Player 7 (Green) types a chat message containing -no as An exact match
      • Player - Player 8 (Pink) types a chat message containing -no as An exact match
      • Player - Player 9 (Gray) types a chat message containing -no as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -no as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -no as An exact match
    • Conditions
      • Switch_On Equal to True
    • Actions
      • -------- These things set everything to 0 to make it good for further use --------
      • Set Switch_On = False
      • Set Switch_Votes = 0
      • Set Switched = 0
      • Set Switcher_Number = 0
      • For each (Integer Switch_Loop_Integer) from 2 to 11, do (Actions)
        • Loop - Actions
          • Set Switch_Vote[Switch_Loop_Integer] = False
      • -------- Informs --------
      • Game - Display to (All players) the text: (Player_Colored_Names[(Player number of (Triggering player))] + has canceled the vote!)


Switch Action
The Longest-Switch Action
  • Switch Action
    • Events
    • Conditions
      • Switch_On Equal to True
    • Actions
      • -------- Writes that the switch succeeded --------
      • Game - Display to (All players) the text: The Switch was comp...
      • -------- Change colors, to make it normal for other players (color var is set in other trigger) --------
      • Player - Change color of Switcher[Switcher_Number] to Player_Color[Switched], Changing color of existing units
      • Player - Change color of (Player(Switched)) to Player_Color[Switcher_Number], Changing color of existing units
      • -------- Something to keep the colors in the same place as they should be --------
      • Set Switcher_Color = (Color of Switcher[Switcher_Number])
      • Set Switched_Color = (Color of (Player(Switched)))
      • -------- Putting the colors in the right place --------
      • Set Player_Color[Switcher_Number] = Switcher_Color
      • Set Player_Color[Switched] = Switched_Color
      • -------- Sets a unit group to prevent leaks, owned by the dude who started the vote --------
      • Set Hardened_Skin_Group = (Units in (Playable map area) owned by Switcher[Switcher_Number])
      • -------- The stuff is done (numbers) to prevent misintegering, found it because Maker said something about the lines was wrong, so --------
      • Set Switcher_Multiboard = Player_Row[Switcher_Number]
      • Set Switched_Multiboard = Player_Row[Switched]
      • Set Player_Row[Switcher_Number] = Switched_Multiboard
      • Set Player_Row[Switched] = Switcher_Multiboard
      • -------- Here we change the player names colors. --------
      • For each (Integer Switch_Check_Loop) from 2 to 11, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Color of Switcher[Switcher_Number]) Equal to Player_Unchanged_Color[Switch_Check_Loop]
            • Then - Actions
              • Set Player_Colored_Names[Switcher_Number] = (Color_String[Switch_Check_Loop] + (Player_Original_Names[Switcher_Number] + |r))
              • Set Player_Number[Switcher_Number] = (Color_String[Switch_Check_Loop] + (Player_Original_Names[Switcher_Number] + |r))
              • Set Murder_Player_Number[Switcher_Number] = (Color_String[Switch_Check_Loop] + (Player_Original_Names[Switcher_Number] + |r))
              • Set Switch_Check_Loop = 11
            • Else - Actions
      • For each (Integer Switch_Check_Loop) from 2 to 11, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Color of (Player(Switched))) Equal to Player_Unchanged_Color[Switch_Check_Loop]
            • Then - Actions
              • Set Player_Colored_Names[Switched] = (Color_String[Switch_Check_Loop] + (Player_Original_Names[Switched] + |r))
              • Set Player_Number[Switched] = (Color_String[Switch_Check_Loop] + (Player_Original_Names[Switched] + |r))
              • Set Murder_Player_Number[Switched] = (Color_String[Switch_Check_Loop] + (Player_Original_Names[Switched] + |r))
              • Set Switch_Check_Loop = 11
            • Else - Actions
      • -------- Player Row is integer, so you can use it in other triggers with multiboard. Here we change kills, deaths, names, etc --------
      • Multiboard - Set the text for Multiboard item in column 2, row Player_Row[Switcher_Number] to (String(Player_Kills[Switcher_Number]))
      • Multiboard - Set the text for Multiboard item in column 2, row Player_Row[Switched] to (String(Player_Kills[Switched]))
      • Multiboard - Set the text for Multiboard item in column 3, row Player_Row[Switcher_Number] to (String(Player_Deaths[Switcher_Number]))
      • Multiboard - Set the text for Multiboard item in column 3, row Player_Row[Switched] to (String(Player_Deaths[Switched]))
      • Multiboard - Set the text for Multiboard item in column 1, row Player_Row[Switcher_Number] to Player_Colored_Names[Switcher_Number]
      • Multiboard - Set the text for Multiboard item in column 1, row Player_Row[Switched] to Player_Colored_Names[Switched]
      • -------- Here, we change ally/enemies/etc. It was hard, it took me like a year to figure out.... --------
      • For each (Integer Switch_Check_Loop) from 2 to 11, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player(Switch_Check_Loop)) Not equal to (Player(Switched))
              • (Player(Switch_Check_Loop)) Not equal to Switcher[Switcher_Number]
              • ((Player(Switch_Check_Loop)) is an enemy of Switcher[Switcher_Number]) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(Switch_Check_Loop)) slot status) Equal to Has left the game
                • Then - Actions
                  • Player - Make (Player(Switch_Check_Loop)) treat Switcher[Switcher_Number] as an Ally with shared vision and shared units
                  • Player - Make Switcher[Switcher_Number] treat (Player(Switch_Check_Loop)) as an Ally with shared vision
                • Else - Actions
                  • Player - Make (Player(Switch_Check_Loop)) treat Switcher[Switcher_Number] as an Ally with shared vision
                  • Player - Make Switcher[Switcher_Number] treat (Player(Switch_Check_Loop)) as an Ally with shared vision
              • Player - Make (Player(Switch_Check_Loop)) treat (Player(Switched)) as an Enemy
              • Player - Make (Player(Switched)) treat (Player(Switch_Check_Loop)) as an Enemy
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(Switch_Check_Loop)) slot status) Equal to Has left the game
                • Then - Actions
                  • Player - Make (Player(Switch_Check_Loop)) treat (Player(Switched)) as an Ally with shared vision and shared units
                  • Player - Make (Player(Switched)) treat (Player(Switch_Check_Loop)) as an Ally with shared vision
                • Else - Actions
                  • Player - Make (Player(Switch_Check_Loop)) treat (Player(Switched)) as an Ally with shared vision
                  • Player - Make (Player(Switched)) treat (Player(Switch_Check_Loop)) as an Ally with shared vision
              • Player - Make (Player(Switch_Check_Loop)) treat Switcher[Switcher_Number] as an Enemy
              • Player - Make Switcher[Switcher_Number] treat (Player(Switch_Check_Loop)) as an Enemy
      • Player - Make Switcher[Switcher_Number] treat (Player(Switched)) as an Enemy
      • Player - Make (Player(Switched)) treat Switcher[Switcher_Number] as an Enemy
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Switcher[Switcher_Number] is an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Set Player_Kills[1] = (Player_Kills[1] - Player_Kills[(Player number of Switcher[Switcher_Number])])
          • Set Player_Kills[12] = (Player_Kills[12] + Player_Kills[(Player number of Switcher[Switcher_Number])])
          • Set Player_Deaths[1] = (Player_Deaths[1] - Player_Deaths[(Player number of Switcher[Switcher_Number])])
          • Set Player_Deaths[12] = (Player_Deaths[12] + Player_Deaths[(Player number of Switcher[Switcher_Number])])
          • Multiboard - Set the text for Multiboard item in column 2, row 2 to (String(Player_Kills[1]))
          • Multiboard - Set the text for Multiboard item in column 3, row 2 to (String(Player_Deaths[1]))
          • Multiboard - Set the text for Multiboard item in column 3, row 8 to (String(Player_Deaths[12]))
          • Multiboard - Set the text for Multiboard item in column 2, row 8 to (String(Player_Kills[12]))
          • Player - Make Switcher[Switcher_Number] treat Player 1 (Red) as an Enemy
          • Player - Make Player 1 (Red) treat Switcher[Switcher_Number] as an Enemy
          • Player - Make Switcher[Switcher_Number] treat Player 12 (Brown) as an Ally with shared vision
          • Player - Make Player 12 (Brown) treat Switcher[Switcher_Number] as an Ally with shared vision
          • Player - Make (Player(Switched)) treat Player 1 (Red) as an Ally with shared vision
          • Player - Make Player 1 (Red) treat (Player(Switched)) as an Ally with shared vision
          • Player - Make (Player(Switched)) treat Player 12 (Brown) as an Enemy
          • Player - Make Player 12 (Brown) treat (Player(Switched)) as an Enemy
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Switcher[Switcher_Number] is an ally of Player 12 (Brown)) Equal to True
            • Then - Actions
              • Set Player_Kills[1] = (Player_Kills[1] + Player_Kills[(Player number of Switcher[Switcher_Number])])
              • Set Player_Kills[12] = (Player_Kills[12] - Player_Kills[(Player number of Switcher[Switcher_Number])])
              • Set Player_Deaths[1] = (Player_Deaths[1] + Player_Deaths[(Player number of Switcher[Switcher_Number])])
              • Set Player_Deaths[12] = (Player_Deaths[12] - Player_Deaths[(Player number of Switcher[Switcher_Number])])
              • Multiboard - Set the text for Multiboard item in column 2, row 2 to (String(Player_Kills[1]))
              • Multiboard - Set the text for Multiboard item in column 3, row 2 to (String(Player_Deaths[1]))
              • Multiboard - Set the text for Multiboard item in column 3, row 8 to (String(Player_Deaths[12]))
              • Multiboard - Set the text for Multiboard item in column 2, row 8 to (String(Player_Kills[12]))
              • Player - Make Switcher[Switcher_Number] treat Player 1 (Red) as an Ally with shared vision
              • Player - Make Player 1 (Red) treat Switcher[Switcher_Number] as an Ally with shared vision
              • Player - Make Switcher[Switcher_Number] treat Player 12 (Brown) as an Enemy
              • Player - Make Player 12 (Brown) treat Switcher[Switcher_Number] as an Enemy
              • Player - Make (Player(Switched)) treat Player 1 (Red) as an Enemy
              • Player - Make Player 1 (Red) treat (Player(Switched)) as an Enemy
              • Player - Make (Player(Switched)) treat Player 12 (Brown) as an Ally with shared vision
              • Player - Make Player 12 (Brown) treat (Player(Switched)) as an Ally with shared vision
            • Else - Actions
      • -------- Here we set Position of revive circles, to change places --------
      • Set Switcher_Point = (Position of Circles[Switcher_Number])
      • Set Switched_Point = (Position of Circles[Switched])
      • -------- We change places --------
      • Unit - Move Circles[Switcher_Number] instantly to Switched_Point
      • Unit - Move Circles[Switched] instantly to Switcher_Point
      • -------- Moves all units, except non hero (circles, etc) to base --------
      • Unit Group - Pick every unit in Hardened_Skin_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
              • (Number of units in Hardened_Skin_Group) Greater than 0
            • Then - Actions
              • Unit - Move (Picked unit) instantly to Switched_Point
              • Camera - Lock camera target for (Player(Switched)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
              • Camera - Stop the camera for (Player(Switched))
              • Multiboard - Set the icon for Multiboard item in column 1, row Player_Row[Switcher_Number] to Hero_Icons[(Point-value of (Picked unit))]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Unknown (A054) for (Picked unit)) Equal to 1
                • Then - Actions
                  • Unit - Remove Unknown (A054) from (Picked unit)
                • Else - Actions
            • Else - Actions
      • -------- Icons of heroes in the multiboard... --------
      • -------- Leak prevention, cause we will use this variable later :) --------
      • Custom script: call DestroyGroup(udg_Hardened_Skin_Group)
      • -------- Here we use it :), we pick units owned by targeted player --------
      • Set Hardened_Skin_Group = (Units in (Playable map area) owned by (Player(Switched)))
      • -------- Move the units to the base... --------
      • Unit Group - Pick every unit in Hardened_Skin_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
              • (Number of units in Hardened_Skin_Group) Greater than 0
            • Then - Actions
              • Unit - Move (Picked unit) instantly to Switcher_Point
              • Camera - Lock camera target for (Player(Switched)) to (Picked unit), offset by (0.00, 0.00) using Default rotation
              • Camera - Stop the camera for (Player(Switched))
              • Multiboard - Set the icon for Multiboard item in column 1, row Player_Row[Switched] to Hero_Icons[(Point-value of (Picked unit))]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Unknown (A054) for (Picked unit)) Equal to 1
                • Then - Actions
                  • Unit - Remove Unknown (A054) from (Picked unit)
                • Else - Actions
            • Else - Actions
      • -------- Leak prevention... --------
      • Custom script: call DestroyGroup(udg_Hardened_Skin_Group)
      • -------- Set stuff to null, false etc, for further use --------
      • Set Switch_On = False
      • Set Switcher_Number = 0
      • Set Switch_Votes = 0
      • Set Switched = 0
      • -------- Leaks --------
      • Custom script: call RemoveLocation(udg_Switcher_Point)
      • Custom script: call RemoveLocation(udg_Switched_Point)
      • For each (Integer Switch_Loop_Integer) from 2 to 11, do (Actions)
        • Loop - Actions
          • Set Switch_Vote[Switch_Loop_Integer] = False
      • -------- For further use! --------
      • Trigger - Turn off (This trigger)


And the time out ;D
Switch Timeout
  • Switch Timeout
    • Events
      • Time - Switch_Time expires
    • Conditions
      • Switch_On Equal to True
    • Actions
      • -------- Set the stuff to null, false for further use --------
      • Set Switched = 0
      • Set Switcher_Number = 0
      • Set Switch_On = False
      • Set Switch_Votes = 0
      • -------- Inform about the expiration --------
      • Game - Display to (All players) for 10.00 seconds the text: |c00FF0303Switching...
      • For each (Integer Switch_Loop_Integer) from 2 to 11, do (Actions)
        • Loop - Actions
          • Set Switch_Vote[Switch_Loop_Integer] = False


Changelog

Version 1.0: First release

Version 1.1: Updated the code (almost cut it in half)

Version 1.2: Updated the code, fixed the colors and the -switch check trigger

Version 1.2b: Added an in-game screenshot

Version 1.2c: Fixed a problem with hero glow.

Version 1.3: Fully working share system, although currently trying to fix the players that haven't even started the game (empty slots), but with full slots works PERFECTLY. Multiboard improved. Added mini-kick system to try the share units properly.

Version 1.4: Hopefully fixed the whole system perfectly (colors, controls). Polished the code. However the colors in the testmap with Computers will be screwed because colored names can't be colored and the Players in the testmap are written in colors (Player properties. I can't open it since it crashes my WE, thus can't fix it) IF anybody of you could open the player properties, delete the colors and send me the map i could update :)



Comments, suggestions, fixes; It's up to you hivers! :)
Good luck,
Tiche3:grin:

Keywords:
Switch, Switch system, GUI, AoS
Contents

Switch System v1.4 (Map)

Reviews
Moderator
23:26, 3rd Jun 2010 The_Reborn_Devil: The triggering seems to be fine and this could indeed be useful in AoS maps. Status: Approved Rating: Useful
  1. 23:26, 3rd Jun 2010
    The_Reborn_Devil:

    The triggering seems to be fine and this could indeed be useful in AoS maps.


    Status: Approved
    Rating: Useful
     
  2. Tiche3

    Tiche3

    Joined:
    Jun 25, 2009
    Messages:
    432
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Please rate, comment, suggest, it will be uploaded soon i guess :)

    And yeah, this is the first thing that i EVER put in here, so critisism will be tolerated and taken and hope you don't make stuff worse for me (comments like: This is sooooo peace of Sh*t)

    Guys, i didn't mention it, but please give credits if you use it, this thing is not created by you, so ;)

    EDIT: Still haven't mentioned, when you test this, please put computers to check this system, cause else it won't happen ;D (i think it works with leavers actually:))

    Regards,
    Tiche3:grin:
     
  3. D4RK_G4ND4LF

    D4RK_G4ND4LF

    Joined:
    Feb 4, 2009
    Messages:
    1,196
    Resources:
    20
    Models:
    3
    Spells:
    15
    Tutorials:
    2
    Resources:
    20
    All your work will be in vain 'cause playergroups leak
    You've got my heartfelt sympathy :ugly:

    Anyway it would be easier to save everything in a few arrays (unittypes, icons, etc.) so your code will be much shorter and a lot more customizable
    For example like this:
    Set SystemName_Unittype[0] = archer
    Set SystemName_Icon[0] = PathOfArcherIcon
    Set SystemName_Unittype[1] = Footy
    Set SystemName_Icon[1] = PathOfFootyIcon
    and so on
    this way you can loop through your array and check if it's right

    it might be possible that you will have problems regarding the opperation limit cause multiboard actions are very long (you can only run a specific amount of code every time you execute a trigger)
    but if you are lucky it will work fine...just so you know why things happen if you have any bugs with 12 players
    also playergrouppicks in playergrouppicks or similar stuff might create a lot of code (running a 12 player enumeration inside of a 12 player enumeration + some stupid blizzard wrapper functions might fuck up your whole code)
    you can bypass this by either using waits (which are slow and likely to cause bugs) or by dividing your trigger into many smaller ones and executing one after another

    I'd also recommend to save all ally/enemy settings in an array to make the code faster and smaller

    ....and if you could make something which won't interfere with unit control sharing [cause dota does not have it -.- ] your system will be quite awesome

    edit:
    the creation of the playergroup will cause the leak
    picking players in a playergroup will be fine
    • Game - Display to (Player group((Triggering player))) for 8.00 seconds the text: "text"

    will leak
    I solved that in my map (which is not ready yet) by creating 12 groups with one player each and do stuff like:
    • Game - Display to PlayerGroupVariable[PlayerNumber] for 8.00 seconds the text: "text"

    so you create the group only once and it won't leak

    "All Players" won't leak either because it is referring to a global variable which won't be recreated or destroyed

    • Player Group - Make (All allies of Player 1 (Red)) treat (Player group(Switcher[Switcher_Number])) as an Enemy

    leaks
     
  4. Tiche3

    Tiche3

    Joined:
    Jun 25, 2009
    Messages:
    432
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Thanks, and for the player groups, huh, i'll have to check them out.

    Holy Sh*t i really forgot them, will update in few days ;D

    EDIT: I actually checked it out, but i don't get why is it leaking, i'm not picking a player group or something? ;/

    EDIT2: So you mean something like (allies of player 1) should be changed in before setting Var=ALlies of blah, then use var instead of it and then destroying force? ;) With multiboard, guys, it's my map (teh multiboard) in your map multiboard is hella different from meh, so you can CHANGE Everything associated with multiboards :) and actually, about the player leaks, i'll fix it, because i use this system in my map (the dl is my map) :D

    What do you mean? :)
     
    Last edited: Mar 20, 2010
  5. Freeze87

    Freeze87

    Joined:
    Jun 1, 2009
    Messages:
    559
    Resources:
    5
    Maps:
    5
    Resources:
    5
    I need this system but without leaks...
     
  6. Tiche3

    Tiche3

    Joined:
    Jun 25, 2009
    Messages:
    432
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I'll work on that, since it is v1.0 and it will be updated :)
     
  7. VoidLordXtreme

    VoidLordXtreme

    Joined:
    Mar 30, 2009
    Messages:
    250
    Resources:
    0
    Resources:
    0
    simply use this to clear your leaks :)
     
  8. Tiche3

    Tiche3

    Joined:
    Jun 25, 2009
    Messages:
    432
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Thanks, i'll look into it now :)

    EDIT: Looked at it, only player group leaks, set var, treat var, destroyforce var, FIXED!!, i'll do it! :)
     
  9. ALiEN95

    ALiEN95

    Joined:
    Mar 4, 2009
    Messages:
    1,148
    Resources:
    1
    Spells:
    1
    Resources:
    1
    To make this much much shorter use integer variables...... 0_0 , integer action from 1 to X

    exaples....

    STRING[1] = ReplaceableTextures\CommandButtons\MAGE
    STRING[2] = ReplaceableTextures\CommandButtons\DRAGON
    STRING[3] = ReplaceableTextures\CommandButtons\VAMPIRE

    HERO_PICKED[1] = MAGE
    HERO_PICKED[2] = DRAGON
    HERO_PICKED[3] = VAMPIRE

    for each integer from 1 to 3 do actions
    IF HERO_PICKED[Integer A] = Unit type of Hero picked
    set ICON to STRING[Integer A]

    or,you can put point value to STRING number with is even better

    MAGE - set his point value in object editor to 1
    DRAGON - set his point value in object editor to 2
    VAMPIRE - set his point value in object editor to 3

    set ICON to STRING[point value of Hero picked]
     
  10. Tiche3

    Tiche3

    Joined:
    Jun 25, 2009
    Messages:
    432
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Thanks alien, but for you guys, you can just simply delete it if you don't need it, of course when i'll get my working computer, i'll fix these problems right away :)
     
  11. jim7777

    jim7777

    Joined:
    May 27, 2009
    Messages:
    481
    Resources:
    7
    Maps:
    2
    Spells:
    5
    Resources:
    7
    You could also use Unit Point Values to determine does.. in that way.. its shorter... String Arrays are also quite good:

    Here's an example:
    • Multiboard - Set the icon for Multiboard item in column 1, row Player_Row[(Player number of Switcher[Switcher_Number])] to HeroIcons[(Point Value of (Picked Unit))]


    remember to change a unit's point value at the object editor!!

    and btw.. please enable switching.. even player opponent is a computer... i can't run it though...

    just my comments..

    fix leak stuff...
    optimize the triggers and quite make it a little customizable..
    And if possible, when you -switch, the opponent list will pop up right? it you can put what is the status of the opponent.. like if he have already left the game...

    EDIT: found the problem..

    the trigger : Switch Start is initialized but even I only typed -switch itself making me show the other gamemessage.. fix that :]
     
    Last edited: Mar 27, 2010
  12. Tiche3

    Tiche3

    Joined:
    Jun 25, 2009
    Messages:
    432
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Thanks for everythin, i'll totally fix every single bit of these thingies, but first i need to get my working comp back :cry:

    EDIT: Got my working comp back, did all the stuff, BUT the hero icons with [point value] worked, BUT only green bars were shown instead of icons, i did it with string array.
    Regards, Tiche3 (The new version will be released soon)

    Tiche3:grin:
     
    Last edited: Mar 29, 2010
  13. Tiche3

    Tiche3

    Joined:
    Jun 25, 2009
    Messages:
    432
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Currently fixed the green bar bug, version will be soon updated.
     
  14. ALiEN95

    ALiEN95

    Joined:
    Mar 4, 2009
    Messages:
    1,148
    Resources:
    1
    Spells:
    1
    Resources:
    1
    i forgot to mention..well it would be a bit bigger update

    there should be only one cheat event for every player and that is
    player types "-" as a substring

    and than you have to check the rest of it and that is substring 2,(Lengh of entered theat string)

    however,with this you will make all of your actions in one bigger trigger
     
  15. Tiche3

    Tiche3

    Joined:
    Jun 25, 2009
    Messages:
    432
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Thanks for advice, i actually don't know (or just too lazy) so i'll post with this question.

    Everything is done, except the thing you suggested.

    New version will be updated soon. And yeah, more to come in the next version: -switch. Write not only the names of the players. It will write the numbers.

    Example: -switch

    Tiche3 -switch 1
    Alien -switch 2
    Blahblah -switch 3
    Pwnage Techies -switch 4
    Hehe -switch 5


    Like this :)

    EDIT: Updating.... Updated. Please comment and rate. Thank you.
     
    Last edited: May 21, 2010
  16. ALiEN95

    ALiEN95

    Joined:
    Mar 4, 2009
    Messages:
    1,148
    Resources:
    1
    Spells:
    1
    Resources:
    1
    im the second player :gg:

    i think its better to do it with colors but numbers can be included
    (kicking by player´s name can be to hard)

    you have to make one String Array variable
    than set that strings at
    Map Initialization:

    String[1] = red
    String[2] = blue
    ...

    than when player types
    sub string(entered cheat string) 2,8 Equal to "kick " (8 because of space)

    for each integer from 1 to 12
    if Substring (9,20) equal to String[Integer A]than do actions...


    here are some trigger basics (find some substring tutorial if you need),im posting this to a lot of people so you probably already know some of the things here

    Basics of Triggering
    you can go to tutorial section too
    http://www.hiveworkshop.com/forums/tutorials/

    you need to learn about:

    Variables !
    Array Variables !
    Hash tables are also very good (they are 2d Arrays)
    and so called Fake Multi-Array variables would be good too (1-12,13-24,25-36....)

    Learn what to do with all those Integer and Real values - degrease,distance,custom value ...etc

    to use from 1 to 12
    1 x 12 - 11 <-----> 1 x 12 (1 can be integer A)
    to use from 13 to 24
    2 x 12 - 11 <-----> 2 x 12 (2 can be integer A)
    to use from 25 to 36
    3 x 12 - 11 <-----> 3 x 12 (3 can be integer A)
    -for example if you need save that TriggeringPlayer likes SomePlayer xD
    make Boolean Array Variable - Like[X]
    set Like[((Number of Triggering Player x 12) - 11) + (Player Number of (SomePlayer))] = True


    Use Pick Every Player/Unit/Item... and do actions
    loop - do something about Picked Player/Unit/Item...


    IF/THAN/ELSE actions are really needed
    they are very good and with it you can make all triggers with same event in one trigger

    For each integer A from X to X
    loop - your actions


    For each integer B from X to X
    loop - your actions

    (integer B actions are used if you need to put it in loop of integer A actions)

    sub strings X,Y are good for command triggers (and array-string variables are good for it too,if you want player color detect or something like that,you can check if the color is typed by checking String[Integer A] in the Loop of Integer A actions)
    (you should also have all command triggers in one trigger,and only event player types "-" as a sub string
    than you check what is the rest of it (for example)
    sub string(entered cheat string) 2,6 Equal to "kick " (6 because of space)

    Removing Memory Leaks (i think you don't really need to remove player group leaks,i never did and nothing happens,maybe after 1.000.000 times -.-)

    it is good to know for Events - Unit issued targeting an object/point/no target

    but to stop TriggeringUnit on that events you need to do this:
    (i think it is best combination for it)

    -turn off this trigger
    -pause TriggeringUnit
    -unpause TriggeringUnit
    -order TriggeringUnit to stop
    -turn on this trigger


    and some more :D

     
  17. ALiEN95

    ALiEN95

    Joined:
    Mar 4, 2009
    Messages:
    1,148
    Resources:
    1
    Spells:
    1
    Resources:
    1
    im the seconds player :gg:

    i think its better to do it with colors but numbers can be included
    (if you don't want it with colors than make a game text info of player numbers because its confusing when you don't play full house)
    (kicking by player´s name can be to hard)

    for color detection you have to make one String Array variable
    than set that strings at
    Map Initialization:

    String[1] = red
    String[2] = blue
    ...

    than when player types
    sub string(entered cheat string) 2,8 Equal to "switch " (8 because of space)

    for each integer from 1 to 12
    if Substring (9,20) equal to String[Integer A]than do actions...


    here are some trigger basics (find some substring tutorial if you need)

    Basics of Triggering
    you can go to tutorial section too
    http://www.hiveworkshop.com/forums/tutorials/

    you need to learn about:

    Variables !
    Array Variables !
    Hash tables are also very good (they are 2d Arrays)
    and so called Fake Multi-Array variables would be good too (1-12,13-24,25-36....)

    Learn what to do with all those Integer and Real values - degrease,distance,custom value ...etc

    to use from 1 to 12
    1 x 12 - 11 <-----> 1 x 12 (1 can be integer A)
    to use from 13 to 24
    2 x 12 - 11 <-----> 2 x 12 (2 can be integer A)
    to use from 25 to 36
    3 x 12 - 11 <-----> 3 x 12 (3 can be integer A)
    -for example if you need save that TriggeringPlayer likes SomePlayer xD
    make Boolean Array Variable - Like[X]
    set Like[((Number of Triggering Player x 12) - 11) + (Player Number of (SomePlayer))] = True


    Use Pick Every Player/Unit/Item... and do actions
    loop - do something about Picked Player/Unit/Item...


    IF/THAN/ELSE actions are really needed
    they are very good and with it you can make all triggers with same event in one trigger

    For each integer A from X to X
    loop - your actions


    For each integer B from X to X
    loop - your actions

    (integer B actions are used if you need to put it in loop of integer A actions)

    sub strings X,Y are good for command triggers (and array-string variables are good for it too,if you want player color detect or something like that,you can check if the color is typed by checking String[Integer A] in the Loop of Integer A actions)
    (you should also have all command triggers in one trigger,and only event player types "-" as a sub string
    than you check what is the rest of it (for example)
    sub string(entered cheat string) 2,6 Equal to "kick " (6 because of space)

    Removing Memory Leaks (i think you don't really need to remove player group leaks,i never did and nothing happens,maybe after 1.000.000 times -.-)

    it is good to know for Events - Unit issued targeting an object/point/no target

    but to stop TriggeringUnit on that events you need to do this:
    (i think it is best combination for it)

    -turn off this trigger
    -pause TriggeringUnit
    -unpause TriggeringUnit
    -order TriggeringUnit to stop
    -turn on this trigger


    and some more :D



    edit:
    you should also store player´s colors into a string array variable
    btw this system could be made much shorter
     
    Last edited: May 21, 2010
  18. tjordell

    tjordell

    Joined:
    Jan 25, 2009
    Messages:
    554
    Resources:
    5
    Icons:
    1
    Spells:
    4
    Resources:
    5
    Tiche3, I think you must have a proper screenshot of you'r system, otherwise this will not get approven.
     
  19. Anachron

    Anachron

    Joined:
    Sep 9, 2007
    Messages:
    6,176
    Resources:
    66
    Icons:
    49
    Packs:
    2
    Tools:
    1
    Maps:
    3
    Spells:
    9
    Tutorials:
    1
    JASS:
    1
    Resources:
    66
    Wtf, why did you upload the whole map? Only update the system.
    1.8mb for a system is way to much.