# Set Alliance Between Two Player Groups

Grammar — Make all players in sourcePlayers treat all players in targetPlayers as alliance
FlagsAction

Changes alliance settings for all players in the player group. Each player applies the requested alliance setting to every other player in the player group. Pushable means that one player*“s units are allowed to push another player”*s units out of the way if they are trying to path through them.

# Arguments

  • playergroup — Source Players
  • playergroup — Target Players
  • int<preset::AllianceSetting> — Alliance Setting

Returns — void

void libNtve_gf_SetAllianceBetweenTwoPlayerGroups(
	playergroup lp_sourcePlayers,
	playergroup lp_targetPlayers,
	int lp_alliance,
);

Category: Player / Alliances

# Examples

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:12326

                if (lv_indexPlayer < 0) { break; }
                if ((PlayerStatus(lv_indexPlayer) == c_playerStatusLeft)) {
                    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(PlayerGroupSingle(lv_indexPlayer), lv_itPlayerGroup, libNtve_ge_AllianceSetting_AllyWithSharedVisionControlAndSpending);
                }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:12339

        if (lv_indexPlayer < 0) { break; }
        if ((lv_indexPlayer != 15) && (PlayerCommander(lv_indexPlayer) == null)) {
            libNtve_gf_SetAllianceBetweenTwoPlayerGroups(PlayerGroupSingle(lv_indexPlayer), PlayerGroupSingle(15), libNtve_ge_AllianceSetting_Neutral);
            libNtve_gf_SetAllianceBetweenTwoPlayerGroups(PlayerGroupSingle(15), PlayerGroupSingle(lv_indexPlayer), libNtve_ge_AllianceSetting_Neutral);
        }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:12340

        if ((lv_indexPlayer != 15) && (PlayerCommander(lv_indexPlayer) == null)) {
            libNtve_gf_SetAllianceBetweenTwoPlayerGroups(PlayerGroupSingle(lv_indexPlayer), PlayerGroupSingle(15), libNtve_ge_AllianceSetting_Neutral);
            libNtve_gf_SetAllianceBetweenTwoPlayerGroups(PlayerGroupSingle(15), PlayerGroupSingle(lv_indexPlayer), libNtve_ge_AllianceSetting_Neutral);
        }

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:245

    libNtve_gf_SetPlayerGroupAlliance(lp_allyPlayers, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetPlayerGroupAlliance(lp_enemyPlayers, libNtve_ge_AllianceSetting_AllyWithSharedVision);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_legendPlayers, lp_allyPlayers, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_allyPlayers, lp_legendPlayers, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_legendPlayers, lp_enemyPlayers, libNtve_ge_AllianceSetting_Enemy);

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:246

    libNtve_gf_SetPlayerGroupAlliance(lp_enemyPlayers, libNtve_ge_AllianceSetting_AllyWithSharedVision);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_legendPlayers, lp_allyPlayers, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_allyPlayers, lp_legendPlayers, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_legendPlayers, lp_enemyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lp_legendPlayers, libNtve_ge_AllianceSetting_Enemy);

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:247

    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_legendPlayers, lp_allyPlayers, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_allyPlayers, lp_legendPlayers, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_legendPlayers, lp_enemyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lp_legendPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_allyPlayers, lp_enemyPlayers, libNtve_ge_AllianceSetting_Enemy);

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:248

    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_allyPlayers, lp_legendPlayers, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_legendPlayers, lp_enemyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lp_legendPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_allyPlayers, lp_enemyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lp_allyPlayers, libNtve_ge_AllianceSetting_Enemy);

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:249

    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_legendPlayers, lp_enemyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lp_legendPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_allyPlayers, lp_enemyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lp_allyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lv_creepgroup, libNtve_ge_AllianceSetting_Ally);

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:250

    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lp_legendPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_allyPlayers, lp_enemyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lp_allyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lv_creepgroup, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lv_creepgroup, lp_enemyPlayers, libNtve_ge_AllianceSetting_Ally);

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:251

    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_allyPlayers, lp_enemyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lp_allyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lv_creepgroup, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lv_creepgroup, lp_enemyPlayers, libNtve_ge_AllianceSetting_Ally);
    libWCdr_gf_InitPlayerColors();

mods/warcoop/warcoopdata.sc2modbase.sc2data/TriggerLibs/WarCoopData.galaxy:252

    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lp_allyPlayers, libNtve_ge_AllianceSetting_Enemy);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lp_enemyPlayers, lv_creepgroup, libNtve_ge_AllianceSetting_Ally);
    libNtve_gf_SetAllianceBetweenTwoPlayerGroups(lv_creepgroup, lp_enemyPlayers, libNtve_ge_AllianceSetting_Ally);
    libWCdr_gf_InitPlayerColors();
    libWCdr_gf_InitializeGameUI();