# Selected Planet

Grammar — Currently selected planet by player player
FlagsNative | Function

Returns the planet the specified player has selected.

# Arguments

  • int — Player

Returns — int<planet>

native int PlanetGetSelected(int player);

Category: Story / Planet Panel / Planet Panel

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25055

    }

    if ((PlanetGetSelected(1) == c_invalidPlanetId)) {
        return true;
    }

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25060


    gf_StopAllTransmissionConversation();
    lv_index = gf_PlanetPanelPlanetIndexFromPlanet(PlanetGetSelected(1));
    gv_planetPanel_CurrentSelection = gv_planetPanel_Planets[lv_index].lv_planetID;
    lv_mission = libCamp_gf_PlanetMission(gv_planetPanel_CurrentSelection);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25103

    }

    lv_planetID = gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1));
    if ((lv_planetID == libCamp_ge_PlanetID_PlanetNone)) {
        return true;

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25167

    }

    lv_index = gf_PlanetPanelPlanetIndexFromPlanet(PlanetGetSelected(1));
    lv_planetID = gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1));
    if ((lv_planetID == libCamp_ge_PlanetID_PlanetNone)) {

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25168


    lv_index = gf_PlanetPanelPlanetIndexFromPlanet(PlanetGetSelected(1));
    lv_planetID = gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1));
    if ((lv_planetID == libCamp_ge_PlanetID_PlanetNone)) {
        return true;

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25205

    }

    if ((lv_planetID == gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1)))) {
        PlanetPanelSetContactButtonState(PlayerGroupAll(), c_planetPanelContactButtonStatePlay);
        gf_PlanetPanelGrayoutPortrait(true);

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25274

    }

    lv_index = gf_PlanetPanelPlanetIndexFromPlanet(PlanetGetSelected(1));
    lv_planetID = gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1));
    if ((lv_planetID == libCamp_ge_PlanetID_PlanetNone)) {

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25275


    lv_index = gf_PlanetPanelPlanetIndexFromPlanet(PlanetGetSelected(1));
    lv_planetID = gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1));
    if ((lv_planetID == libCamp_ge_PlanetID_PlanetNone)) {
        if ((gv_planetPanel_FidgetDone == false)) {

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:25303

    lv_missionID = libCamp_gf_PlanetMission(lv_planetID);
    if (((lv_missionID == libCamp_ge_MapID_MapTRaynor01) || (lv_missionID == libCamp_ge_MapID_MapTRaynor02) || (lv_missionID == libCamp_ge_MapID_MapTRaynor03) || (lv_missionID == libCamp_ge_MapID_MapTZeratul01) || (lv_missionID == libCamp_ge_MapID_MapTZeratul02) || (lv_missionID == libCamp_ge_MapID_MapTZeratul03) || (lv_missionID == libCamp_ge_MapID_MapTZeratul04) || (lv_missionID == libCamp_ge_MapID_MapTValerian02A) || (lv_missionID == libCamp_ge_MapID_MapTValerian02B) || (lv_missionID == libCamp_ge_MapID_MapTValerian03))) {
        if ((gf_PlanetPanelPlanetPitched(PlanetGetSelected(1)) == false)) {
            TriggerExecute(gt_PlanetPanelPlay, true, false);
        }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25055

    }

    if ((PlanetGetSelected(1) == c_invalidPlanetId)) {
        return true;
    }

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25060


    gf_StopAllTransmissionConversation();
    lv_index = gf_PlanetPanelPlanetIndexFromPlanet(PlanetGetSelected(1));
    gv_planetPanel_CurrentSelection = gv_planetPanel_Planets[lv_index].lv_planetID;
    lv_mission = libCamp_gf_PlanetMission(gv_planetPanel_CurrentSelection);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25103

    }

    lv_planetID = gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1));
    if ((lv_planetID == libCamp_ge_PlanetID_PlanetNone)) {
        return true;

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25167

    }

    lv_index = gf_PlanetPanelPlanetIndexFromPlanet(PlanetGetSelected(1));
    lv_planetID = gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1));
    if ((lv_planetID == libCamp_ge_PlanetID_PlanetNone)) {

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25168


    lv_index = gf_PlanetPanelPlanetIndexFromPlanet(PlanetGetSelected(1));
    lv_planetID = gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1));
    if ((lv_planetID == libCamp_ge_PlanetID_PlanetNone)) {
        return true;

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25205

    }

    if ((lv_planetID == gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1)))) {
        PlanetPanelSetContactButtonState(PlayerGroupAll(), c_planetPanelContactButtonStatePlay);
        gf_PlanetPanelGrayoutPortrait(true);

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25274

    }

    lv_index = gf_PlanetPanelPlanetIndexFromPlanet(PlanetGetSelected(1));
    lv_planetID = gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1));
    if ((lv_planetID == libCamp_ge_PlanetID_PlanetNone)) {

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25275


    lv_index = gf_PlanetPanelPlanetIndexFromPlanet(PlanetGetSelected(1));
    lv_planetID = gf_PlanetPanelPlanetIDFromPlanet(PlanetGetSelected(1));
    if ((lv_planetID == libCamp_ge_PlanetID_PlanetNone)) {
        if ((gv_planetPanel_FidgetDone == false)) {

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:25303

    lv_missionID = libCamp_gf_PlanetMission(lv_planetID);
    if (((lv_missionID == libCamp_ge_MapID_MapTRaynor01) || (lv_missionID == libCamp_ge_MapID_MapTRaynor02) || (lv_missionID == libCamp_ge_MapID_MapTRaynor03) || (lv_missionID == libCamp_ge_MapID_MapTZeratul01) || (lv_missionID == libCamp_ge_MapID_MapTZeratul02) || (lv_missionID == libCamp_ge_MapID_MapTZeratul03) || (lv_missionID == libCamp_ge_MapID_MapTZeratul04) || (lv_missionID == libCamp_ge_MapID_MapTValerian02A) || (lv_missionID == libCamp_ge_MapID_MapTValerian02B) || (lv_missionID == libCamp_ge_MapID_MapTValerian03))) {
        if ((gf_PlanetPanelPlanetPitched(PlanetGetSelected(1)) == false)) {
            TriggerExecute(gt_PlanetPanelPlay, true, false);
        }