• 🏆 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!

GUI Switch System v1.4

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
    • 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 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
    • 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
    • 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
  • 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
    • 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

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
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

Moderator

M

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
 
Level 9
Joined
Jun 25, 2009
Messages
427
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:
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
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
 
Level 9
Joined
Jun 25, 2009
Messages
427
All your work will be 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

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

....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
What do you mean? :)
 
Last edited:
Level 13
Joined
Mar 4, 2009
Messages
1,156
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]
 
Level 9
Joined
Jun 25, 2009
Messages
427
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]

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 :)
 
Level 10
Joined
May 27, 2009
Messages
494
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:
Level 9
Joined
Jun 25, 2009
Messages
427
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 :]

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:
Level 13
Joined
Mar 4, 2009
Messages
1,156
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
 
Level 9
Joined
Jun 25, 2009
Messages
427
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

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:
Level 13
Joined
Mar 4, 2009
Messages
1,156
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 :)
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

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

 
Level 13
Joined
Mar 4, 2009
Messages
1,156
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 :)
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)

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:
Level 9
Joined
Jun 25, 2009
Messages
427
things you need for this system are been fixed or added up by me.
(Colors, and -switch (number) )

if you want it, i could give it to you, I just passed by to this system D:

If you could help me with colors that would be good. Pm me please.

@Tjordell, i can't make a screenshot of two players switching places. I'm sorry.

@Anarchron. I updated the system, but the system is in my map and it would be very hard for me to create a whole new map (multiboards etc) even by ctrl+c/+v. And about the 0.22 it's because my map got updated >.> :D Still waiting for further comments. And be assured that the switch system will be updated! The system itself is only 5 or 6 triggers

@Alien, i didn't actually get your idea, sorry :/ (It'll take time for me to understand, because tomorrow i have an exam, so it's not in my mind, i'll look later and come up with a solution)
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
@Alien, i didn't actually get your idea, sorry :/ (It'll take time for me to understand, because tomorrow i have an exam, so it's not in my mind, i'll look later and come up with a solution)
its a way in witch you can detect players by typing color of player,but if you don't wanna play with this you can just have a detection with numbers but make a Game Info or Game Text of player numbers

but anyway....lets say that you have only 3 players

Set this String Array Variables at Map Initialization

String[1] = red
String[2] = blue
String[3] = teal

String[1] is string for Player 1 (Red)
String[2] is string for Player 2 (Blue)
String[3] is string for Player 3 (Teal)

now when player types "-switch " you will check what color of player is typed
the string "-switch " has 8 characters and color will start from 9-th character
you need to check all the String Variables and to do this you use Integer A actions

for each Integer A from 1 to 3 do actions
if Substring(Entered cheat string)9,20 Equal to String[Integer A] than
-switch Player[Integer A] (Player Integer A is player matching the color)


if Substring(Entered cheat string)9,20 Equal to String[Integer A] than is the string types from 9-th to 20-th character and if that string is matching the String Variable that the player is switched
 
Level 9
Joined
Jun 25, 2009
Messages
427
its a way in witch you can detect players by typing color of player,but if you don't wanna play with this you can just have a detection with numbers but make a Game Info or Game Text of player numbers

but anyway....lets say that you have only 3 players

Set this String Array Variables at Map Initialization

String[1] = red
String[2] = blue
String[3] = teal

String[1] is string for Player 1 (Red)
String[2] is string for Player 2 (Blue)
String[3] is string for Player 3 (Teal)

now when player types "-switch " you will check what color of player is typed
the string "-switch " has 8 characters and color will start from 9-th character
you need to check all the String Variables and to do this you use Integer A actions

for each Integer A from 1 to 3 do actions
if Substring(Entered cheat string)9,20 Equal to String[Integer A] than
-switch Player[Integer A] (Player Integer A is player matching the color)


if Substring(Entered cheat string)9,20 Equal to String[Integer A] than is the string types from 9-th to 20-th character and if that string is matching the String Variable that the player is switched

Actually, what i do think that it is good as it is now.

And for the guy who could try to help me with colors, i mean, when you switch for 7 times, all your team is color blue.

EDIT: I might have an idea, when i get to my working comp i'll try to do it :)
 
Last edited:
Level 9
Joined
Jun 25, 2009
Messages
427
Hey guys i figured it out!!! Updating the system.:grin:
EDIT: Updated the system. Changed the -switch command (without any numbers) and fixed the numbers when you type -switch, also fixed the color problem. Now everything should be fine.

Comment and rate. Thanks for your support and telling the stuff that was wrong.
 
Last edited:
Level 9
Joined
Jun 25, 2009
Messages
427
Version 1.2b, updated and added a proper in-game screenshot, although to me it shows the previous one but only when i click it shows me the real one, might be my internet problem :)

EDIT: Yahoo 250 posts :D

Tiche3
 
Level 9
Joined
Jun 25, 2009
Messages
427
i'm just wondering why still you need to turn off the Switch Action trigger @_@ but it can only be run by executing it via another trigger.. in fact you could run a trigger even if it is off.

gonna test it now

To answer your question ill look into the code.

Looked into the code and here's the answer: There is no event :) I don't know what event i could use so it just goes like this :)

EDIT: Re-uploaded the version and now it shows a normal-proper in game screenshot of the very system. YAY! :D

EDIT2: The system got approved, so it works properly, have fun using it ;)
 
Last edited:
Level 9
Joined
Jun 25, 2009
Messages
427
Updated. Hey guys, check out the newest switch system: Known bugs - when there are open slots, the share units doesn't work properly but with full slots it works perfectly. I am trying to fix this issue right now and i will update.

Multiboard improved, now the teamscores are set to show normal results.
 
Level 9
Joined
Jun 25, 2009
Messages
427
Full freaking initialization =.=
eh,how u calculate the point to create the starting buildings?

I didn't know people will go through my map and check other triggers, well it's quite expected, anyways.

When i open my map editor, where to move the mouse in the left-down corner it shows X/Y, then i just type the amounts (+/-) and there you go :D

Anything regarding Switch system? :)

Tiche3
 
Level 2
Joined
Dec 28, 2010
Messages
21
There are some mistakes with player names.
You just select the colour, but don't show player names in all text messages.

And also in Switch Timeout add may be:
  • Set Switch_Votes = 0
Thx for the system))
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
Level 9
Joined
Jun 25, 2009
Messages
427
Almost this entire system was made and released by me, this is plagiarism and you can find a huge majority of the code in my post.
http://www.hiveworkshop.com/forums/triggers-scripts-269/command-switch-158907/#post1479580

PLEASE REMOVE THIS CODE IT IS MINE!

I'm quoting

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 and the rest (multiboards, etc) use them from your map.

So basicaly, there is a lot of stuff in the action place, if you want you can change everything, except the ally changing (ofc if the players change, change that in that section(what i mean is like from red till pink so you have to change something :)))

Here are the triggers, i tried to explain everything :)

There, so you can see. Also, you made the map for me, and gave your priorities to me, you also were credited for WHOLE VOTE SYSTEM, and it's not exactly the same, since i improved it :)

Don't need to flame for it though... (read the first page or the quote above :))

Tiche3
 
Level 9
Joined
Jun 25, 2009
Messages
427
I dont understand why you make it harder for people... wh y umake it 2 to 11? wtf? why not make it 1 to 10 as usual?

Well, you seem to be angry (looking at your spelling ;)) so I'll explain this like this. (It's also explained in the triggers if I remember correctly) In my map, the functioning players are from 2-11, because as you see the map has Player 1 (Red) and Player 12 (Brown) as a computer, thus I don't pick those players in the loop.

I hope i've explained it to you in a understandable way.

Tiche3
 
Level 9
Joined
Jun 25, 2009
Messages
427
Hey guys!!! I've updated the version because my conscience was killing me since the system got approved even though it did not work perfectly :(

Most of the things that have been updated are written in the changelog. I don't know why but whenever i try to open Player Properties it crashes my editor. The colors of the computer names are written in colors there (|cff0000Player 5|r for example) and they can't be changed via triggers.

If anyone could go inside the map and delete the colors from the player names and send me the map via private message i would be glad to update this map and make the test map work perfectly.

Also rates and comments are appreciated guys ;)

Regards,
Tiche3
 
Top