• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[GUI] Hero Swap System 1.1

  • Like
Reactions: Zeffo
Fully MPI Hero Swap System - HSS - Up to 12 players.
Made for simple, instant use, but also has many extra functions
Copy paste into your map, and it will instantly work right away.

This was done on specific request, and I added a few more options for broader functionality.
Useful for any map that uses Heroes and has a random hero mode (AoS, Hero Arena, Hero Survival/Defense) or even units (TD builders).

How it works:
Type -swap (player number) or -swap (player color) to send request to player
The player will type -swap (your #/ your color) to confirm the swap.
The heroes will then swap ownership.

Dynamic, adjustable configurations including:
  • Swapping by color with multiple spellings of various colors
  • Swapping by player number (1-12)
  • Instant computer swap (if testing map, play single player/lan, must have computer slots)
  • Filtering out particular players from swapping (for certain computers?)
  • Item + item charges retention upon swapping
  • Many configurable options
  • Swapping with leavers instantly

Users have full rights to adjust the system to fit their needs.


  • File -> Preferences -> General Tab -> Automatically create unknown variables while pasting ON
  • Copy Hero Swap System Folder, Paste in desired map
  • Optional: Go to HSS Configuration trigger and adjust some settings True/False to your liking
  • Optional: Define your Heroes so the system knows what to swap (else it gets by random, which works too)


  • HSS Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ------------------------------------------------------------------------------- --------
      • -------- Allows swapping using [-swap color] text command --------
      • -------- ------------------------------------------------------------------------------- --------
      • Set HSS_SwapByColor = True
      • -------- ------------------------------------------------------------------------------------------- --------
      • -------- Allows swapping with computer if they have a defined hero --------
      • -------- ------------------------------------------------------------------------------------------- --------
      • Set HSS_AllowCompSwap = True
      • -------- ------------------------------------------------------------------------------------------------------------------------------------ --------
      • -------- Finds random hero owned by target player if code-user did not define hero or forgot to --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------ --------
      • Set HSS_GetRandHeroIfNull = True
      • -------- ---------------------------------------------------------------------------------------------------------------------------- --------
      • -------- This line will make Player(1) - Red, unable to swap, if the boolean is set to True --------
      • -------- An example usage of filtering is if you want to filter out one of your computers --------
      • -------- ---------------------------------------------------------------------------------------------------------------------------- --------
      • Set HSS_Filter[1] = False
      • -------- ---------------------------------------------------------------------------------------------------------------- --------
      • -------- Allows items on hero inventories to swap with the hero (true means you keep your items) --------
      • -------- ---------------------------------------------------------------------------------------------------------------- --------
      • Set HSS_AllowItemSwap = True
      • -------- ------------------------------------------------------------------------------- --------
      • -------- Does the position of the hero get swapped as well? (true means you keep your position) --------
      • -------- ------------------------------------------------------------------------------- --------
      • Set HSS_PositionSwap = True
      • -------- -------------------------------------------------------------------------------------------- --------
      • -------- Allows instant swapping with players who left/disconnected --------
      • -------- -------------------------------------------------------------------------------------------- --------
      • Set HSS_AllowLeaverSwap = True
      • If (HSS_AllowLeaverSwap Equal to True) then do (Trigger - Turn on HSS Leaver Swap Option <gen>) else do (Do nothing)
      • -------- -------------------------------------------------------------- --------
      • -------- Set up error or swap fail messages here --------
      • -------- -------------------------------------------------------------- --------
      • Set HSS_ErrorString[1] = You cannot swap heroes with yourself!
      • Set HSS_ErrorString[2] = You cannot swap heroes with this computer!
      • Set HSS_ErrorString[3] = The target player does not have a hero to swap with!
      • Set HSS_ErrorString[4] = You cannot swap with the enemy hero!
      • Set HSS_ErrorString[5] = You cannot swap with a non-existing player!
      • -------- ------------------------------------------------------------- --------
      • -------- Set up swap by color command strings --------
      • -------- ------------------------------------------------------------- --------
      • Set PlayerColors[1] = |c00ff0303
      • Set PlayerColors[2] = |c000042ff
      • Set PlayerColors[3] = |c001ce6b9
      • Set PlayerColors[4] = |c00540081
      • Set PlayerColors[5] = |c00fffc01
      • Set PlayerColors[6] = |c00ff8000
      • Set PlayerColors[7] = |c0020c000
      • Set PlayerColors[8] = |c00e55bb0
      • Set PlayerColors[9] = |c00959697
      • Set PlayerColors[10] = |c007ebff1
      • Set PlayerColors[11] = |c00106246
      • Set PlayerColors[12] = |c004e2a04
      • -------- ------------------------------------------------------------- --------
      • Set HSS_ColorStringVariation1[1] = red
      • Set HSS_ColorStringVariation1[2] = blue
      • Set HSS_ColorStringVariation1[3] = teal
      • Set HSS_ColorStringVariation1[4] = purple
      • Set HSS_ColorStringVariation1[5] = yellow
      • Set HSS_ColorStringVariation1[6] = orange
      • Set HSS_ColorStringVariation1[7] = green
      • Set HSS_ColorStringVariation1[8] = pink
      • Set HSS_ColorStringVariation1[9] = gray
      • Set HSS_ColorStringVariation1[10] = light blue
      • Set HSS_ColorStringVariation1[11] = dark green
      • Set HSS_ColorStringVariation1[12] = brown
      • -------- ------------------------------------------------------------- --------
      • Set HSS_ColorStringVariation2[4] = purp
      • Set HSS_ColorStringVariation2[6] = oj
      • Set HSS_ColorStringVariation2[9] = grey
      • Set HSS_ColorStringVariation2[10] = lightblue
      • Set HSS_ColorStringVariation2[11] = darkgreen
      • -------- ------------------------------------------------------------- --------
      • Set HSS_ColorStringVariation3[10] = lb
      • Set HSS_ColorStringVariation3[11] = dg
      • -------- ------------------------------------------------------------- --------
      • -------- Add long repeating events in loop now --------
      • -------- ------------------------------------------------------------- --------
      • For each (Integer HSS_Integer) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set PlayerNames[HSS_Integer] = (PlayerColors[HSS_Integer] + (Name of (Player(HSS_Integer))))
          • Trigger - Add to HSS Swap Command <gen> the event (Player - (Player(HSS_Integer)) types a chat message containing -swap as A substring)
          • Trigger - Add to HSS Leaver Swap Option <gen> the event (Player - (Player(HSS_Integer)) leaves the game)


  • HSS Swap Command
    • Events
    • Conditions
      • (Length of (Entered chat string)) Greater than or equal to 7
    • Actions
      • -------- ------------------------- --------
      • -------- Reset Variable(s) --------
      • -------- ------------------------- --------
      • Set HSS_SwapTarget = 0
      • -------- ------------------------------------------------------------ --------
      • -------- Check the Chatstring for Colors/# Swap --------
      • -------- ------------------------------------------------------------ --------
      • Set HSS_SwapString = (Entered chat string)
      • Trigger - Run HSS Check Chatstring <gen> (checking conditions)
      • -------- ------------------------------------------------------------------ --------
      • -------- Define Swapping Player and Target Player --------
      • -------- ------------------------------------------------------------------ --------
      • Set HSS_SwapRequester = (Player number of (Triggering player))
      • Set HSS_SwapRequest[HSS_SwapRequester] = HSS_SwapTarget
      • -------- ------------------------------------------- --------
      • -------- Run Core Swapping Trigger --------
      • -------- ------------------------------------------- --------
      • If (HSS_SwapTarget Not equal to 0) then do (Trigger - Run HSS Core <gen> (checking conditions)) else do (Do nothing)


  • HSS Check Chatstring
    • Events
    • Conditions
    • Actions
      • -------- ----------------------------------------------------------------------------- --------
      • -------- Checks chatstring for all color and number strings --------
      • -------- ----------------------------------------------------------------------------- --------
      • For each (Integer HSS_Integer) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • ((String((Substring(HSS_SwapString, 7, (Length of HSS_SwapString)))) as Lower case) Equal to HSS_ColorStringVariation1[HSS_Integer]) and (HSS_SwapByColor Equal to True)
                  • ((String((Substring(HSS_SwapString, 7, (Length of HSS_SwapString)))) as Lower case) Equal to HSS_ColorStringVariation2[HSS_Integer]) and (HSS_SwapByColor Equal to True)
                  • ((String((Substring(HSS_SwapString, 7, (Length of HSS_SwapString)))) as Lower case) Equal to HSS_ColorStringVariation3[HSS_Integer]) and (HSS_SwapByColor Equal to True)
                  • (String((Substring(HSS_SwapString, 7, (Length of HSS_SwapString)))) as Lower case) Equal to (String(HSS_Integer))
            • Then - Actions
              • If (HSS_Filter[HSS_Integer] Equal to False) then do (Set HSS_SwapTarget = HSS_Integer) else do (Do nothing)
              • Skip remaining actions
            • Else - Actions


  • HSS Core
    • Events
    • Conditions
    • Actions
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- If configuration GetRandomHeroIfNothingFound = True, then HSS will attempt to find a random hero if code-user did not define. --------
      • -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HSS_GetRandHeroIfNull Equal to True
        • Then - Actions
          • Set TempGroup = (Units owned by (Player(HSS_SwapTarget)) matching (((Matching unit) is A Hero) Equal to True))
          • If ((Unit-type of Player_Hero[HSS_SwapTarget]) Equal to (Unit-type(<Empty String>))) then do (Set Player_Hero[HSS_SwapTarget] = (Random unit from TempGroup)) else do (Do nothing)
          • Custom script: call DestroyGroup(udg_TempGroup)
          • Custom script: set udg_TempGroup = null
          • Set TempGroup = (Units owned by (Player(HSS_SwapRequester)) matching (((Matching unit) is A Hero) Equal to True))
          • If ((Unit-type of Player_Hero[HSS_SwapRequester]) Equal to (Unit-type(<Empty String>))) then do (Set Player_Hero[HSS_SwapRequester] = (Random unit from TempGroup)) else do (Do nothing)
          • Custom script: call DestroyGroup(udg_TempGroup)
          • Custom script: set udg_TempGroup = null
        • Else - Actions
      • -------- --------------------------------------------------------------------- --------
      • -------- If swap is not possible, send player message --------
      • -------- --------------------------------------------------------------------- --------
      • Set TempPlayerGroup = (Player group((Player(HSS_SwapRequester))))
      • If ((Player(HSS_SwapTarget)) Equal to (Player(HSS_SwapRequester))) then do (Game - Display to TempPlayerGroup the text: HSS_ErrorString[1]) else do (Do nothing)
      • If ((((Player(HSS_SwapTarget)) controller) Equal to Computer) and ((Unit-type of Player_Hero[HSS_SwapTarget]) Equal to (Unit-type(<Empty String>)))) then do (Game - Display to TempPlayerGroup the text: HSS_ErrorString[2]) else do (Do nothing)
      • If ((((Player(HSS_SwapTarget)) controller) Equal to User) and ((Unit-type of Player_Hero[HSS_SwapTarget]) Equal to (Unit-type(<Empty String>)))) then do (Game - Display to TempPlayerGroup the text: HSS_ErrorString[3]) else do (Do nothing)
      • If (((Player(HSS_SwapTarget)) is an enemy of (Player(HSS_SwapRequester))) Equal to True) then do (Game - Display to TempPlayerGroup the text: HSS_ErrorString[4]) else do (Do nothing)
      • If (((Player(HSS_SwapTarget)) slot status) Equal to Is unused) then do (Game - Display to TempPlayerGroup the text: HSS_ErrorString[5]) else do (Do nothing)
      • Custom script: call DestroyForce(udg_TempPlayerGroup)
      • Custom script: set udg_TempPlayerGroup = null
      • -------- --------------------------------------------------------------------------------------------- --------
      • -------- If other player has not accepted yet, send request message --------
      • -------- Notify requester that their swap request has been sent --------
      • -------- ------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player_Hero[HSS_SwapRequester] is alive) Equal to True) and ((Player_Hero[HSS_SwapTarget] is alive) Equal to True)
          • ((Player(HSS_SwapTarget)) is an ally of (Player(HSS_SwapRequester))) Equal to True
          • (Unit-type of Player_Hero[HSS_SwapTarget]) Not equal to (Unit-type(<Empty String>))
          • (Player(HSS_SwapRequester)) Not equal to (Player(HSS_SwapTarget))
          • ((Player(HSS_SwapTarget)) controller) Not equal to Computer
          • ((Player(HSS_SwapTarget)) slot status) Equal to Is playing
        • Then - Actions
          • Set TempPlayerGroup = (Player group((Player(HSS_SwapRequester))))
          • If (HSS_SwapRequest[HSS_SwapTarget] Not equal to HSS_SwapRequester) then do (Game - Display to TempPlayerGroup the text: (You have requested to swap with + (PlayerNames[HSS_SwapTarget] + ( ( + ((Name of Player_Hero[HSS_SwapTarget]) + )|r))))) else do (Do nothing)
          • Custom script: call DestroyForce(udg_TempPlayerGroup)
          • Custom script: set udg_TempPlayerGroup = null
          • Set TempPlayerGroup = (Player group((Player(HSS_SwapTarget))))
          • If (HSS_SwapRequest[HSS_SwapTarget] Not equal to HSS_SwapRequester) then do (Game - Display to TempPlayerGroup the text: ((PlayerNames[HSS_SwapRequester] + () + ((Name of Player_Hero[HSS_SwapRequester]) + ()|r wants to swap with you. Type -swap + ((String((Player number of (Player(HSS_SwapRequester))))) + ( or -swap + (HSS_ColorSt else do (Do nothing)
          • Custom script: call DestroyForce(udg_TempPlayerGroup)
          • Custom script: set udg_TempPlayerGroup = null
        • Else - Actions
      • -------- ----------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • -------- Only swap if other player exists, not self, and agreed to swap back or is a computer with a hero --------
      • -------- ----------------------------------------------------------------------------------------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player_Hero[HSS_SwapRequester] is alive) Equal to True) and ((Player_Hero[HSS_SwapTarget] is alive) Equal to True)
          • ((Player(HSS_SwapTarget)) is an ally of (Player(HSS_SwapRequester))) Equal to True
          • (Unit-type of Player_Hero[HSS_SwapTarget]) Not equal to (Unit-type(<Empty String>))
          • (Player(HSS_SwapRequester)) Not equal to (Player(HSS_SwapTarget))
          • Or - Any (Conditions) are true
            • Conditions
              • HSS_SwapRequest[HSS_SwapTarget] Equal to HSS_SwapRequester
              • (((Player(HSS_SwapTarget)) controller) Equal to Computer) and (HSS_AllowCompSwap Equal to True)
              • ((Player(HSS_SwapTarget)) is in HSS_LeaverGroup) Equal to True
        • Then - Actions
          • -------- ------------------------------------------------------------------------------------------ --------
          • -------- Swapping conditions have passed, send success message. --------
          • -------- ------------------------------------------------------------------------------------------ --------
          • -------- System users can add extra actions here upon swap success --------
          • -------- ------------------------------------------------------------------------------------------ --------
          • Set TempPlayerGroup = (Player group((Player(HSS_SwapRequester))))
          • Player Group - Add (Player(HSS_SwapTarget)) to TempPlayerGroup
          • Game - Display to TempPlayerGroup the text: (|c0020c000 + Swap Successful!|r)
          • Custom script: call DestroyForce(udg_TempPlayerGroup)
          • Custom script: set udg_TempPlayerGroup = null
          • -------- ------------------------------------------------------------------------------------------ --------
          • -------- Set up for swapping inventories if configuration is enabled --------
          • -------- ------------------------------------------------------------------------------------------ --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HSS_AllowItemSwap Equal to True
            • Then - Actions
              • For each (Integer HSS_Integer) from 1 to 6, do (Actions)
                • Loop - Actions
                  • Set HSS_ItemInventory1[HSS_Integer] = (Item-type of (Item carried by Player_Hero[HSS_SwapRequester] in slot HSS_Integer))
                  • Set HSS_ItemCharges1[HSS_Integer] = (Charges remaining in (Item carried by Player_Hero[HSS_SwapRequester] in slot HSS_Integer))
                  • Set HSS_ItemInventory2[HSS_Integer] = (Item-type of (Item carried by Player_Hero[HSS_SwapTarget] in slot HSS_Integer))
                  • Set HSS_ItemCharges2[HSS_Integer] = (Charges remaining in (Item carried by Player_Hero[HSS_SwapTarget] in slot HSS_Integer))
                  • Item - Remove (Item carried by Player_Hero[HSS_SwapRequester] in slot HSS_Integer)
                  • Item - Remove (Item carried by Player_Hero[HSS_SwapTarget] in slot HSS_Integer)
            • Else - Actions
          • -------- ------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- If PositionSwap is enabled, swap Hero positions to retain the position for the player --------
          • -------- ------------------------------------------------------------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HSS_PositionSwap Equal to True
            • Then - Actions
              • Set HSS_TempPoint1 = (Position of Player_Hero[HSS_SwapRequester])
              • Set HSS_TempPoint2 = (Position of Player_Hero[HSS_SwapTarget])
              • Unit - Turn collision for Player_Hero[HSS_SwapRequester] Off
              • Unit - Turn collision for Player_Hero[HSS_SwapTarget] Off
              • Unit - Move Player_Hero[HSS_SwapRequester] instantly to HSS_TempPoint2
              • Unit - Move Player_Hero[HSS_SwapTarget] instantly to HSS_TempPoint1
              • Unit - Turn collision for Player_Hero[HSS_SwapRequester] On
              • Unit - Turn collision for Player_Hero[HSS_SwapTarget] On
              • Custom script: call RemoveLocation (udg_HSS_TempPoint1)
              • Custom script: call RemoveLocation (udg_HSS_TempPoint2)
              • Custom script: set udg_HSS_TempPoint1 = null
              • Custom script: set udg_HSS_TempPoint2 = null
            • Else - Actions
          • -------- ------------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Set up for swapping the heroes, and swap their Player_Hero unit values as well --------
          • -------- ------------------------------------------------------------------------------------------------------------------------------- --------
          • Set HSS_HoldPlayer1 = (Player(HSS_SwapRequester))
          • Set HSS_HoldPlayer2 = (Player(HSS_SwapTarget))
          • Unit - Change ownership of Player_Hero[HSS_SwapRequester] to HSS_HoldPlayer2 and Change color
          • Unit - Change ownership of Player_Hero[HSS_SwapTarget] to HSS_HoldPlayer1 and Change color
          • Selection - Select Player_Hero[HSS_SwapRequester] for HSS_HoldPlayer2
          • Selection - Select Player_Hero[HSS_SwapTarget] for HSS_HoldPlayer1
          • -------- ---------------------------------------------------------------------------------------------------------------------------- --------
          • -------- Swap the unit array Player_Hero with each other since unit ownership changed --------
          • -------- ---------------------------------------------------------------------------------------------------------------------------- --------
          • Set HSS_HoldHero1 = Player_Hero[HSS_SwapRequester]
          • Set HSS_HoldHero2 = Player_Hero[HSS_SwapTarget]
          • Set Player_Hero[HSS_SwapRequester] = HSS_HoldHero2
          • Set Player_Hero[HSS_SwapTarget] = HSS_HoldHero1
          • -------- -------------------------------------------------------------------------- --------
          • -------- Swap the inventories if configuration is enabled --------
          • -------- -------------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HSS_AllowItemSwap Equal to True
            • Then - Actions
              • For each (Integer HSS_Integer) from 1 to 6, do (Actions)
                • Loop - Actions
                  • Hero - Create HSS_ItemInventory1[HSS_Integer] and give it to Player_Hero[HSS_SwapRequester]
                  • If (HSS_ItemCharges1[HSS_Integer] Greater than or equal to 1) then do (Item - Set charges remaining in (Last created item) to HSS_ItemCharges1[HSS_Integer]) else do (Do nothing)
                  • Hero - Create HSS_ItemInventory2[HSS_Integer] and give it to Player_Hero[HSS_SwapTarget]
                  • If (HSS_ItemCharges2[HSS_Integer] Greater than or equal to 1) then do (Item - Set charges remaining in (Last created item) to HSS_ItemCharges2[HSS_Integer]) else do (Do nothing)
            • Else - Actions
          • -------- Reset Variable(s) --------
          • Set HSS_SwapRequest[HSS_SwapRequester] = 0
          • Set HSS_SwapRequest[HSS_SwapTarget] = 0
        • Else - Actions

========== Credits ==========
Maker: HesitationSnow
Aider: Rulerofiron99 , just gave a few tips
[You do not have to credit rulerofiron99, but you can, because this system would not have been made if his system workshop didn't exist]


  • Changed For Integer A to For Integer Variable
  • Removed Player Group Leaks on Displaying Messages
  • Fixed Unit Group leak not being destroyed
  • Added Configuration: Swapping instantly with leavers
  • Player color-coded swap request text
  • Added game message notifications for swapping
  • Added position swapping option




Keywords:
Unit, Hero, Swap, Swaping, Swapping, Ownership, Switch, System
Contents

Hero Swap System 1.1 (Map)

Reviews
Approved The system looks to be ok. You could cache the string in HSS Check Chatstring or use a hashtable to dramatically cut down the number of actions performed.
Reviewed by Maker, Hero Swap System 1.1, 15th Jan 2013

Approved

The system looks to be ok.
You could cache the string in HSS Check Chatstring
or use a hashtable to dramatically cut down the number of actions performed.
 
This is a very nice system. However, you are leaking player groups, when the system sends messages. In addition, do not use predefined integers like Integers A/B because these integers can bug with other systems that use the same integers and are slower than your own integers. I recommend a different integer for each trigger.

Edit: After taking another look at the system's core, I found another problem. Custom script: set bj_wantDestroyGroup = true won't clean up any leak in this case, since all you doing is setting a unit group to a variable. You are not actually doing any actions with the unit group, therefore, the Custom script has no effect. Also, I have one question about your filtering. What happens if a computer player becames an actual player in game, how would the system detect that, so that the system works for that player again?
 
Last edited:
This is a very nice system. However, you are leaking player groups, when the system sends messages. In addition, do not use predefined integers like Integers A/B because these integers can bug with other systems that use the same integers and are slower than your own integers. I recommend a different integer for each trigger.

Edit: After taking another look at the system's core, I found another problem. Custom script: set bj_wantDestroyGroup = true won't clean up any leak in this case, since all you doing is setting a unit group to a variable. You are not actually doing any actions with the unit group, therefore, the Custom script has no effect. Also, I have one question about your filtering. What happens if a computer player becames an actual player in game, how would the system detect that, so that the system works for that player again?

Hey, thanks for report, fixed it all I believe?

Also, I do not think computer can become an actual player during a game.
A computer slot is static, like if green is a comp, he will always be a comp during that game.
If you mean computers swapping with users, well, their Hero_Specific[Player #] swaps as well, which is the unit array setting for the heroes to be swapped.

Edit: if you mean swapping with a leaver (disconnecter) freely, hold up i'll add that in .
 
Last edited:
You should add a text saying where this system can be useful, because I don't really see where this can be useful, and others may not too :/

It's useful for swapping heroes! :P
Okay yeah, uhh, basically any map that centers around using a hero and has -all random hero mode.
Some maps being Dota, Hero Defense/Survival/Siege.
Well, it doesn't have to be heroes. TDs work too, if you have an -all random builders mode.
 
Last edited:
Back
Top