# Create Purchase Category
Grammar — Create a new purchase category for Players in slot slot
Flags —Native
|Action
Creates a group for purchasable techs for the specified player group. Use “Last Created Purchase Category” to get the purchase category created by this action. Tech purchase actions are used to populate the Hyperion Armory tech purchase UI with data.
# Arguments
playergroup
— Playersint
— Slot
Returns — int
<preset::PurchaseCategory>
native int PurchaseCategoryCreate(
playergroup inPlayerGroup,
int inSlot,
);
# Related
Category: Story / Tech Purchase Panel / Purchase Categories
- Create Purchase Category —
int
<preset::PurchaseCategory> — PurchaseCategoryCreate - Last Created Purchase Category —
int
<preset::PurchaseCategory> — PurchaseCategoryLastCreated - Destroy Purchase Category —
void
— PurchaseCategoryDestroy - Destroy All Purchase Categories —
void
— PurchaseCategoryDestroyAll - Set Purchase Category Name —
void
— PurchaseCategorySetNameText - Set Purchase Category Slot —
void
— PurchaseCategorySetSlot - Set Purchase Category Players —
void
— PurchaseCategorySetPlayerGroup - Set Purchase Category State —
void
— PurchaseCategorySetState
# Examples
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7585
for ( ; ( (autoCC1C88BE_ai >= 0 && lv_index <= autoCC1C88BE_ae) || (autoCC1C88BE_ai < 0 && lv_index >= autoCC1C88BE_ae) ) ; lv_index += autoCC1C88BE_ai ) {
if ((libCamp_gv_tS_TechCategoryID[lv_index] != libCamp_ge_StoryTechCategory_StoryTechCategoryNone) && (libCamp_gv_tS_TechCategory_UI[lv_index] == c_invalidPurchaseCategoryId)) {
PurchaseCategoryCreate(PlayerGroupAll(), libCamp_gv_tS_TechCategorySlot[lv_index]);
libCamp_gv_tS_TechCategory_UI[lv_index] = PurchaseCategoryLastCreated();
PurchaseCategorySetNameText(PurchaseCategoryLastCreated(), libCamp_gv_tS_TechCategoryName[lv_index]);