# Create Purchase Item

Grammar — Create a new purchase item for Players in slot slot under __purchaseGroup|Purchase Group __
FlagsNative | Action

Creates a purchasable tech item for the specified purchase group and players. Use “Last Created Purchase Item” to get the purchase item created by this action. Tech purchase actions are used to populate the Hyperion Armory tech purchase UI with data.

# Arguments

  • playergroup — Players
  • int<preset::PurchaseGroup> — Purchase Group
  • int — Slot

Returns — int<preset::PurchaseItem>

native int PurchaseItemCreate(
	playergroup inPlayerGroup,
	int inPurchaseGroupId,
	int inSlot,
);

Category: Story / Tech Purchase Panel / Purchase Items

# Examples

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

        lv_techIndex = (lv_indexTech);
        if ((libCamp_gv_tS_Tech_UI[lv_techIndex] == c_invalidPurchaseItemId)) {
            PurchaseItemCreate(PlayerGroupAll(), libCamp_gv_tS_TechGroup_UI[(libCamp_gv_tS_Tech_GroupID[lv_techIndex])], libCamp_gf_StoryTechSlot(lv_indexTech));
            libCamp_gv_tS_Tech_UI[lv_techIndex] = PurchaseItemLastCreated();
            PurchaseItemSetCost(PurchaseItemLastCreated(), libCamp_gf_StoryTechCost(lv_indexTech));