Changes

→‎Spritesheet layout: + pre-1.6 vanilla layouts
Line 242: Line 242:  
|-
 
|-
 
| <samp>Texture</samp>
 
| <samp>Texture</samp>
| ''(Optional)'' The asset name for the animal's spritesheet. Defaults to <samp>Animals/{{t|ID}}</samp> (like <samp>Animals/Goat</samp> for a [[goat]]). This asset must exist even if you use <samp>Skins</samp> below, since the default appearance is automatically an available skin.
+
| ''(Optional)'' The asset name for the animal's spritesheet. Defaults to <samp>Animals/{{t|ID}}</samp> (like <samp>Animals/Goat</samp> for a [[goat]]). This asset must exist even if you use <samp>Skins</samp> below, since the default appearance is automatically an available skin. See [[#Spritesheet layout|spritesheet layout]].
 
|-
 
|-
 
| <samp>HarvestedTexture</samp>
 
| <samp>HarvestedTexture</samp>
Line 251: Line 251:  
|-
 
|-
 
| <samp>UseFlippedRightForLeft</samp>
 
| <samp>UseFlippedRightForLeft</samp>
| ''(Optional)'' When the animal is facing left, whether to use a flipped version of their right-facing sprite. Default false.
+
| ''(Optional)'' When the animal is facing left, whether to use a flipped version of their right-facing sprite. See [[#Spritesheet layout|spritesheet layout]] for more info. Default false.
 
|-
 
|-
 
| <samp>SpriteWidth</samp><br /><samp>SpriteHeight</samp>
 
| <samp>SpriteWidth</samp><br /><samp>SpriteHeight</samp>
Line 285: Line 285:  
|-
 
|-
 
| <samp>UseDoubleUniqueAnimationFrames</samp>
 
| <samp>UseDoubleUniqueAnimationFrames</samp>
| ''(Optional)'' Whether the texture has two frames for the randomized 'unique' animation instead of one. Default false.
+
| ''(Optional)'' Whether the texture has two frames for the randomized 'unique' animation instead of one. See [[#Spritesheet layout|spritesheet layout]] for more info. Default false.
    
The unique animation sprite indexes are:
 
The unique animation sprite indexes are:
Line 388: Line 388:  
|}
 
|}
    +
==Spritesheet layout==
 +
===Explanation===
 +
Each farm animal's spritesheet must have exactly 4 columns, and at least 5–7 rows (depending on the data fields). The sprite size depends on the [[#Audio & sprite|<samp>SpriteWidth</samp> and <samp>SpriteHeight</samp>]] fields; for example, the default sprite width of 16 pixels means the spritesheet must be exactly 4 × 16 = 64 pixels wide.
 +
 +
The expected rows are:
 +
# move down;
 +
# move right;
 +
# move up;
 +
# move left ('''only''' if <samp>UseFlippedRightForLeft</samp> is false);
 +
# unique animations 1;
 +
# unique animations 2 ('''only''' if <samp>UseDoubleUniqueAnimationFrames</samp> is true);
 +
# eat.
 +
 +
For example, the default layout (with <samp>UseFlippedRightForLeft</samp> and <samp>UseDoubleUniqueAnimationFrames</samp> both false) is:
 +
{| class="wikitable"
 +
|-
 +
| 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)
 +
| 9 (move up)
 +
| 10 (move up)
 +
| 11 (move up)
 +
|-
 +
| 12 (''unused'')
 +
| 13 (unique down)
 +
| 14 (unique right)
 +
| 15 (unique up)
 +
|-
 +
| 16 (eat 1)
 +
| 17 (eat 1)
 +
| 18 (eat 1)
 +
| 19 (eat 1)
 +
|}
 +
 +
When both are true, that becomes:
 +
{| class="wikitable"
 +
|-
 +
| 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)
 +
| 9 (move up)
 +
| 10 (move up)
 +
| 11 (move up)
 +
|-
 +
| 12 (move left)
 +
| 13 (move left)
 +
| 14 (move left)
 +
| 15 (move left)
 +
|-
 +
| 16 (unique down 1)
 +
| 17 (unique down 2)
 +
| 18 (unique right 1)
 +
| 19 (unique right 2)
 +
|-
 +
| 20 (unique up 1)
 +
| 21 (unique up 2)
 +
| 22 (unique left 1)
 +
| 23 (unique left 2)
 +
|-
 +
| 24 (eat 1)
 +
| 25 (eat 1)
 +
| 26 (eat 1)
 +
| 27 (eat 1)
 +
|}
 +
 +
===Pre-1.6 vanilla layouts===
 +
Before Stardew Valley 1.6, there were two main spritesheet layouts depending on whether the animal lived in a [[barn]] or [[coop]]. If you want to match the previous spritesheet layouts (e.g. to update a pre-1.6 custom animal), the options to set are:
 +
<syntaxhighlight lang="js">
 +
// for barn animals
 +
"UseFlippedRightForLeft": true,
 +
"UseDoubleUniqueAnimationFrames": false
 +
 +
// for coop animals
 +
"UseFlippedRightForLeft": false,
 +
"UseDoubleUniqueAnimationFrames": true
 +
</syntaxhighlight>
 
[[Category:Modding]]
 
[[Category:Modding]]
    
[[ru:Модификации:Животные]]
 
[[ru:Модификации:Животные]]
translators
8,404

edits