Changes

Jump to navigation Jump to search
Line 414: Line 414:     
===Custom museum donations & rewards===
 
===Custom museum donations & rewards===
{{/doc status|a new doc page|done=false}}
+
{{/doc status|[[Modding:Museum]]|done=true}}
    
You can now add/edit the items which the [[museum]] gives back in rewards through the new <samp>Data/MuseumRewards</samp> data asset.
 
You can now add/edit the items which the [[museum]] gives back in rewards through the new <samp>Data/MuseumRewards</samp> data asset.
   −
====Format====
  −
The data asset consists of a string → model lookup, where...
  −
* The key is a [[Modding:Common data field types#Unique string ID|unique string ID]] for the reward group.
  −
* The value is a model with the fields listed below.
  −
  −
{| class="wikitable"
  −
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>TargetContextTags</samp>
  −
| The items that must be donated to complete this reward group. The player must fulfill every entry in the list to unlock the reward. This consists of a list of models with these fields:
  −
{| class="wikitable"
  −
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>Tag</samp>
  −
| The [[Modding:Context tags|context tag]] for the items to require.
  −
|-
  −
| <samp>Count</samp>
  −
| The minimum number of items matching the context tags that must be donated.
  −
|}
  −
  −
For example, an entry with the tag <samp>forage_item</samp> and count 2 will require donating any two forage items.
  −
  −
Special case: an entry with the exact values <code>Tag: "", Count: -1</code> passes if the museum is complete (i.e. the player has donated the max number of items).
  −
|-
  −
| <samp>FlagOnCompletion</samp>
  −
| ''(Optional if <samp>RewardItemIsSpecial</samp> is true)'' Whether to add the <samp>ID</samp> value to the player's received mail. This is used to track whether the player has collected the reward, and should almost always be true. If this is omitted and <samp>RewardItemIsSpecial</samp> is false, the player will be able collect the reward infinite times. Default false.
  −
  −
After the reward is collected, you can check this value using the <samp><nowiki>HasFlag</nowiki></samp> condition in [[Modding:Content Patcher|Content Patcher]].
  −
|-
  −
| <samp>RewardActions</samp>
  −
| Run one or more [[Modding:Trigger actions|trigger action strings]]. For example, this adds {{price|500}} to the current player:
  −
<syntaxhighlight lang="js">
  −
"RewardActions": [
  −
    "AddMoney 500"
  −
]
  −
</syntaxhighlight>
  −
|-
  −
| <samp>RewardItemId</samp>
  −
| ''(Optional)'' The [[#Custom items|qualified item ID]] for the item given to the player when they donate all required items for this group. There's no reward item if omitted.
  −
|-
  −
| <samp>RewardItemCount</samp>
  −
| ''(Optional)'' The stack size for the <samp>RewardItemId</samp> (if the item supports stacking). Default 1.
  −
|-
  −
| <samp>RewardItemIsSpecial</samp>
  −
| ''(Optional)'' Whether to mark the <samp>RewardItemId</samp> as a special permanent item, which can't be destroyed/dropped and can only be collected once. Default false.
  −
|-
  −
| <samp>RewardItemIsRecipe</samp>
  −
| ''(Optional)'' Whether to give the player a cooking/crafting recipe which produces the <samp>RewardItemId</samp>, instead of the item itself. Ignored if the item type can't be cooked/crafted (i.e. non-object-type items). Default false.
  −
|-
  −
| <samp>CustomFields</samp>
  −
| The [[#Custom data fields|custom fields]] for this entry.
  −
|}
  −
  −
For example, this content pack adds two rewards (one mail and one item):
  −
{{#tag:syntaxhighlight|<nowiki>
  −
{
  −
    "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
  −
    "Changes": [
  −
        {
  −
            "Action": "EditData",
  −
            "Target": "Data/MuseumRewards",
  −
            "Entries": {
  −
                // send a letter when a specific item is donated
  −
                "{{ModId}}_ShinyArtifact": {
  −
                    "TargetContextTags": [
  −
                        {
  −
                            "Tag": "id_{{ModId}}_ShinyArtifact", // unique context tag identifying the item by ID
  −
                            "Count": 1
  −
                        },
  −
                    ],
  −
                    "FlagOnCompletion": true,
  −
                    "RewardActions": [ "AddMail Current {{ModId}}_ShinyArtifact" ]
  −
                },
  −
  −
                // give item when 18 minerals are donated
  −
                "{{ModId}}_18MineralItems": {
  −
                    "TargetContextTags": [
  −
                        {
  −
                            "Tag": "item_type_minerals",
  −
                            "Count": 18
  −
                        },
  −
                    ],
  −
                    "RewardItemId": "(BC){{ModId}}_SuperMachine",
  −
                    "RewardItemCount": 1,
  −
                    "FlagOnCompletion": true
  −
                }
  −
            }
  −
        }
  −
    ]
  −
}</nowiki>|lang=javascript}}
  −
  −
See also [[Modding:Mail data|mail data]], [[#Custom items|custom items]], and [[#custom machines|custom machines]] to add the custom mail and items.
  −
  −
====Achievements====
   
The ''A Complete Collection'' [[Achievements|achievement]] is automatically adjusted to require any custom donations added too. This is based on the number of donated items though, so removing custom donations later may incorrectly mark the museum complete (since you may have donated enough items to meet the total required).
 
The ''A Complete Collection'' [[Achievements|achievement]] is automatically adjusted to require any custom donations added too. This is based on the number of donated items though, so removing custom donations later may incorrectly mark the museum complete (since you may have donated enough items to meet the total required).
  
138

edits

Navigation menu