Tinker
To make a trinket use TrinketTinker features, add a new entry to the custom asset mushymato.TrinketTinker/Tinker
.
The key used must match the unqualified ID of the trinket, e.g. {{ModId}}_Trinket
instead of (TR){{ModId}}_Trinket
.
When a mushymato.TrinketTinker/Tinker
entry exists, the TrinketEffectClass
field on Data/Trinkets
will be set to TrinketTinker.Effects.TrinketTinkerEffect
from this mod.
Note
Trinkets can be reloaded with patch reload <your content mod id>
.
Structure
Property | Type | Default | Notes |
---|---|---|---|
EnableCondition |
string | null | A game state query used to check if the trinket should be enabled. This is checked on equip, it can only be rechecked by reequipping the trinket. The check also happens every night, when the trinket is unequipped/reequipped by the game. |
EnableFailMessage |
string | null | When EnableCondition is false, this message will be displayed upon equipping the trinket.Default message: "You are not worthy of {{trinketName}}..." |
MinLevel |
int | 1 | Changes the level value that will replace {0} in DisplayName . |
Variants |
List<VariantData> | null | Defines the sprites of the companion. |
Motion |
MotionData | null | Defines how the companion moves. |
Abilities |
List<List<AbilityData>> | null | Defines what effects are activated, and when. Each list in the list of lists represents 1 ability level. |
VariantUnlockConditions |
List<string> | null | List of game state queries that determine how many variants are unlocked. |
AbilityUnlockConditions |
List<string> | null | List of game state queries that determine how many abilities are unlocked. |
Inventory |
TinkerInventoryData | null | Gives the trinket an inventory that can be opened by the "use" button (RightClick/X) over the trinket item. |
Chatter |
Dictionary<string, ChatterLinesData> | null | Gives the trinket dialogue for use with the Chatter ability. |
This is a lot of stuff, what do I need to define?
Technically all fields here are optional, but in that case there'd be little point to using this framework at all. To display a companion, at least Motion and 1 Variant must be defined. To have the trinket do things after equippping, at least 1 list of abilities must be defined. For Inventory
and Chatter
usage, refer to their subpages.
Trinkets are created with the first variant and at minimum level. The item query mushymato.TrinketTinker_CREATE_TRINKET is needed to create trinket at other variants/levels.
Unlock Conditions
VariantUnlockConditions
and AbilityUnlockConditions
can prevent the player from rolling variants or abilities above a certain level using game state queries. This only affects rerolling level and variants on the anvil and colorizer.
Example usage with 4 abilities (lv1 to lv4):
"AbilityUnlockConditions": [
// level 1 is always unlocked
// level 2 is unconditionally unlocked
null,
// level 3 unlocked if player has a gold ore in inventory
"PLAYER_HAS_ITEM Current (O)384",
// level 4 is also unconditionally unlocked once 3 is unlocked
null,
// there is no level 5, so this value is meaningless
"FALSE",
],
Deprecated
Motions
, previously unused but exists, is deprecated as of 1.5.0