I just made this because I think it's messy to make 6VS6 gameplay in AoS maps... So this is the easy alternative.
Pretty simple, not even 100 lines. Does the job.
There isn't really anything to get a screenshot of, but I'll get a logo after some time.
Thank you.
Pretty simple, not even 100 lines. Does the job.
JASS:
library SVSSSys
globals
private constant string SYSTEMCOLOR="|cffff0000" // The color of the system message. Flower power!
private constant integer NORM_PLAYER1=0 // The player who owns the units at map init (GRP1)
private constant integer NORM_PLAYER2=6 // The player who owns the units at map init (GRP2)
private constant integer PLAYER1=bj_PLAYER_NEUTRAL_EXTRA // The player who is going to be the owner for GRP1
private constant integer PLAYER2=bj_PLAYER_NEUTRAL_VICTIM // The player who is going to be the owner for GRP2
private constant boolean CHANGECOLOR=true // The units will have the PLAYERX's playercolor too if CHANGECOLOR is false
private constant playercolor PLAYER1COLOR=PLAYER_COLOR_RED // The color the units of the PLAYER1 will have
private constant playercolor PLAYER2COLOR=PLAYER_COLOR_GREEN // The color the units of the PLAYER2 will have
// Necessary globals
private force GRP1=CreateForce()
private force GRP2=CreateForce()
private group g=CreateGroup()
endglobals
private function SetAlliance takes player one, player two, boolean flag returns nothing
call SetPlayerAlliance(one, two, ALLIANCE_PASSIVE, flag)
call SetPlayerAlliance(one, two, ALLIANCE_HELP_REQUEST, flag)
call SetPlayerAlliance(one, two, ALLIANCE_HELP_RESPONSE, flag)
call SetPlayerAlliance(one, two, ALLIANCE_SHARED_XP, flag)
call SetPlayerAlliance(one, two, ALLIANCE_SHARED_SPELLS, flag)
call SetPlayerAlliance(one, two, ALLIANCE_SHARED_VISION, flag)
endfunction
function AddToForce takes player p, integer f returns nothing
if f==1 then
call ForceAddPlayer(GRP1,p)
if CountPlayersInForceBJ(GRP1)>6 then
call BJDebugMsg(SYSTEMCOLOR+"6VS6 System:|r there is more than 6 players in one force!")
endif
elseif f==2 then
call ForceAddPlayer(GRP2,p)
if CountPlayersInForceBJ(GRP2)>6 then
call BJDebugMsg(SYSTEMCOLOR+"6VS6 System:|r there is more than 6 players in one force!")
endif
endif
endfunction
private function AllyForce1_Callback takes nothing returns nothing
// From dummy player to GetEnumPlayer()
call SetAlliance(Player(PLAYER1),GetEnumPlayer(),true)
// From GetEnumPlayer() to dummy player
call SetAlliance(GetEnumPlayer(),Player(PLAYER1),true)
endfunction
private function AllyForce2_Callback takes nothing returns nothing
// From dummy player to GetEnumPlayer()
call SetAlliance(Player(PLAYER2),GetEnumPlayer(),true)
// From GetEnumPlayer() to dummy player
call SetAlliance(GetEnumPlayer(),Player(PLAYER2),true)
endfunction
private function EnemyForce_Callback takes nothing returns nothing
// From Player() - Player() to GetEnumPlayer()
call SetAlliance(Player(6), GetEnumPlayer(), false)
call SetAlliance(Player(7), GetEnumPlayer(), false)
call SetAlliance(Player(8), GetEnumPlayer(), false)
call SetAlliance(Player(9), GetEnumPlayer(), false)
call SetAlliance(Player(10), GetEnumPlayer(), false)
call SetAlliance(Player(11), GetEnumPlayer(), false)
// From GetEnumPlayer() to Player() - Player()
call SetAlliance(GetEnumPlayer(), Player(6), false)
call SetAlliance(GetEnumPlayer(), Player(7), false)
call SetAlliance(GetEnumPlayer(), Player(8), false)
call SetAlliance(GetEnumPlayer(), Player(9), false)
call SetAlliance(GetEnumPlayer(), Player(10), false)
call SetAlliance(GetEnumPlayer(), Player(11), false)
endfunction
private function ConvertTo1 takes nothing returns boolean
if GetOwningPlayer(GetFilterUnit())==Player(NORM_PLAYER1) then
call SetUnitOwner(GetFilterUnit(),Player(PLAYER1),CHANGECOLOR)
endif
return false
endfunction
private function ConvertTo2 takes nothing returns boolean
if GetOwningPlayer(GetFilterUnit())==Player(NORM_PLAYER2) then
call SetUnitOwner(GetFilterUnit(),Player(PLAYER2),CHANGECOLOR)
endif
return false
endfunction
function Start takes nothing returns nothing
call ForForce(GRP1,function AllyForce1_Callback)
call ForForce(GRP2,function AllyForce2_Callback)
call ForForce(GRP1,function EnemyForce_Callback)
call SetPlayerColor(Player(PLAYER1),PLAYER1COLOR)
call SetPlayerColor(Player(PLAYER2),PLAYER2COLOR)
call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,Filter(function ConvertTo1))
call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,Filter(function ConvertTo2))
endfunction
endlibrary
There isn't really anything to get a screenshot of, but I'll get a logo after some time.
Thank you.