Line 1: |
Line 1: |
− | {{upcoming|1.6}}
| |
− |
| |
| ← [[Modding:Index|Index]] | | ← [[Modding:Index|Index]] |
| | | |
Line 7: |
Line 5: |
| ==Data== | | ==Data== |
| ===Format=== | | ===Format=== |
− | You can create and change shops by editing the <samp>Data/Shops</samp> asset. This consists of a string → model lookup, where the key is a [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for the shop, and the value is a model with these fields. | + | You can create and change shops by editing the <samp>Data/Shops</samp> asset. This consists of a string → model lookup, where the key is a [[Modding:Common data field types#Unique string ID|unique string ID]] for the shop, and the value is a model with these fields. |
| | | |
| {| class="wikitable" | | {| class="wikitable" |
Line 84: |
Line 82: |
| | <samp>PerItemCondition</samp> | | | <samp>PerItemCondition</samp> |
| | ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether an item produced from the other fields should be added (e.g. to filter results from item queries like <samp>ALL_ITEMS</samp>). Defaults to always added. | | | ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether an item produced from the other fields should be added (e.g. to filter results from item queries like <samp>ALL_ITEMS</samp>). Defaults to always added. |
| + | |- |
| + | | <samp>ActionsOnPurchase</samp> |
| + | | ''(Optional)'' A list of [[Modding:Trigger actions|actions]] to run when the player purchases this item. These are run once per purchase click. Default none. |
| + | |
| + | For example, this can be used to start a [[Modding:Dialogue#Conversation topics|conversation topic]] when it's purchased: |
| + | <syntaxhighlight lang="js"> |
| + | "ActionsOnPurchase": [ |
| + | "AddConversationTopic {{ModId}}_PurchasedItem 5" |
| + | ] |
| + | </syntaxhighlight> |
| |} | | |} |
| |- | | |- |
Line 116: |
Line 124: |
| | ''(Optional)'' One of... | | | ''(Optional)'' One of... |
| * the internal name of the NPC whose portrait to show; | | * the internal name of the NPC whose portrait to show; |
− | * the asset name of the texture to display. | + | * the asset name of the texture to display; |
| + | * or an empty string (or other value which doesn't match an NPC or texture asset name) to disable the portrait. |
| + | |
| + | Defaults to the portrait for the NPC matching the <samp>Name</samp> field (if any). |
| | | |
− | In either case, it'll draw the 64x64 pixel area in the top-left corner of the texture. If omitted, defaults to the portrait for the NPC matching the <samp>Name</samp> field (if any). If set to a value which doesn't match an NPC or texture asset name, the portrait is disabled.
| + | If drawn, it'll use the 64x64 pixel area in the top-left corner of the texture. |
| + | Note : it is possible that name of "none" prevents any portrait to be used. |
| |- | | |- |
| | <samp>Dialogues</samp> | | | <samp>Dialogues</samp> |
Line 128: |
Line 140: |
| |- | | |- |
| | <samp>Id</samp> | | | <samp>Id</samp> |
− | | The [[Modding:Modder Guide/Game Fundamentals#Unique string IDs|unique string ID]] for this dialogue within the current list. | + | | The [[Modding:Common data field types#Unique string ID|unique string ID]] for this dialogue within the current list. |
| |- | | |- |
| | <samp>Dialogue</samp> | | | <samp>Dialogue</samp> |
Line 153: |
Line 165: |
| | <samp>ClosedMessage</samp> | | | <samp>ClosedMessage</samp> |
| | ''(Optional)'' If set, a [[Modding:Tokenizable strings|tokenizable string]] for a 'shop is closed'-style message to show instead of opening the shop. | | | ''(Optional)'' If set, a [[Modding:Tokenizable strings|tokenizable string]] for a 'shop is closed'-style message to show instead of opening the shop. |
| + | |
| + | '''This should not be set except in a separate entry'''. Adding it to an owner entry will prevent it from being used. |
| |- | | |- |
| | <samp>RandomizeDialogueOnOpen</samp> | | | <samp>RandomizeDialogueOnOpen</samp> |
Line 333: |
Line 347: |
| | | |
| ===Vanilla shop IDs=== | | ===Vanilla shop IDs=== |
− | Vanilla shops are now defined in <samp>Data/Shops</samp> too (except a few special cases like [[:Category:Dressers|dressers]] and home renovations).
| + | The base game's shops are defined in <samp>Data/Shops</samp> too (except a few special cases like [[:Category:Dressers|dressers]] and home renovations). |
| | | |
| See <samp>Data/Shops</samp> for a full list, but here are the main shop IDs for convenience: | | See <samp>Data/Shops</samp> for a full list, but here are the main shop IDs for convenience: |
Line 400: |
Line 414: |
| |} | | |} |
| | | |
− | Festival shops are also defined in <samp>Data/Shops</samp> now, though they can still be defined in the pre-1.6 way for backwards compatibility.
| + | And the main festival shops: |
| {| class="wikitable sortable" | | {| class="wikitable sortable" |
| |- | | |- |