# Purchase Purchase Item
Grammar — Purchase purchaseItem
Flags —Native
|Action
Convenience function to mark the specified purchase item as purchased, recently purchased, and play the purchase animation on it.
# Arguments
int
<preset::PurchaseItem> — Purchase Item
Returns — void
native void PurchaseItemPurchase(int inPurchaseItemId);
# Related
Category: Story / Tech Purchase Panel / Interaction
- Purchase Made —
void
— TriggerAddEventPurchaseMade - Purchase Item Selected —
void
— TriggerAddEventSelectedPurchaseItemChanged - Purchase Item Selected —
void
— TriggerAddEventSelectedPurchaseItemChanged - Purchase Category Selected —
void
— TriggerAddEventSelectedPurchaseCategoryChanged - Purchase Category Selected —
void
— TriggerAddEventSelectedPurchaseCategoryChanged - Purchase Exit —
void
— TriggerAddEventPurchaseExit - Set Selected Purchase Category —
void
— PurchaseSetSelectedPurchaseCategory - Set Selected Purchase Item —
void
— PurchaseSetSelectedPurchaseItem - Purchase Purchase Item —
void
— PurchaseItemPurchase - Selected Purchase Category —
int
<preset::PurchaseCategory> — PurchaseGetSelectedPurchaseCategory - Selected Purchase Item —
int
<preset::PurchaseItem> — PurchaseGetSelectedPurchaseItem - Purchased Purchase Item —
int
<preset::PurchaseItem> — EventPurchaseMade - Purchase Item Is Recently Purchased —
bool
— PurchaseItemIsRecentlyPurchased
# Examples
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:12698
PlayerModifyPropertyInt(1, c_playerPropCredits, c_playerPropOperSetTo, libCamp_gf_StoryCredits());
libCamp_gf_TS_AddRecentTech(lv_tech);
PurchaseItemPurchase(libCamp_gv_tS_Tech_UI[(lv_tech)]);
TriggerDebugOutput(1, (StringExternal("Param/Value/lib_Camp_D1E7DDD8") + IntToText(libCamp_gf_TS_StoryTechPurchasedCountInCategory(libCamp_ge_StoryTechCategory_StoryTechCategoryInfantry))), false);
AchievementTermQuantitySet(1, "TStory01_1", libCamp_gf_TS_StoryTechPurchasedCountInCategory(libCamp_ge_StoryTechCategory_StoryTechCategoryInfantry));