Modding:Pets: Difference between revisions
imported>SVFan2349 |
imported>Sunbeam135 m added ru link |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 100: | Line 100: | ||
| The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the list. | | The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the list. | ||
|- | |- | ||
| | | ''common fields'' | ||
| | | See [[Modding:Item queries#Item spawn fields|item spawn fields]] for the generic item fields supported by pet gifts. | ||
Notes: | |||
| | * If <samp>ItemId</samp> or <samp>RandomItemId</samp> is set to an [[Modding:Item queries|item query]] which returns multiple items, one item will be selected at random. | ||
|- | |- | ||
| <samp>MinimumFriendshipThreshold</samp> | | <samp>MinimumFriendshipThreshold</samp> | ||
| Line 111: | Line 111: | ||
| <samp>Weight</samp> | | <samp>Weight</samp> | ||
| ''(Optional)'' The option's weight when randomly choosing a gift, relative to other gifts in the list (e.g. <samp>2</samp> is twice as likely as <samp>1</samp>). Default 1. | | ''(Optional)'' The option's weight when randomly choosing a gift, relative to other gifts in the list (e.g. <samp>2</samp> is twice as likely as <samp>1</samp>). Default 1. | ||
|- | |||
| <samp>QualifiedItemID</samp><br /><samp>Stack</samp> | |||
| '''Obsolete.''' Use <samp>ItemId</samp> and <samp>MinStack</samp> in the [[Modding:Item queries#Item spawn fields|item spawn fields]] instead. | |||
|} | |} | ||
|} | |} | ||
| Line 293: | Line 296: | ||
! effect | ! effect | ||
|- | |- | ||
| <samp> | | <samp>Id</samp> | ||
| The unique ID for the breed within the pet type. | | The unique ID for the breed within the pet type. | ||
|- | |- | ||
| Line 304: | Line 307: | ||
| <samp>IconSourceRect</samp> | | <samp>IconSourceRect</samp> | ||
| The icon's pixel area within the <samp>IconTexture</samp>, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. | | The icon's pixel area within the <samp>IconTexture</samp>, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. | ||
|- | |||
| <samp>CanBeChosenAtStart</samp> | |||
| ''(Optional)'' Whether this pet can be chosen as a starter pet during character creation. Default true. | |||
|- | |||
| <samp>CanBeAdoptedFromMarnie</samp> | |||
| ''(Optional)'' Whether this pet can be adopted from Marnie once she starts offering pets. Default true. | |||
|- | |||
| <samp>AdoptionPrice</samp> | |||
| ''(Optional)'' The gold price to adopt this pet in Marnie's shop, if it can be adopted. Default {{price|40000}}. | |||
|- | |- | ||
| <samp>BarkOverride</samp> | | <samp>BarkOverride</samp> | ||
| Line 387: | Line 399: | ||
|} | |} | ||
The rows for moving down, right, up, and left will be used when copy/pasting the Walk behavior from the cat, dog, or turtle. If you don't use that behavior, you can actually put things that aren't moving up, down, or left there. However, in the absence of any defined Behavior, the pet will still use frames 28 and 29 for sleeping. | The rows for moving down, right, up, and left will be used when copy/pasting the Walk behavior from the cat, dog, or turtle. If you don't use that behavior, you can actually put things that aren't moving up, down, or left there. However, in the absence of any defined Behavior, the pet will still use frames 28 and 29 for sleeping, and when being pushed it will use frames 0, 4, 8, or 12 depending on which direction the player is pushing from (e.g. if pushing from the left in order to move right, the pet will face right, using frame 4). | ||
[[Category:Modding]] | [[Category:Modding]] | ||
[[ru:Модификации:Питомцы]] | |||
[[zh:模组:宠物]] | |||
Latest revision as of 19:00, 13 March 2026
← Index
This page documents how the game stores and parses data for pets. This is an advanced guide for mod developers.
Data Format
You can create and customize pets & pet breeds by editing the Data/Pets asset.
This consists of a string → model lookup, where...
- The key is a unique string ID for the pet (not the pet breed). The vanilla IDs are Cat and Dog.
- The value is a model with the fields listed below.
Basic info
| field | effect |
|---|---|
| DisplayName | A tokenizable string for the pet type's display name (e.g. "cat" or "dog"). For example, the vanilla adoption events show this when Marnie asks if you want to adopt the cat/dog. |
Audio & sprites
| field | effect |
|---|---|
| BarkSound | The cue ID for the pet's occasional 'bark' sound. |
| ContentSound | The cue ID for the sound which the pet makes when you pet it. |
| RepeatContentSoundAfter | (Optional) The number of milliseconds until the ContentSound is repeated once. This is used by the dog, who pants twice when pet. Defaults to -1 (disabled). |
| EmoteOffset | (Optional) A pixel offset for the emote drawn above the pet sprite, specified as an object with X and Y fields. For example, this affects the heart emote shown after petting it. Default none. |
Events
| field | effect | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| EventOffset | (Optional) The pixel offset for the pet when shown in events like Marnie's adoption event, specified as an object with X and Y fields. Default none. | ||||||||||||
| AdoptionEventLocation AdoptionEventId |
(Optional) If both fields are set, the location and event ID which lets the player adopt this pet. This forces the event to play after 20 days if its preconditions haven't been met yet. Default Farm and none respectively. | ||||||||||||
| SummitPerfectionEvent | (Optional) How to render the pet during the summit perfection slideshow. If this isn't set, the pet won't be shown in the slideshow.
This consists of a model with these fields:
|
Gifts
| field | effect | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GiftChance | (Optional) The random probability each day that the pet will give the player a gift from the Gifts list when they interact with the pet. Specified as a value between 0 (never) and 1 (always). Default .2 (20% chance). | ||||||||||||
| Gifts | (Optional) The list of gifts that this pet can give if the GiftChance is successful. Default none.
This consists of a list of models with these fields:
|
Behavior
| field | effect | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Id | The unique string ID for this entry within the list. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MoveSpeed | (Optional) How quickly the pet can move. Default 2. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SleepOnBedChance SleepNearBedChance SleepOnRugChance |
(Optional) The percentage chances for the locations where the pet will sleep each night, as a decimal value between 0 (never) and 1 (always). Each value is checked in the order listed at left until a match is found. If none of them match, the pet will choose a random empty spot in the farmhouse; if none was found, it'll sleep next to its pet bowl outside. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Behaviors | The pet's possible actions and behaviors, defined as the states in a state machine. Essentially the pet will be in one state at any given time, which also determines which state they can transition to next. For example, a cat can transition from Walk to BeginSitDown, but it can't skip instantly from Walk to SitDownLick.
This consists of a list of models with these fields:
|
Breeds
| field | effect | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Breeds | The cosmetic breeds which can be selected in the character customization menu when creating a save. This consists of a list of models with these fields:
|
Advanced
| field | effect |
|---|---|
| CustomFields | The custom fields for this entry. |
Spritesheet layout
Explanation
Each farm animal's spritesheet must have exactly 4 columns. The sprite size is expected to be 32x32.
The expected rows are:
- move down;
- move right;
- move up;
- move left
- unique animations 1;
- unique animations 2;
- unique animations 3;
- sleep and unique animations 4;
- unique animations 5
For example, the default layout is:
| 0 (move down 1) | 1 (move down 2) | 2 (move down 3) | 3 (move down 4) |
| 4 (move right 1) | 5 (move right 2) | 6 (move right 3) | 7 (move right 4) |
| 8 (move up 1) | 9 (move up 2) | 10 (move up 3) | 11 (move up 4) |
| 12 (move left 1) | 13 (move left 2) | 14 (move left 3) | 15 (move left 4) |
| 16 (unique) | 17 (unique) | 18 (unique) | 19 (unique) |
| 20 (unique) | 21 (unique) | 22 (unique) | 23 (unique) |
| 24 (unique) | 25 (unique) | 26 (unique) | 27 (unique) |
| 28 (sleep 1) | 29 (sleep 2) | 30 (unique) | 31 (unique) |
| 32 (unique) | 33 (unique) | 34 (unique) | 35 (unique) |
The rows for moving down, right, up, and left will be used when copy/pasting the Walk behavior from the cat, dog, or turtle. If you don't use that behavior, you can actually put things that aren't moving up, down, or left there. However, in the absence of any defined Behavior, the pet will still use frames 28 and 29 for sleeping, and when being pushed it will use frames 0, 4, 8, or 12 depending on which direction the player is pushing from (e.g. if pushing from the left in order to move right, the pet will face right, using frame 4).