# Beacon Is Set

FlagsNative | Function

Is the specified beacon currently enabled.

# Arguments

Returns — bool

native bool PlayerBeaconIsSet(int inPlayer, int inBeacon);

Category: AI Advanced / Beacons / Functions

# Examples

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeHighAI.galaxy:180

//--------------------------------------------------------------------------------------------------
bool AIShouldScoutDueToBeaconOrAlly (int player) {
    if (PlayerBeaconIsSet(player, c_beaconScout)) {
        if (AIGetNumWorkers(player) >= 6) {
            if (PlayerBeaconIsSet(player, c_beaconScout)) {

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeHighAI.galaxy:182

    if (PlayerBeaconIsSet(player, c_beaconScout)) {
        if (AIGetNumWorkers(player) >= 6) {
            if (PlayerBeaconIsSet(player, c_beaconScout)) {
                return true;
            }

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:145

    //scouting logic
    if (AIGetNumWorkers(player) >= 6) {
        if (PlayerBeaconIsSet(player, c_beaconScout)) {
            AISetFlag(player, e_flagsScouting, true);
        }

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:416

void TerranGeneralBuild (int player, int tier) {
    if (tier >= c_ldPhaseMid) {
        if (PlayerBeaconIsSet(player, c_beaconDetect)) {
            AISetStock( player, 1, c_TU_Raven );
        }

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:558

void ZergGeneralBuild (int player, int tier) {
    if (tier >= c_ldPhaseMid) {
        if (PlayerBeaconIsSet(player, c_beaconDetect)) {
            AISetStock( player, 1, c_ZU_Overseer );
        }

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeLowAI.galaxy:700

void ProtossGeneralBuild (int player, int tier) {
    if (tier >= c_ldPhaseMid) {
        if (PlayerBeaconIsSet(player, c_beaconDetect)) {
            AISetStock( player, 1, c_PU_Observer );
        }

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:125

//--------------------------------------------------------------------------------------------------
void AIWaveDefend (int player, wave w) {
    if (PlayerBeaconIsSet(player, c_beaconArmy)) {
        AIWaveMerge(player, c_waveDefend, c_waveAttack);
        return;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:159

    int attackState = AIState(player, e_attackState);

    if (count >= 5 && PlayerBeaconIsSet(player, c_beaconArmy)) {
        AIWaveMerge(player, c_waveMain, c_waveAttack);
        return;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:203

    if (type == c_waveDivert2) {
        // only use divert2 for defense/beacons (banshee = 2,  reaper&oracle = 1)
        if (PlayerBeaconIsSet(player, c_beaconArmy)) {
            if (state != c_waveStateBeacon) {
                AIWaveSetType(w, c_waveStateBeacon, AIWaveTargetMeleeBeacon(player));

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:287


    // If we're supposed to be obeying the player, merge back into the main wave
    if (PlayerBeaconIsSet(player, c_beaconArmy)) {
        AIWaveMerge(player, c_waveClearObs, c_waveAttack);
        return;

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:372

    fixed defenseEval = 0;

    if (PlayerBeaconIsSet(player, c_beaconArmy)) {
        return false;
    }

mods/core.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:635

    int count;

    if (PlayerBeaconIsSet(player, c_beaconArmy)) {
        if (AIWaveState(w) != c_waveStateBeacon) {
            DebugAIPlayerWave(player, "AIWaveMain set wave = beacon");

mods/core.sc2modbase.sc2data/TriggerLibs/SharedAI.galaxy:12

        return true;
    }
    if (PlayerBeaconIsSet(player, c_beaconDetect)) {
        return true;
    }

mods/core.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1067

    
    needsNearbyAttackers = true;
    if (PlayerBeaconIsSet(player, c_beaconDetect)) {
        if (loc == PlayerBeaconGetTargetPoint(player, c_beaconDetect)) {
            needsNearbyAttackers = false;

mods/core.stormmodbase.stormdata/TriggerLibs/SharedAI.galaxy:12

        return true;
    }
    if (PlayerBeaconIsSet(player, c_beaconDetect)) {
        return true;
    }

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/Protoss.galaxy:133

    string prevType = UnitGetType(prev);
    
    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/liberty.sc2modbase.sc2data/TriggerLibs/Protoss/Protoss.galaxy:139

    }

    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {

mods/liberty.sc2modbase.sc2data/TriggerLibs/Terran/Terran.galaxy:152

    string prevType = UnitGetType(prev);
    
    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/liberty.sc2modbase.sc2data/TriggerLibs/Terran/Terran.galaxy:158

    }

    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {

mods/liberty.sc2modbase.sc2data/TriggerLibs/Zerg/Zerg.galaxy:161

    string prevType = UnitGetType(prev);

    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/liberty.sc2modbase.sc2data/TriggerLibs/Zerg/Zerg.galaxy:167

    }

    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {

mods/starcoop/starcoop.sc2modbase.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1047

    
    needsNearbyAttackers = true;
    if (PlayerBeaconIsSet(player, c_beaconDetect)) {
        if (loc == PlayerBeaconGetTargetPoint(player, c_beaconDetect)) {
            needsNearbyAttackers = false;

mods/swarm.sc2modbase.sc2data/TriggerLibs/Protoss/Protoss.galaxy:158

    string prevType = UnitGetType(prev);
    
    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/swarm.sc2modbase.sc2data/TriggerLibs/Protoss/Protoss.galaxy:164

    }

    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {

mods/swarm.sc2modbase.sc2data/TriggerLibs/Terran/Terran.galaxy:158

    string prevType = UnitGetType(prev);
    
    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/swarm.sc2modbase.sc2data/TriggerLibs/Terran/Terran.galaxy:164

    }

    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {

mods/swarm.sc2modbase.sc2data/TriggerLibs/Zerg/Zerg.galaxy:167

    string prevType = UnitGetType(prev);

    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/swarm.sc2modbase.sc2data/TriggerLibs/Zerg/Zerg.galaxy:173

    }

    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {

mods/void.sc2modbase.sc2data/TriggerLibs/MeleeHighAI.galaxy:180

//--------------------------------------------------------------------------------------------------
bool AIShouldScoutDueToBeaconOrAlly (int player) {
    if (PlayerBeaconIsSet(player, c_beaconScout)) {
        if (AIGetNumWorkers(player) >= 6) {
            if (PlayerBeaconIsSet(player, c_beaconScout)) {

mods/void.sc2modbase.sc2data/TriggerLibs/MeleeHighAI.galaxy:182

    if (PlayerBeaconIsSet(player, c_beaconScout)) {
        if (AIGetNumWorkers(player) >= 6) {
            if (PlayerBeaconIsSet(player, c_beaconScout)) {
                return true;
            }

mods/void.sc2modbase.sc2data/TriggerLibs/Protoss/Protoss.galaxy:167

    string prevType = UnitGetType(prev);
    
    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/void.sc2modbase.sc2data/TriggerLibs/Protoss/Protoss.galaxy:173

    }

    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {

mods/void.sc2modbase.sc2data/TriggerLibs/Terran/Terran.galaxy:164

    string prevType = UnitGetType(prev);
    
    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/void.sc2modbase.sc2data/TriggerLibs/Terran/Terran.galaxy:170

    }

    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {

mods/void.sc2modbase.sc2data/TriggerLibs/Zerg/Zerg.galaxy:173

    string prevType = UnitGetType(prev);

    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/void.sc2modbase.sc2data/TriggerLibs/Zerg/Zerg.galaxy:179

    }

    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/Tactical/TacticalAIWar3.galaxy:323

    
    needsNearbyAttackers = true;
    if (PlayerBeaconIsSet(player, c_beaconDetect)) {
        if (loc == PlayerBeaconGetTargetPoint(player, c_beaconDetect)) {
            needsNearbyAttackers = false;

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeSC.galaxy:158

    string prevType = UnitGetType(prev);
    
    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeSC.galaxy:164

    }

    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:232

//--------------------------------------------------------------------------------------------------
void AIWaveDefend (int player, wave w) {
    if (PlayerBeaconIsSet(player, c_beaconArmy)) {
        AIWaveMerge(player, c_waveDefend, c_waveAttack);
        return;

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:255

    int attackState = AIState(player, e_attackState);

    if (count >= 5 && PlayerBeaconIsSet(player, c_beaconArmy)) {
        AIWaveMerge(player, c_waveMain, c_waveAttack);
        return;

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:296

    if (type == c_waveDivert2) {
        // only use divert2 for defense/beacons (banshee = 2,  reaper&oracle = 1)
        if (PlayerBeaconIsSet(player, c_beaconArmy)) {
            if (state != c_waveStateBeacon) {
                AIWaveSetType(w, c_waveStateBeacon, AIWaveTargetMeleeBeacon(player));

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:376


    // If we're supposed to be obeying the player, merge back into the main wave
    if (PlayerBeaconIsSet(player, c_beaconArmy)) {
        AIWaveMerge(player, c_waveClearObs, c_waveAttack);
        return;

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/MeleeWaveAI.galaxy:720

	wavetarget wt;

    if (PlayerBeaconIsSet(player, c_beaconArmy)) {
        if (AIWaveState(w) != c_waveStateBeacon) {
            DebugAIPlayerWave(player, "AIWaveMain set wave = beacon");

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/Orc/Orc.galaxy:556

    string prevType = UnitGetType(prev);
    
    if (!PlayerBeaconIsSet(player, c_beaconScout) &&
        !AIGetFlag(player, e_flagsScouting)) {
        // if no scouting beacons are set and we're not ready to scout, don't return a unit

mods/warcoop/warmeleeai.sc2modbase.sc2data/TriggerLibs/Orc/Orc.galaxy:561

        return c_nullUnit;
    }
    if (index == 1 && PlayerBeaconIsSet(player, c_beaconScout)) {
        AISetFlag(player, e_flagsScouting, true);
        if (allowWorkers) {