# Create Purchase Group
Grammar — Create a new purchase group for Players in slot slot under purchaseCategory
Flags —Native
|Action
Creates a purchase group for the specified purchase category and players. Use “Last Created Purchase Group” to get the purchase group created by this action. Tech purchase actions are used to populate the Hyperion Armory tech purchase UI with data.
# Arguments
playergroup
— Playersint
<preset::PurchaseCategory> — Purchase Categoryint
— Slot
Returns — int
<preset::PurchaseGroup>
native int PurchaseGroupCreate(
playergroup inPlayerGroup,
int inPurchaseCategoryId,
int inSlot,
);
# 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:7608
for ( ; ( (auto583598E1_ai >= 0 && lv_index <= auto583598E1_ae) || (auto583598E1_ai < 0 && lv_index >= auto583598E1_ae) ) ; lv_index += auto583598E1_ai ) {
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]);