# Last Created Purchase Group
Grammar — Last created purchase group
Flags —Native
|Function
Returns the last purchase group created by the “Create Purchase Group” action.
Returns — int
<preset::PurchaseGroup>
native int PurchaseGroupLastCreated();
# Related
Category: Story / Tech Purchase Panel / Purchase Groups
- Create Purchase Group —
int
<preset::PurchaseGroup> — PurchaseGroupCreate - Last Created Purchase Group —
int
<preset::PurchaseGroup> — PurchaseGroupLastCreated - Destroy Purchase Group —
void
— PurchaseGroupDestroy - Destroy All Purchase Groups —
void
— PurchaseGroupDestroyAll - Set Purchase Group Name —
void
— PurchaseGroupSetNameText - Set Purchase Group Tooltip —
void
— PurchaseGroupSetTooltipText - Set Purchase Group Slot —
void
— PurchaseGroupSetSlot - Set Purchase Group Unit —
void
— PurchaseGroupSetUnitLink - Set Purchase Group Icon —
void
— PurchaseGroupSetIconFilePath - Set Purchase Group Players —
void
— PurchaseGroupSetPlayerGroup - Set Purchase Group State —
void
— PurchaseGroupSetState
# Examples
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7609
if ((libCamp_gv_tS_TechGroupID[lv_index] != libCamp_ge_StoryTechGroup_StoryTechGroupNone) && (libCamp_gv_tS_TechGroupCategoryID[lv_index] != libCamp_ge_StoryTechCategory_StoryTechCategoryNone) && (libCamp_gv_tS_TechGroup_UI[lv_index] == c_invalidPurchaseGroupId)) {
PurchaseGroupCreate(PlayerGroupAll(), libCamp_gv_tS_TechCategory_UI[(libCamp_gv_tS_TechGroupCategoryID[lv_index])], 1);
libCamp_gv_tS_TechGroup_UI[lv_index] = PurchaseGroupLastCreated();
PurchaseGroupSetNameText(PurchaseGroupLastCreated(), libCamp_gv_tS_TechGroupName[lv_index]);
}
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7610
PurchaseGroupCreate(PlayerGroupAll(), libCamp_gv_tS_TechCategory_UI[(libCamp_gv_tS_TechGroupCategoryID[lv_index])], 1);
libCamp_gv_tS_TechGroup_UI[lv_index] = PurchaseGroupLastCreated();
PurchaseGroupSetNameText(PurchaseGroupLastCreated(), libCamp_gv_tS_TechGroupName[lv_index]);
}