# Create Purchase Group

Grammar — Create a new purchase group for Players in slot slot under purchaseCategory
FlagsNative | 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 — Players
  • int<preset::PurchaseCategory> — Purchase Category
  • int — Slot

Returns — int<preset::PurchaseGroup>

native int PurchaseGroupCreate(
	playergroup inPlayerGroup,
	int inPurchaseCategoryId,
	int inSlot,
);

Category: Story / Tech Purchase Panel / Purchase Groups

# Examples

campaigns/libertystory.sc2campaignbase.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]);