# Last Created Research Item

Grammar — Last created research item
FlagsNative | Function

Returns the last research item created using “Create Research Item”.

Returns — int<preset::ResearchItem>

native int ResearchItemLastCreated();

Category: Story / Research Panel

# Examples

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

        lv_slotIndex = libCamp_gf_TS_StoryResearchSlot(lv_indexResearch);
        ResearchItemCreate(PlayerGroupAll(), libCamp_gv_tS_ResearchUITiers[lv_categoryIndex][lv_tierIndex], lv_slotIndex);
        libCamp_gv_tS_ResearchUIItem[(lv_indexResearch)] = ResearchItemLastCreated();
        lv_uIItem[lv_categoryIndex][lv_tierIndex][lv_slotIndex] = ResearchItemLastCreated();
        ResearchItemSetNameText(ResearchItemLastCreated(), libCamp_gf_StoryResearchName(lv_indexResearch));

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

        ResearchItemCreate(PlayerGroupAll(), libCamp_gv_tS_ResearchUITiers[lv_categoryIndex][lv_tierIndex], lv_slotIndex);
        libCamp_gv_tS_ResearchUIItem[(lv_indexResearch)] = ResearchItemLastCreated();
        lv_uIItem[lv_categoryIndex][lv_tierIndex][lv_slotIndex] = ResearchItemLastCreated();
        ResearchItemSetNameText(ResearchItemLastCreated(), libCamp_gf_StoryResearchName(lv_indexResearch));
        ResearchItemSetDescriptionText(ResearchItemLastCreated(), libCamp_gf_StoryResearchDescription(lv_indexResearch));

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

        libCamp_gv_tS_ResearchUIItem[(lv_indexResearch)] = ResearchItemLastCreated();
        lv_uIItem[lv_categoryIndex][lv_tierIndex][lv_slotIndex] = ResearchItemLastCreated();
        ResearchItemSetNameText(ResearchItemLastCreated(), libCamp_gf_StoryResearchName(lv_indexResearch));
        ResearchItemSetDescriptionText(ResearchItemLastCreated(), libCamp_gf_StoryResearchDescription(lv_indexResearch));
        ResearchItemSetIconFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchIcon(lv_indexResearch));

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

        lv_uIItem[lv_categoryIndex][lv_tierIndex][lv_slotIndex] = ResearchItemLastCreated();
        ResearchItemSetNameText(ResearchItemLastCreated(), libCamp_gf_StoryResearchName(lv_indexResearch));
        ResearchItemSetDescriptionText(ResearchItemLastCreated(), libCamp_gf_StoryResearchDescription(lv_indexResearch));
        ResearchItemSetIconFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchIcon(lv_indexResearch));
        ResearchItemSetMovieFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchMovie(lv_indexResearch));

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

        ResearchItemSetNameText(ResearchItemLastCreated(), libCamp_gf_StoryResearchName(lv_indexResearch));
        ResearchItemSetDescriptionText(ResearchItemLastCreated(), libCamp_gf_StoryResearchDescription(lv_indexResearch));
        ResearchItemSetIconFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchIcon(lv_indexResearch));
        ResearchItemSetMovieFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchMovie(lv_indexResearch));
        ResearchItemSetTooltipText(ResearchItemLastCreated(), libCamp_gf_StoryResearchTooltip(lv_indexResearch));

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

        ResearchItemSetDescriptionText(ResearchItemLastCreated(), libCamp_gf_StoryResearchDescription(lv_indexResearch));
        ResearchItemSetIconFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchIcon(lv_indexResearch));
        ResearchItemSetMovieFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchMovie(lv_indexResearch));
        ResearchItemSetTooltipText(ResearchItemLastCreated(), libCamp_gf_StoryResearchTooltip(lv_indexResearch));
        ResearchItemSetConfirmationText(ResearchItemLastCreated(), libCamp_gf_StoryResearchConfirmationText(lv_indexResearch));

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

        ResearchItemSetIconFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchIcon(lv_indexResearch));
        ResearchItemSetMovieFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchMovie(lv_indexResearch));
        ResearchItemSetTooltipText(ResearchItemLastCreated(), libCamp_gf_StoryResearchTooltip(lv_indexResearch));
        ResearchItemSetConfirmationText(ResearchItemLastCreated(), libCamp_gf_StoryResearchConfirmationText(lv_indexResearch));
        ResearchItemSetState(ResearchItemLastCreated(), c_researchItemStateEnabled);

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

        ResearchItemSetMovieFilePath(ResearchItemLastCreated(), libCamp_gf_StoryResearchMovie(lv_indexResearch));
        ResearchItemSetTooltipText(ResearchItemLastCreated(), libCamp_gf_StoryResearchTooltip(lv_indexResearch));
        ResearchItemSetConfirmationText(ResearchItemLastCreated(), libCamp_gf_StoryResearchConfirmationText(lv_indexResearch));
        ResearchItemSetState(ResearchItemLastCreated(), c_researchItemStateEnabled);
        auto9C5BB20A_i = auto9C5BB20A_i + 1;

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

        ResearchItemSetTooltipText(ResearchItemLastCreated(), libCamp_gf_StoryResearchTooltip(lv_indexResearch));
        ResearchItemSetConfirmationText(ResearchItemLastCreated(), libCamp_gf_StoryResearchConfirmationText(lv_indexResearch));
        ResearchItemSetState(ResearchItemLastCreated(), c_researchItemStateEnabled);
        auto9C5BB20A_i = auto9C5BB20A_i + 1;
    }