Neutral Victim/Extra

Arcane

You can change this now in User CP.
Reaction score
87
Neutral extra still attacks everybody, and neutral victim still attacks nobody...

JASS:
function NeutralUnally takes nothing returns nothing
    call SetPlayerAlliance(Player(bj_PLAYER_NEUTRAL_VICTIM), Player(bj_PLAYER_NEUTRAL_EXTRA), ALLIANCE_PASSIVE, false)
endfunction




JASS:


JASS:
//ALLY AND COLOR
set udg_TheWhiteHand = GetPlayersAllies(Player(0))
set udg_TheBlackCircle = GetPlayersAllies(Player(6))
call SetPlayerColor( Player(bj_PLAYER_NEUTRAL_EXTRA), PLAYER_COLOR_BROWN)
call SetPlayerColor( Player(bj_PLAYER_NEUTRAL_VICTIM), PLAYER_COLOR_AQUA)
call ForForce(udg_TheBlackCircle, function BlackCircleAlly)
call ForForce(udg_TheWhiteHand, function WhiteHandAlly)
endfunction


JASS:
function InitTrig_Initialization takes nothing returns nothing
    set gg_trg_Initialization = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Initialization, 0.00 )
    call TriggerAddAction( gg_trg_Initialization, function Trig_Initialization_Actions )
    call ExecuteFunc("NeutralUnally")
endfunction
 

Arcane

You can change this now in User CP.
Reaction score
87
Oh. Well, it's hard to know when it's okay to use BJs for someone as inexperienced as me... *grumbles*
 

Arcane

You can change this now in User CP.
Reaction score
87
ARGH!

That's my entire trigger right there, and the only one in my map currently... neutral victim still doesn't attack anybody, but is attacked by everybody, and neutral extra still attacks everybody, and is attacked by everybody...

JASS:
function NeutralHostility takes nothing returns nothing
    call SetPlayerAllianceStateBJ(Player(bj_PLAYER_NEUTRAL_VICTIM), Player(bj_PLAYER_NEUTRAL_EXTRA), bj_ALLIANCE_UNALLIED)
endfunction

function BlackCircleAlly takes nothing returns nothing
    call SetPlayerAllianceStateBJ( Player(bj_PLAYER_NEUTRAL_EXTRA), GetEnumPlayer(), bj_ALLIANCE_ALLIED_VISION )
    call SetPlayerAllianceStateBJ( GetEnumPlayer(), Player(bj_PLAYER_NEUTRAL_EXTRA), bj_ALLIANCE_ALLIED_VISION )
    call SetPlayerAllianceStateBJ( Player(bj_PLAYER_NEUTRAL_VICTIM), GetEnumPlayer(), bj_ALLIANCE_UNALLIED )
endfunction

function WhiteHandAlly takes nothing returns nothing
    call SetPlayerAllianceStateBJ( Player(bj_PLAYER_NEUTRAL_VICTIM), GetEnumPlayer(), bj_ALLIANCE_ALLIED_VISION )
    call SetPlayerAllianceStateBJ( GetEnumPlayer(), Player(bj_PLAYER_NEUTRAL_VICTIM), bj_ALLIANCE_ALLIED_VISION )
    call SetPlayerAllianceStateBJ( Player(bj_PLAYER_NEUTRAL_EXTRA), GetEnumPlayer(), bj_ALLIANCE_UNALLIED )
endfunction

function Trig_Initialization_Actions takes nothing returns nothing
    //BUILDING SPAWN
    //Main
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'unp2', -9472.0, 0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'hcas', 9472.0, 0, bj_UNIT_FACING)
    //Center mains
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'usep', -8192.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'usep', -8192.0, -512.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'hbar', 8192.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'hbar', 8192.0, -512.0, bj_UNIT_FACING)
    //Top expansion main
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'usep', -5120.0, 6016.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'hbar', 5120.0, 6016.0, bj_UNIT_FACING)
    //Bottom expansion main
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'usep', -5120.0, -6016.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'hbar', 5120.0, -6016.0, bj_UNIT_FACING)
    //Top expansion towers
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -4096.0, 5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -4096.0, 6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -5210.0, 5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -4864.0, 6528.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 4096.0, 5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 4096.0, 6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 5120.0, 5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 4864.0, 6528.0, bj_UNIT_FACING)
    //Bottom expansion towers
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -4096.0, -5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -4096.0, -6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -5210.0, -5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -4864.0, -6528.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 4096.0, -5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 4096.0, -6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 5120.0, -5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 4864.0, -6528.0, bj_UNIT_FACING)
    //Center towers
    //back
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -9728.0, 384.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -9728.0, -384.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 9728.0, 384.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 9728.0, -384.0, bj_UNIT_FACING)
    //top
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -7296.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -8448.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -7680.0, 1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -8475.0, 768.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 7296.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 8448.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 7680.0, 1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 8475.0, 768.0, bj_UNIT_FACING)
    //bot
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -7296.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -8448.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -7680.0, -1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -8475.0, -768.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 7296.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 8448.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 7680.0, -1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 8475.0, -768.0, bj_UNIT_FACING)
    //front
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -6400.0, -512.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -6400.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -6144.0, -768.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntt1', -6144.0, 768.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_EXTRA), 'ntx2', -6912.0, 0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 6400.0, -512.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 6400.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 6144.0, -768.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'nbt1', 6144.0, 768.0, bj_UNIT_FACING)
    call CreateUnit(Player(bj_PLAYER_NEUTRAL_VICTIM), 'net2', 6912.0, 0, bj_UNIT_FACING)

    //ALLY AND COLOR
    set udg_TheWhiteHand = GetPlayersAllies(Player(0))
    set udg_TheBlackCircle = GetPlayersAllies(Player(6))
    call SetPlayerColor( Player(bj_PLAYER_NEUTRAL_EXTRA), PLAYER_COLOR_BROWN)
    call SetPlayerColor( Player(bj_PLAYER_NEUTRAL_VICTIM), PLAYER_COLOR_AQUA)
    call ForForce(udg_TheBlackCircle, function BlackCircleAlly)
    call ForForce(udg_TheWhiteHand, function WhiteHandAlly)
endfunction

//===========================================================================
function InitTrig_Initialization takes nothing returns nothing
    set gg_trg_Initialization = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Initialization, 0.00 )
    call TriggerAddAction( gg_trg_Initialization, function Trig_Initialization_Actions )
    call ExecuteFunc("NeutralHostility")
endfunction
 

Arcane

You can change this now in User CP.
Reaction score
87
@Firstly: what?
@Secondly: Doesn't work. I even tried 3 seconds.
 

Arcane

You can change this now in User CP.
Reaction score
87
I tried by putting units onto the map of player 1, 2, 6, and 7. All of them get the same results.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Debug it...
- Try adding the players to your black/white "player groups" manually.
- If that fails still fails, call a simple function from inside the ForGroup function that displays the picked player's player names.
If they don't show up, you got issues.
If they do, then there is in fact a problem with the way you're setting the alliances. I suspect its a problem with your forces though (player groups).

I just tried:And it works perfectly. That's neutral hostile. Prooves the function layout is right.

Just play with things and see how far the arguments get passed.
 

Arcane

You can change this now in User CP.
Reaction score
87
Made a de_bug function which went through a player group and displayed all the player names, worked perfectly.

I did some more research on this subject though, and redid my coding...
Now Neutral Victim correctly attacks players from the other force, but is still attacked by everybody, and Neutral Extra still proceeds to get attacked by all, and attack all.

Maybe the error is in the organization of the functions? Because I think I solved the Neutral Victim not attacking opponents problem by moving the Neutral Hostility function downwards...

Edit: Oh yeah, tried both Bj and native ally functions, both of them work the same really.
Edited edit: ^Scrap that. Shared vision doesn't seem to work when using natives (the current code).
Edited edited edit: Added a small scrap of code that prevents heroes from being changed sides, and placed a paladin on the map for player 1 - myself - at map initialization, the paladin automatically goes to attack the nearby neutral victim tower, but when I move him away, he doesn't auto acquire it again.
Edited edited edited edit: Added another small scrap of code which created units for player 2 and player 7 in the bases of neutral victim and neutral extra respectively five seconds after everything else is run. They still auto-acquire, and the one in the neutral extra base still gets pwned.


JASS:
function de_bug takes nothing returns nothing
    call DisplayTextToForce(udg_TheWhiteHandPlayerGroup, GetPlayerName(GetEnumPlayer()))
endfunction

//Changes The White Hand alliance settings
function TheWhiteHandAlly takes nothing returns nothing
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_PASSIVE, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_HELP_REQUEST, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_HELP_RESPONSE, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_XP, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_SPELLS, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_VISION, false)
    //
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_PASSIVE, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_HELP_REQUEST, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_HELP_RESPONSE, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_XP, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_SPELLS, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_VISION, true)
endfunction

//Changes The Black Circle alliance settings
function TheBlackCircleAlly takes nothing returns nothing
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_PASSIVE, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_HELP_REQUEST, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_HELP_RESPONSE, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_XP, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_SPELLS, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_VISION, false)
    //
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_PASSIVE, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_HELP_REQUEST, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_HELP_RESPONSE, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_XP, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_SPELLS, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_VISION, true)
endfunction

//Makes The White Hand and The Black Circle hostile to each other
function NeutralHostility takes nothing returns nothing
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_PASSIVE, false)
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_HELP_REQUEST, false)
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_HELP_RESPONSE, false)
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_SHARED_XP, false)
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_SHARED_SPELLS, false)
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_SHARED_VISION, false)
endfunction

//Adds all picked units to The White Hand unit group
function AddToGroupTWH takes nothing returns nothing
    call GroupAddUnit(udg_TheWhiteHandUnitGroup, GetEnumUnit())
endfunction

//Adds all picked units to The Black Circle unit group
function AddToGroupTBC takes nothing returns nothing
    call GroupAddUnit(udg_TheBlackCircleUnitGroup, GetEnumUnit())
endfunction

//Sets The White Hand to player 13 and changes its color
function WhiteHandConvert takes nothing returns nothing
    call SetUnitOwner(GetEnumUnit(), Player(13), false)
    if IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == false then
        call SetUnitColor(GetEnumUnit(), PLAYER_COLOR_AQUA)
    endif    
endfunction

//Sets The Black Circle to player 14 and changes its color
function BlackCircleConvert takes nothing returns nothing
    call SetUnitOwner(GetEnumUnit(), Player(14), false)
    if IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == false then
        call SetUnitColor(GetEnumUnit(), PLAYER_COLOR_BROWN)
    endif
endfunction

function Trig_Initialization_Actions takes nothing returns nothing
    //Spawns buildings for player 1 and player 7.
    //Main
    call CreateUnit(Player(0), 'hcas', 9472.0, 0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'unp2', -9472.0, 0, bj_UNIT_FACING)
    //Center mains
    call CreateUnit(Player(0), 'hbar', 8192.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'hbar', 8192.0, -512.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'usep', -8192.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'usep', -8192.0, -512.0, bj_UNIT_FACING)
    //Top expansion main
    call CreateUnit(Player(0), 'hbar', 5120.0, 6016.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'usep', -5120.0, 6016.0, bj_UNIT_FACING)
    //Bottom expansion main
    call CreateUnit(Player(0), 'hbar', 5120.0, -6016.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'usep', -5120.0, -6016.0, bj_UNIT_FACING)
    //Top expansion towers
    call CreateUnit(Player(0), 'nbt1', 4096.0, 5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 4096.0, 6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 5120.0, 5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 4864.0, 6528.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntt1', -4096.0, 5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -4096.0, 6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -5210.0, 5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -4864.0, 6528.0, bj_UNIT_FACING)
    //Bottom expansion towers
    call CreateUnit(Player(0), 'nbt1', 4096.0, -5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 4096.0, -6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 5120.0, -5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 4864.0, -6528.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntt1', -4096.0, -5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -4096.0, -6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -5210.0, -5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -4864.0, -6528.0, bj_UNIT_FACING)
    //Center towers
    //back
    call CreateUnit(Player(0), 'net2', 9728.0, 384.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 9728.0, -384.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntx2', -9728.0, 384.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -9728.0, -384.0, bj_UNIT_FACING)
    //top
    call CreateUnit(Player(0), 'nbt1', 7296.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 8448.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 7680.0, 1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 8475.0, 768.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntt1', -7296.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -8448.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -7680.0, 1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -8475.0, 768.0, bj_UNIT_FACING)
    //bot
    call CreateUnit(Player(0), 'nbt1', 7296.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 8448.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 7680.0, -1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 8475.0, -768.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntt1', -7296.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -8448.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -7680.0, -1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -8475.0, -768.0, bj_UNIT_FACING)
    //front
    call CreateUnit(Player(0), 'nbt1', 6400.0, -512.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 6400.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 6144.0, -768.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 6144.0, 768.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 6912.0, 0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntt1', -6400.0, -512.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -6400.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -6144.0, -768.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -6144.0, 768.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -6912.0, 0, bj_UNIT_FACING)
    
    
    //Calls the functions that convert player 1 and player 6's spawned buildings to
    //neutral extra and neutral victim, also calls the functions that sets the alliance
    //settings of the forces
    set udg_TheWhiteHandUnitGroup = CreateGroup()
    set udg_TheBlackCircleUnitGroup = CreateGroup()
    call ForGroup( GetUnitsOfPlayerAll(Player(0)), function AddToGroupTWH)
    call ForGroup( GetUnitsOfPlayerAll(Player(6)), function AddToGroupTBC)
    call ForGroup(udg_TheWhiteHandUnitGroup, function WhiteHandConvert)
    call ForGroup(udg_TheBlackCircleUnitGroup, function BlackCircleConvert)
    set udg_TheWhiteHandPlayerGroup = GetPlayersAllies(Player(0))
    set udg_TheBlackCirclePlayerGroup = GetPlayersAllies(Player(6))
    call ForForce(udg_TheWhiteHandPlayerGroup, function TheWhiteHandAlly)
    call ForForce(udg_TheBlackCirclePlayerGroup, function TheBlackCircleAlly)
    call ForForce(udg_TheWhiteHandPlayerGroup, function de_bug)
    call SetPlayerName(Player(13), "|cff2f4f4fThe White Hand|r")
    call SetPlayerName(Player(13), "|cff8b4513The Black Circle|r")
    call ForceAddPlayer(udg_TheWhiteHandPlayerGroup, Player(13))
    call ForceAddPlayer(udg_TheBlackCirclePlayerGroup, Player(14))
    call SetPlayerTeam(Player(13), 0)
    call SetPlayerTeam(Player(14), 6)
    call SetPlayerState(Player(13), PLAYER_STATE_ALLIED_VICTORY, 1)
    call SetPlayerState(Player(14), PLAYER_STATE_ALLIED_VICTORY, 1)
    call SetPlayerController(Player(13), MAP_CONTROL_COMPUTER)
    call SetPlayerController(Player(14), MAP_CONTROL_COMPUTER)
    call SetPlayerRacePreference(Player(14), RACE_PREF_HUMAN)
    call SetPlayerRacePreference(Player(14), RACE_PREF_UNDEAD)
    call EnableOcclusion(true)
    call ExecuteFunc("NeutralHostility")
    call GroupClear(udg_TheWhiteHandUnitGroup)
    call GroupClear(udg_TheBlackCircleUnitGroup)
    call ForceClear(udg_TheWhiteHandPlayerGroup)
    call ForceClear(udg_TheBlackCirclePlayerGroup)
    call DestroyGroup(udg_TheWhiteHandUnitGroup)
    call DestroyGroup(udg_TheBlackCircleUnitGroup)
    call DestroyForce(udg_TheWhiteHandPlayerGroup)
    call DestroyForce(udg_TheBlackCirclePlayerGroup)
endfunction

//===========================================================================
function InitTrig_Initialization takes nothing returns nothing
    set gg_trg_Initialization = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Initialization, 0.00 )
    call TriggerAddAction( gg_trg_Initialization, function Trig_Initialization_Actions )
endfunction
 

Arcane

You can change this now in User CP.
Reaction score
87
Two ways now. Still does not work. Strangely, neutral victim doesn't attack anymore!

Stupid code, this is extremely frustrating.

JASS:
function de_bug takes nothing returns nothing
    call DisplayTextToForce(udg_TheWhiteHandPlayerGroup, GetPlayerName(GetEnumPlayer()))
endfunction

//Changes The White Hand alliance settings
function TheWhiteHandAlly takes nothing returns nothing
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_PASSIVE, false)
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_HELP_REQUEST, false)
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_HELP_RESPONSE, false)
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_SHARED_XP, false)
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_SHARED_SPELLS, false)
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_SHARED_VISION, false)
    //
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_PASSIVE, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_HELP_REQUEST, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_HELP_RESPONSE, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_XP, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_SPELLS, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_VISION, false)
    //
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_PASSIVE, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_HELP_REQUEST, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_HELP_RESPONSE, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_XP, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_SPELLS, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_VISION, true)
    //
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_PASSIVE, true)
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_HELP_REQUEST, true)
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_HELP_RESPONSE, true)
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_SHARED_XP, true)
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_SHARED_SPELLS, true)
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_SHARED_VISION, true)
endfunction

//Changes The Black Circle alliance settings
function TheBlackCircleAlly takes nothing returns nothing
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_PASSIVE, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_HELP_REQUEST, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_HELP_RESPONSE, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_XP, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_SPELLS, false)
    call SetPlayerAlliance(GetEnumPlayer(), Player(13), ALLIANCE_SHARED_VISION, false)
    //
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_PASSIVE, false)
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_HELP_REQUEST, false)
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_HELP_RESPONSE, false)
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_SHARED_XP, false)
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_SHARED_SPELLS, false)
    call SetPlayerAlliance(Player(13), GetEnumPlayer(), ALLIANCE_SHARED_VISION, false)
    //
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_PASSIVE, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_HELP_REQUEST, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_HELP_RESPONSE, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_XP, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_SPELLS, true)
    call SetPlayerAlliance(GetEnumPlayer(), Player(14), ALLIANCE_SHARED_VISION,true)
    //
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_PASSIVE, true)
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_HELP_REQUEST, true)
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_HELP_RESPONSE, true)
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_SHARED_XP, true)
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_SHARED_SPELLS, true)
    call SetPlayerAlliance(Player(14), GetEnumPlayer(), ALLIANCE_SHARED_VISION, true)
endfunction

//Makes The White Hand and The Black Circle hostile to each other
function NeutralHostility takes nothing returns nothing
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_PASSIVE, false)
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_HELP_REQUEST, false)
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_HELP_RESPONSE, false)
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_SHARED_XP, false)
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_SHARED_SPELLS, false)
    call SetPlayerAlliance(Player(13), Player(14), ALLIANCE_SHARED_VISION, false)
endfunction

//Adds all picked units to The White Hand unit group
function AddToGroupTWH takes nothing returns nothing
    if IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == false then
        call GroupAddUnit(udg_TheWhiteHandUnitGroup, GetEnumUnit())
    endif
endfunction

//Adds all picked units to The Black Circle unit group
function AddToGroupTBC takes nothing returns nothing
    if IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == false then
        call GroupAddUnit(udg_TheBlackCircleUnitGroup, GetEnumUnit())
    endif
endfunction

//Sets The White Hand to player 13 and changes its color
function WhiteHandConvert takes nothing returns nothing
    call SetUnitOwner(GetEnumUnit(), Player(13), false)
    if IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == false then
        call SetUnitColor(GetEnumUnit(), PLAYER_COLOR_AQUA)
    endif    
endfunction

//Sets The Black Circle to player 14 and changes its color
function BlackCircleConvert takes nothing returns nothing
    call SetUnitOwner(GetEnumUnit(), Player(14), false)
    if IsUnitType(GetEnumUnit(), UNIT_TYPE_HERO) == false then
        call SetUnitColor(GetEnumUnit(), PLAYER_COLOR_BROWN)
    endif
endfunction

function Trig_Initialization_Actions takes nothing returns nothing
    //Spawns buildings for player 1 and player 7.
    //Main
    call CreateUnit(Player(0), 'hcas', 9472.0, 0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'unp2', -9472.0, 0, bj_UNIT_FACING)
    //Center mains
    call CreateUnit(Player(0), 'hbar', 8192.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'hbar', 8192.0, -512.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'usep', -8192.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'usep', -8192.0, -512.0, bj_UNIT_FACING)
    //Top expansion main
    call CreateUnit(Player(0), 'hbar', 5120.0, 6016.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'usep', -5120.0, 6016.0, bj_UNIT_FACING)
    //Bottom expansion main
    call CreateUnit(Player(0), 'hbar', 5120.0, -6016.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'usep', -5120.0, -6016.0, bj_UNIT_FACING)
    //Top expansion towers
    call CreateUnit(Player(0), 'nbt1', 4096.0, 5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 4096.0, 6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 5120.0, 5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 4864.0, 6528.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntt1', -4096.0, 5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -4096.0, 6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -5210.0, 5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -4864.0, 6528.0, bj_UNIT_FACING)
    //Bottom expansion towers
    call CreateUnit(Player(0), 'nbt1', 4096.0, -5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 4096.0, -6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 5120.0, -5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 4864.0, -6528.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntt1', -4096.0, -5504.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -4096.0, -6528.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -5210.0, -5632.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -4864.0, -6528.0, bj_UNIT_FACING)
    //Center towers
    //back
    call CreateUnit(Player(0), 'net2', 9728.0, 384.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 9728.0, -384.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntx2', -9728.0, 384.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -9728.0, -384.0, bj_UNIT_FACING)
    //top
    call CreateUnit(Player(0), 'nbt1', 7296.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 8448.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 7680.0, 1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 8475.0, 768.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntt1', -7296.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -8448.0, 1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -7680.0, 1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -8475.0, 768.0, bj_UNIT_FACING)
    //bot
    call CreateUnit(Player(0), 'nbt1', 7296.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 8448.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 7680.0, -1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 8475.0, -768.0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntt1', -7296.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -8448.0, -1536.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -7680.0, -1024.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -8475.0, -768.0, bj_UNIT_FACING)
    //front
    call CreateUnit(Player(0), 'nbt1', 6400.0, -512.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 6400.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 6144.0, -768.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'nbt1', 6144.0, 768.0, bj_UNIT_FACING)
    call CreateUnit(Player(0), 'net2', 6912.0, 0, bj_UNIT_FACING)
    //
    call CreateUnit(Player(6), 'ntt1', -6400.0, -512.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -6400.0, 512.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -6144.0, -768.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntt1', -6144.0, 768.0, bj_UNIT_FACING)
    call CreateUnit(Player(6), 'ntx2', -6912.0, 0, bj_UNIT_FACING)
    
    
    //Calls the functions that convert player 1 and player 6's spawned buildings to
    //neutral extra and neutral victim, also calls the functions that sets the alliance
    //settings of the forces
    set udg_TheWhiteHandUnitGroup = CreateGroup()
    set udg_TheBlackCircleUnitGroup = CreateGroup()
    call ForGroup( GetUnitsOfPlayerAll(Player(0)), function AddToGroupTWH)
    call ForGroup( GetUnitsOfPlayerAll(Player(6)), function AddToGroupTBC)
    call ForGroup(udg_TheWhiteHandUnitGroup, function WhiteHandConvert)
    call ForGroup(udg_TheBlackCircleUnitGroup, function BlackCircleConvert)
    set udg_TheWhiteHandPlayerGroup = GetPlayersAllies(Player(0))
    set udg_TheBlackCirclePlayerGroup = GetPlayersAllies(Player(6))
    call ForForce(udg_TheWhiteHandPlayerGroup, function TheWhiteHandAlly)
    call ForForce(udg_TheBlackCirclePlayerGroup, function TheBlackCircleAlly)
    call ForForce(udg_TheWhiteHandPlayerGroup, function de_bug)
    call SetPlayerName(Player(13), "|cff2f4f4fThe White Hand|r")
    call SetPlayerName(Player(13), "|cff8b4513The Black Circle|r")
    call ForceAddPlayer(udg_TheWhiteHandPlayerGroup, Player(13))
    call ForceAddPlayer(udg_TheBlackCirclePlayerGroup, Player(14))
    call SetPlayerTeam(Player(13), 0)
    call SetPlayerTeam(Player(14), 6)
    call SetPlayerState(Player(13), PLAYER_STATE_ALLIED_VICTORY, 1)
    call SetPlayerState(Player(14), PLAYER_STATE_ALLIED_VICTORY, 1)
    call SetPlayerController(Player(13), MAP_CONTROL_COMPUTER)
    call SetPlayerController(Player(14), MAP_CONTROL_COMPUTER)
    call SetPlayerRacePreference(Player(14), RACE_PREF_HUMAN)
    call SetPlayerRacePreference(Player(14), RACE_PREF_UNDEAD)
    call EnableOcclusion(true)
    call ExecuteFunc("NeutralHostility")
    call GroupClear(udg_TheWhiteHandUnitGroup)
    call GroupClear(udg_TheBlackCircleUnitGroup)
    call ForceClear(udg_TheWhiteHandPlayerGroup)
    call ForceClear(udg_TheBlackCirclePlayerGroup)
    call DestroyGroup(udg_TheWhiteHandUnitGroup)
    call DestroyGroup(udg_TheBlackCircleUnitGroup)
    call DestroyForce(udg_TheWhiteHandPlayerGroup)
    call DestroyForce(udg_TheBlackCirclePlayerGroup)
endfunction

//===========================================================================
function InitTrig_Initialization takes nothing returns nothing
    set gg_trg_Initialization = CreateTrigger(  )
    call TriggerRegisterTimerEventSingle( gg_trg_Initialization, 0.00 )
    call TriggerAddAction( gg_trg_Initialization, function Trig_Initialization_Actions )
endfunction
 

Arkan

Nobody rides for free
Reaction score
92
Remember that extra/victim won't attack buildings unless you trigger them to do so.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Meh. Here.

Try calling that. Should magically fix everything. I uh... Didn't test it at all. Or even run it by the syntax checker (I used to write hundreds of lines without comments or spaces using notepad though). But at very least it should present a neater method. I've assumed you have 2 teams, and one is allied to Player 1, and the other team is enemied to Player 1. Merry Christmas. :p

Hope it works...
 

Arcane

You can change this now in User CP.
Reaction score
87
Oh my god! Thank you!
It actually worked!

<3
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top