System 6VS6 System

Vestras

Retired
Reaction score
248
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.
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.
 

Attachments

  • 6VS6System.w3x
    17.6 KB · Views: 198
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top