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!
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)
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)
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)
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)
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)
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)
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
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?
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?
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 .
It's useful for swapping heroes!
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.