# Last Created Planet

Grammar — Last created Planet
FlagsNative | Function

Returns the last planet created with “Create Planet”.

Returns — int<planet>

native int PlanetLastCreated();

Category: Story / Planet Panel / Planets

# Examples

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

    if ((lp_planetID != libCamp_ge_PlanetID_PlanetNone)) {
        gf_PlanetPanelAddPlanet(lp_planetID, true);
        PlanetSetSelected(PlayerGroupAll(), PlanetLastCreated());
        PlanetPanelSetContactButtonState(PlayerGroupAll(), c_planetPanelContactButtonStatePlay);
    }

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

    if ((lp_planetID != libCamp_ge_PlanetID_PlanetNone)) {
        gf_PlanetPanelAddPlanet(lp_planetID, true);
        PlanetSetSelected(PlayerGroupAll(), PlanetLastCreated());
        PlanetPanelSetContactButtonState(PlayerGroupAll(), c_planetPanelContactButtonStatePlay);
    }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6330

    lv_missionIndex = (lv_mission);
    PlanetCreate(PlayerGroupAll(), c_planetStateActive);
    PlanetSetPlanetName(PlanetLastCreated(), libCamp_gf_PlanetName(lp_planet));
    PlanetSetPlanetModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetButtonModel[lv_planetIndex]);
    PlanetSetBackgroundModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetModel[lv_planetIndex]);

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6331

    PlanetCreate(PlayerGroupAll(), c_planetStateActive);
    PlanetSetPlanetName(PlanetLastCreated(), libCamp_gf_PlanetName(lp_planet));
    PlanetSetPlanetModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetButtonModel[lv_planetIndex]);
    PlanetSetBackgroundModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetModel[lv_planetIndex]);
    PlanetSetTooltipText(PlanetLastCreated(), libCamp_gf_MissionPlanetInfo(lv_mission));

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6332

    PlanetSetPlanetName(PlanetLastCreated(), libCamp_gf_PlanetName(lp_planet));
    PlanetSetPlanetModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetButtonModel[lv_planetIndex]);
    PlanetSetBackgroundModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetModel[lv_planetIndex]);
    PlanetSetTooltipText(PlanetLastCreated(), libCamp_gf_MissionPlanetInfo(lv_mission));
    PlanetSetMissionName(PlanetLastCreated(), libCamp_gf_MissionNameInUpperCase(lv_mission));

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6333

    PlanetSetPlanetModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetButtonModel[lv_planetIndex]);
    PlanetSetBackgroundModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetModel[lv_planetIndex]);
    PlanetSetTooltipText(PlanetLastCreated(), libCamp_gf_MissionPlanetInfo(lv_mission));
    PlanetSetMissionName(PlanetLastCreated(), libCamp_gf_MissionNameInUpperCase(lv_mission));
    PlanetSetPrimaryObjectiveText(PlanetLastCreated(), (libCamp_gf_MissionObjectivesText(lv_mission)));

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6334

    PlanetSetBackgroundModelLink(PlanetLastCreated(), libCamp_gv_tS_PlanetModel[lv_planetIndex]);
    PlanetSetTooltipText(PlanetLastCreated(), libCamp_gf_MissionPlanetInfo(lv_mission));
    PlanetSetMissionName(PlanetLastCreated(), libCamp_gf_MissionNameInUpperCase(lv_mission));
    PlanetSetPrimaryObjectiveText(PlanetLastCreated(), (libCamp_gf_MissionObjectivesText(lv_mission)));
    PlanetSetRewardTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_98485AE1"));

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6335

    PlanetSetTooltipText(PlanetLastCreated(), libCamp_gf_MissionPlanetInfo(lv_mission));
    PlanetSetMissionName(PlanetLastCreated(), libCamp_gf_MissionNameInUpperCase(lv_mission));
    PlanetSetPrimaryObjectiveText(PlanetLastCreated(), (libCamp_gf_MissionObjectivesText(lv_mission)));
    PlanetSetRewardTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_98485AE1"));
    if ((libCamp_gf_MissionReward(lv_mission) <= 0)) {

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6336

    PlanetSetMissionName(PlanetLastCreated(), libCamp_gf_MissionNameInUpperCase(lv_mission));
    PlanetSetPrimaryObjectiveText(PlanetLastCreated(), (libCamp_gf_MissionObjectivesText(lv_mission)));
    PlanetSetRewardTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_98485AE1"));
    if ((libCamp_gf_MissionReward(lv_mission) <= 0)) {
        PlanetSetRewardText(PlanetLastCreated(), StringToText(""));

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6338

    PlanetSetRewardTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_98485AE1"));
    if ((libCamp_gf_MissionReward(lv_mission) <= 0)) {
        PlanetSetRewardText(PlanetLastCreated(), StringToText(""));
    }
    else {

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6341

    }
    else {
        PlanetSetRewardText(PlanetLastCreated(), (libCamp_gf_FormatCredits(libCamp_gf_MissionReward(lv_mission), false)));
    }
    if ((lv_mission == libCamp_ge_MapID_MapTHorner05S)) {

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6344

    }
    if ((lv_mission == libCamp_ge_MapID_MapTHorner05S)) {
        PlanetSetMissionTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_549F1F43"));
        PlanetSetPlanetText(PlanetLastCreated(), StringExternal("Param/Value/lib_Camp_50B1B2CB"));
    }

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1711

    }
    libVCUI_gv_pU_MissionNextMap = lp_mission;
    PlanetSetMissionName(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapName(libVCUI_gv_pU_MissionNextMap));
    PlanetSetPrimaryObjectiveText(PlanetLastCreated(), StringExternal(libVCUI_gf_PU_MissionProperty("PrimaryObjectiveText")));
    PlanetSetBackgroundModelLink(PlanetLastCreated(), "SMX2_UI_Screens_Loading_Epilogue02");

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1712

    libVCUI_gv_pU_MissionNextMap = lp_mission;
    PlanetSetMissionName(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapName(libVCUI_gv_pU_MissionNextMap));
    PlanetSetPrimaryObjectiveText(PlanetLastCreated(), StringExternal(libVCUI_gf_PU_MissionProperty("PrimaryObjectiveText")));
    PlanetSetBackgroundModelLink(PlanetLastCreated(), "SMX2_UI_Screens_Loading_Epilogue02");
    PlanetSetContactModelLink(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactPortrait(lp_mission));

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1713

    PlanetSetMissionName(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapName(libVCUI_gv_pU_MissionNextMap));
    PlanetSetPrimaryObjectiveText(PlanetLastCreated(), StringExternal(libVCUI_gf_PU_MissionProperty("PrimaryObjectiveText")));
    PlanetSetBackgroundModelLink(PlanetLastCreated(), "SMX2_UI_Screens_Loading_Epilogue02");
    PlanetSetContactModelLink(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactPortrait(lp_mission));
    PlanetSetContactName(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactName(lp_mission));

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1714

    PlanetSetPrimaryObjectiveText(PlanetLastCreated(), StringExternal(libVCUI_gf_PU_MissionProperty("PrimaryObjectiveText")));
    PlanetSetBackgroundModelLink(PlanetLastCreated(), "SMX2_UI_Screens_Loading_Epilogue02");
    PlanetSetContactModelLink(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactPortrait(lp_mission));
    PlanetSetContactName(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactName(lp_mission));
    PlanetSetContactActorLink(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactActor(lp_mission));

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1715

    PlanetSetBackgroundModelLink(PlanetLastCreated(), "SMX2_UI_Screens_Loading_Epilogue02");
    PlanetSetContactModelLink(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactPortrait(lp_mission));
    PlanetSetContactName(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactName(lp_mission));
    PlanetSetContactActorLink(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactActor(lp_mission));
    PlanetSetTechnologyTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_VCUI_899CD639"));

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1716

    PlanetSetContactModelLink(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactPortrait(lp_mission));
    PlanetSetContactName(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactName(lp_mission));
    PlanetSetContactActorLink(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactActor(lp_mission));
    PlanetSetTechnologyTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_VCUI_899CD639"));
    PlanetSetTechnologyTooltipText(PlanetLastCreated(), StringToText(""));

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1717

    PlanetSetContactName(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactName(lp_mission));
    PlanetSetContactActorLink(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactActor(lp_mission));
    PlanetSetTechnologyTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_VCUI_899CD639"));
    PlanetSetTechnologyTooltipText(PlanetLastCreated(), StringToText(""));
    PlanetSetSelected(PlayerGroupAll(), PlanetLastCreated());

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1718

    PlanetSetContactActorLink(PlanetLastCreated(), libVoiC_gf_PC_CampaignMapContactActor(lp_mission));
    PlanetSetTechnologyTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_VCUI_899CD639"));
    PlanetSetTechnologyTooltipText(PlanetLastCreated(), StringToText(""));
    PlanetSetSelected(PlayerGroupAll(), PlanetLastCreated());
    ConversationDataRegisterPortrait(libVoiC_gf_PC_ClickableConversationLink("Artanis"), PortraitGetPlanetPanel());

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1719

    PlanetSetTechnologyTitle(PlanetLastCreated(), StringExternal("Param/Value/lib_VCUI_899CD639"));
    PlanetSetTechnologyTooltipText(PlanetLastCreated(), StringToText(""));
    PlanetSetSelected(PlayerGroupAll(), PlanetLastCreated());
    ConversationDataRegisterPortrait(libVoiC_gf_PC_ClickableConversationLink("Artanis"), PortraitGetPlanetPanel());
    PlanetPanelSetBackgroundImage(PlayerGroupAll(), "Assets\\Textures\\ui_planetpanel_frame_backdrop_space.dds");