# Last Created Research Category

Grammar — Last created research category
FlagsNative | Function

Returns the last research category created using “Create Research Category”.

Returns — int<preset::ResearchCategory>

native int ResearchCategoryLastCreated();

Category: Story / Research Panel

# Examples

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

        }
        ResearchCategoryCreate(PlayerGroupAll(), lv_categoryIndex);
        libCamp_gv_tS_ResearchUICategories[lv_categoryIndex] = ResearchCategoryLastCreated();
        ResearchCategorySetNameText(ResearchCategoryLastCreated(), lv_categoryName);
        lv_tierIndex = 1;

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

        ResearchCategoryCreate(PlayerGroupAll(), lv_categoryIndex);
        libCamp_gv_tS_ResearchUICategories[lv_categoryIndex] = ResearchCategoryLastCreated();
        ResearchCategorySetNameText(ResearchCategoryLastCreated(), lv_categoryName);
        lv_tierIndex = 1;
        for ( ; ( (autoBD7EADA4_ai >= 0 && lv_tierIndex <= autoBD7EADA4_ae) || (autoBD7EADA4_ai < 0 && lv_tierIndex >= autoBD7EADA4_ae) ) ; lv_tierIndex += autoBD7EADA4_ai ) {

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

        lv_tierIndex = 1;
        for ( ; ( (autoBD7EADA4_ai >= 0 && lv_tierIndex <= autoBD7EADA4_ae) || (autoBD7EADA4_ai < 0 && lv_tierIndex >= autoBD7EADA4_ae) ) ; lv_tierIndex += autoBD7EADA4_ai ) {
            ResearchTierCreate(PlayerGroupAll(), ResearchCategoryLastCreated(), lv_tierIndex);
            libCamp_gv_tS_ResearchUITiers[lv_categoryIndex][lv_tierIndex] = ResearchTierLastCreated();
            ResearchTierSetMaxPurchasesAllowed(ResearchTierLastCreated(), 1);