# Override Player Option

Grammar — Override option option for player p to value
FlagsNative | Action

Setting the value to “No Value” will clear the override and return the value to whatever the player had selected previously. If an override value is set, option UI will be disabled for the player. Overrides are removed when leaving a game.

# Arguments

  • int — Player
  • string<gameoption> — Option
  • string<gameoptionvalue> — Value

Returns — void

native void PlayerOptionOverride(
	int p,
	string option,
	string value,
);

Category: Player / Player Settings

# Examples

mods/heroes.stormmodbase.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorial01.stormmap/MapScript.galaxy:5746


        if ((libNtve_gf_PlayerInCinematicMode(gv_pLAYER_01_USER) == false)) {
            PlayerOptionOverride(gv_pLAYER_01_USER, "camerafollow", "1");
        }

mods/heroes.stormmodbase.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialmapmechanics.stormmap/MapScript.galaxy:3444


        if ((libNtve_gf_PlayerInCinematicMode(gv_pLAYER_01_USER) == false)) {
            PlayerOptionOverride(gv_pLAYER_01_USER, "camerafollow", "1");
        }

mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorial01.stormmapMapScript.galaxy:5746


        if ((libNtve_gf_PlayerInCinematicMode(gv_pLAYER_01_USER) == false)) {
            PlayerOptionOverride(gv_pLAYER_01_USER, "camerafollow", "1");
        }

mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialmapmechanics.stormmapMapScript.galaxy:3444


        if ((libNtve_gf_PlayerInCinematicMode(gv_pLAYER_01_USER) == false)) {
            PlayerOptionOverride(gv_pLAYER_01_USER, "camerafollow", "1");
        }

mods/heroesbrawlmods/arenamodemods/arenamode.stormmodbase.stormdata/LibAREN.galaxy:753

            	if (auto434C0DDD_var<0) { break; }
            	CameraLockInput(auto434C0DDD_var, true);
            PlayerOptionOverride(auto434C0DDD_var, "camerafollow", "0");
            libGame_gf_HeroDeathEnableDisableDeadSoundStateForPlayer(false, auto434C0DDD_var);
        }

mods/heroesbrawlmods/arenamodemods/attackdefend.stormmodbase.stormdata/LibAtDe.galaxy:149

            	if (auto4F75C67D_var<0) { break; }
            	CameraLockInput(auto4F75C67D_var, true);
            PlayerOptionOverride(auto4F75C67D_var, "camerafollow", "0");
        }
        Wait(0.0625, c_timeGame);

mods/heroesbrawlmods/arenamodemods/trialgrounds.stormmodbase.stormdata/LibAMVS.galaxy:339

        	if (autoC3DC2A01_var<0) { break; }
        	CameraLockInput(autoC3DC2A01_var, true);
        PlayerOptionOverride(autoC3DC2A01_var, "camerafollow", "0");
        libGame_gf_HeroDeathEnableDisableDeadSoundStateForPlayer(false, autoC3DC2A01_var);
    }

mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmodbase.stormdata/LibMDoE.galaxy:217

        	if (auto409BA195_var<0) { break; }
        	CameraLockInput(auto409BA195_var, true);
        PlayerOptionOverride(auto409BA195_var, "camerafollow", "0");
        libGame_gf_HeroDeathEnableDisableDeadSoundStateForPlayer(false, auto409BA195_var);
    }

mods/heroesbrawlmods/brawlmapmods/blackheartsrevenge.stormmodbase.stormdata/LibMDoE.galaxy:2360

        	if (autoE2F8DB5E_var<0) { break; }
        	CameraLockInput(autoE2F8DB5E_var, true);
        PlayerOptionOverride(autoE2F8DB5E_var, "camerafollow", "0");
    }
    Wait(0.0625, c_timeGame);

mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmodbase.stormdata/LibPEB1.galaxy:9769

        	if (auto8E542D67_var<0) { break; }
        	CameraLockInput(auto8E542D67_var, true);
        PlayerOptionOverride(auto8E542D67_var, "camerafollow", "0");
        CameraApplyInfo(auto8E542D67_var, CameraInfoDefault(), 2.0, -1, 10.0, false);
        CameraPan(auto8E542D67_var, PointFromName("Victory Pan"), 2.0, -1, 10.0, false);

mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmodbase.stormdata/LibPEB1.galaxy:9872

        	if (auto35A7B0B1_var<0) { break; }
        	VisRevealArea(auto35A7B0B1_var, RegionPlayableMap(), 0.0, false);
        PlayerOptionOverride(auto35A7B0B1_var, "camerafollow", "0");
        CameraForceFollowUnitGroup(auto35A7B0B1_var, false);
        CameraApplyInfo(auto35A7B0B1_var, CameraInfoDefault(), 2.0, -1, 10.0, false);

mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmodbase.stormdata/LibPEB1.galaxy:10034

        UnitIssueOrder(lv_heroUnit, OrderTargetingPoint(AbilityCommand("move", 0), PointWithOffsetPolar(PointFromName(("Shelter - Player Spawn " + IntToString(libGame_gv_players[lv_playerIndex].lv_rosterSlot))), 14.0, 45.0)), c_orderQueueReplace);
        UnitIssueOrder(lv_heroUnit, Order(AbilityCommand("move", 2)), c_orderQueueAddToEnd);
        PlayerOptionOverride(lv_playerIndex, "camerafollow", "0");
        CameraForceFollowUnitGroup(lv_playerIndex, false);
        CameraApplyInfo(lv_playerIndex, CameraInfoDefault(), 0.0, -1, 10.0, false);

mods/heroesbrawlmods/brawlmapmods/coop/pvebrawlmod.stormmodbase.stormdata/LibPVEB.galaxy:1268

        	if (lv_itPlayer<0) { break; }
        	CameraLockInput(lv_itPlayer, true);
        PlayerOptionOverride(lv_itPlayer, "camerafollow", "0");
        libGame_gf_HeroDeathEnableDisableDeadSoundStateForPlayer(false, lv_itPlayer);
    }

mods/heroesbrawlmods/brawlmapmods/coop/pvemod.stormmodbase.stormdata/LibPVEM.galaxy:1385

        	if (lv_itPlayer<0) { break; }
        	CameraLockInput(lv_itPlayer, true);
        PlayerOptionOverride(lv_itPlayer, "camerafollow", "0");
        libGame_gf_HeroDeathEnableDisableDeadSoundStateForPlayer(false, lv_itPlayer);
    }

mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmodbase.stormdata/LibLNYF.galaxy:809

        CameraUseHeightDisplacement(lv_i, true);
        CameraFollowUnitGroup(lv_i, libNtve_gf_ConvertUnitToUnitGroup(UnitLastCreated()), true, false);
        PlayerOptionOverride(lv_i, "camerafollow", "1");
        libGame_gv_players[lv_i].lv_disableMount = false;
    }

mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmodbase.stormdata/LibLNYF.galaxy:825

    CameraUseHeightDisplacement(libCore_gv_oBSERVER_ObserverUIPlayer, true);
    CameraFollowUnitGroup(libCore_gv_oBSERVER_ObserverUIPlayer, libNtve_gf_ConvertUnitToUnitGroup(UnitLastCreated()), true, false);
    PlayerOptionOverride(libCore_gv_oBSERVER_ObserverUIPlayer, "camerafollow", "1");
    return true;
}

mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmodbase.stormdata/LibLNYF.galaxy:1150

    CameraUseHeightDisplacement(libCore_gv_oBSERVER_ObserverUIPlayer, true);
    CameraFollowUnitGroup(libCore_gv_oBSERVER_ObserverUIPlayer, libGame_gv_players[1].lv_cameraCurrentTargetGroup, true, false);
    PlayerOptionOverride(libCore_gv_oBSERVER_ObserverUIPlayer, "camerafollow", "1");
    if ((libLNYF_gv_observer_InvisibleUnit != null)) {
        UnitSelect(libLNYF_gv_observer_InvisibleUnit, libCore_gv_oBSERVER_ObserverUIPlayer, false);

mods/heroesbrawlmods/brawlmapmods/pullparty.stormmodbase.stormdata/LibMMPP.galaxy:66

        	if (auto2557329E_var<0) { break; }
        	CameraLockInput(auto2557329E_var, true);
        PlayerOptionOverride(auto2557329E_var, "camerafollow", "0");
    }
    Wait(0.0625, c_timeGame);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:1072

    }
    else {
        PlayerOptionOverride(lp_player, "camerafollow", null);
    }
    if ((libGame_gv_players[lp_player].lv_cameraForcedLock == true) && (libGame_gv_players[lp_player].lv_cameraPlayerUnitGroupToFocusOn != null)) {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:1079

        CameraFollowUnitGroup(lp_player, libGame_gv_players[lp_player].lv_cameraCurrentTargetGroup, true, false);
        if (((lp_player != 1) || (libCore_gv_sYSGameMode != libCore_ge_GameModes_Tutorial1Deprecated))) {
            PlayerOptionOverride(lp_player, "camerafollow", "1");
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:1089

            CameraFollowUnitGroup(lp_player, CameraFollowUnitGroupGet(lp_player), false, false);
            CameraFollowUnitGroup(lp_player, libGame_gv_players[lp_player].lv_cameraCurrentTargetGroup, true, false);
            PlayerOptionOverride(lp_player, "camerafollow", "1");
        }
        else {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:1097

                CameraFollowUnitGroup(lp_player, CameraFollowUnitGroupGet(lp_player), false, false);
                CameraFollowUnitGroup(lp_player, libGame_gv_players[lp_player].lv_cameraCurrentTargetGroup, true, false);
                PlayerOptionOverride(lp_player, "camerafollow", "1");
            }
            else {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:1102

                if ((libGame_gv_players[lp_player].lv_cameraPlayerUnitGroupToFocusOn == null)) {
                    libGame_gv_players[lp_player].lv_cameraCurrentTargetGroup = null;
                    PlayerOptionOverride(lp_player, "camerafollow", "0");
                    CameraFollowUnitGroup(lp_player, CameraFollowUnitGroupGet(lp_player), false, false);
                }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameLib.galaxy:19106

        	if (autoE67D1356_var<0) { break; }
        	CameraLockInput(autoE67D1356_var, true);
        PlayerOptionOverride(autoE67D1356_var, "camerafollow", "0");
        libGame_gf_HeroDeathEnableDisableDeadSoundStateForPlayer(false, autoE67D1356_var);
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/StartingExperienceLib.galaxy:526

    if ((lp_lockUnlock == false)) {
        libStEx_gv_sETutorialCameraLocked = false;
        PlayerOptionOverride(1, "camerafollow", "0");
    }
    else {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/StartingExperienceLib.galaxy:530

    else {
        libStEx_gv_sETutorialCameraLocked = true;
        PlayerOptionOverride(1, "camerafollow", "1");
    }
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/StartingExperienceLib.galaxy:538

    // Implementation
    if ((libStEx_gv_sETutorialCameraLocked == true)) {
        PlayerOptionOverride(1, "camerafollow", "1");
    }
    else {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/StartingExperienceLib.galaxy:541

    }
    else {
        PlayerOptionOverride(1, "camerafollow", "0");
    }
}

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/StartingExperienceLib.galaxy:556

    libStEx_gv_simpleCinematic_CameraLocked2[lp_player] = lp_onOff;
    if ((lp_onOff == true)) {
        PlayerOptionOverride(lp_player, "camerafollow", "0");
        CameraLockInput(lp_player, true);
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/StartingExperienceLib.galaxy:570

        }
        else if (auto756E83E4_val == libCore_ge_GameModes_Tutorial1) {
            PlayerOptionOverride(lp_player, "camerafollow", null);
        }
        else {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/StartingExperienceLib.galaxy:573

        }
        else {
            PlayerOptionOverride(lp_player, "camerafollow", null);
        }
        CameraLockInput(lp_player, false);

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicSystem.galaxy:579

        if (lv_p < 0) { break; }
        MeleeSetOption(lv_p, c_meleeOptionXPGainDisable, false);
        PlayerOptionOverride(lv_p, "selectuncontrolable", "1");
        PlayerOptionOverride(lv_p, "gametooltips", "1");
        PlayerOptionOverride(lv_p, "tickedunitstatus", "0");

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicSystem.galaxy:580

        MeleeSetOption(lv_p, c_meleeOptionXPGainDisable, false);
        PlayerOptionOverride(lv_p, "selectuncontrolable", "1");
        PlayerOptionOverride(lv_p, "gametooltips", "1");
        PlayerOptionOverride(lv_p, "tickedunitstatus", "0");
        PlayerOptionOverride(lv_p, "selectuncontrolable", "1");

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicSystem.galaxy:581

        PlayerOptionOverride(lv_p, "selectuncontrolable", "1");
        PlayerOptionOverride(lv_p, "gametooltips", "1");
        PlayerOptionOverride(lv_p, "tickedunitstatus", "0");
        PlayerOptionOverride(lv_p, "selectuncontrolable", "1");
    }

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicSystem.galaxy:582

        PlayerOptionOverride(lv_p, "gametooltips", "1");
        PlayerOptionOverride(lv_p, "tickedunitstatus", "0");
        PlayerOptionOverride(lv_p, "selectuncontrolable", "1");
    }
    return true;

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

            lv_playerProp = lv_playerProp+1;
        }
        PlayerOptionOverride(lv_player, "selectuncontrolable", "1");
        PlayerOptionOverride(lv_player, "showcurrentordermodel", "0");
        MeleeSetOption(lv_player, c_meleeOptionXPGainDisable, false);

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

        }
        PlayerOptionOverride(lv_player, "selectuncontrolable", "1");
        PlayerOptionOverride(lv_player, "showcurrentordermodel", "0");
        MeleeSetOption(lv_player, c_meleeOptionXPGainDisable, false);
        auto38C35668_g = UnitGroupSearch(null, 15, PlayerStartLocation(lv_player), 10.0, UnitFilter(0, 0, (1 << c_targetFilterAlly) | (1 << c_targetFilterNeutral) | (1 << c_targetFilterEnemy) | (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0);