# The Creature Model

Each creature, whether added through content patcher or through a content pack, uses the same data format. This is the key to making a creature. Note that for content packs, all variables MUST be defined up until xSpriteSize. For Content Patcher mods, you can use the leave variables open to have them as default.

## The Key: The Creature's Code/Internal Name

This isn't the creatures display name, just their internal name. Use the same internal name as a creature in the base mod to replace it!

## The Values:

{% stepper %}
{% step %}
### rarity (Int, default is 0)

The creature's rarity is a number 0-4 where 0 is common and 4 is exquisite. This will add on the creature's rarity to it's description and determine the amount of experience received when caught. Very rare and exquisite creatures are not catchable until a certain amount of creatures are donated to the insectarium (Unless that creature uses a separate GSQ)
{% endstep %}

{% step %}
### grounded (bool, default is true)

This determines whether the animal will fly above its shadow or be on the ground. This should be set to true for creatures on trees, bushes and stumps generally.
{% endstep %}

{% step %}
### speed (float, default is 0.007)

This is a number for the relative speed of the creature when moving (Best between 0.001 - 0.01, where 0.001 is very slow and 0.01 is quite fast)
{% endstep %}

{% step %}
### pauseTime (int, default is 0)

A number representing how long (in milliseconds) the creature stops between movements.
{% endstep %}

{% step %}
### scale (float, default is 1.0)

This number is the relative scale of the creature (Below 0.8 removes the creature’s shadow, for creatures like ants, big creatures are typically around 3-3.5)
{% endstep %}

{% step %}
### doesRun (bool, default is true)

This determines whether or not the creature runs from the player. If dangerous is set to true this instead determines whether or not the creature chases the player.
{% endstep %}

{% step %}
### isMover (bool, default is true)

This determines whether or not the creature moves around
{% endstep %}

{% step %}
### range (int, default is 3)

The range in tiles for player detection, either running away or towards. Note that for dangerous creatures, once they spot the player their range is increased.
{% endstep %}

{% step %}
### dangerous (bool, default is false)

Whether or not the creature deals damage (if run is also true then the creature chases the player).
{% endstep %}

{% step %}
### seasons (List\<string>, no default, example "spring", "winter", "summer")

A list of strings which match the lowercase names of the seasons in which the creature should spawn. This shouldn’t even be only one season, repeat a season if needed. (winter, winter)
{% endstep %}

{% step %}
### weatherCode (string, default is "0")

A code which represents the weather the creature can spawn in.

Weather codes:

"0"-All weather,"1"-All sunny weather,"2"-All wet weather,"3"-Storms,"4"-Snow
{% endstep %}

{% step %}
### locations (List\<string>, no default, example "0", "0")

A list of codes representing locations the creature can spawn in, again this shouldn’t ever be only one location, repeat a location if needed (0,0)

Location codes:

0-All outdoor locations,

1-Forest Locations Includes "SecretWoods", "Forest", "Backwoods", "Woods", "Mountain", "Farm\_Forest", "NIVOuterInsec" and anywhere with >60 trees

2-Beachy / water locations Includes "Beach", "BeachNightMarket", "IslandWest", "IslandSouth", "IslandSouthEast", "IslandSouthEastCave", "Farm\_Beach" and anywhere with over 40% water),

3-Cave locations Includes "FarmCave", "Mine", "UndergroundMine", "BugLand", "WitchWarpCave", "SkullCave", "WitchSwamp", "MasteryCave", "IslandSoutheastCave" and floors in the mines divisible by 5,

4-Desert locations Includes "Desert", "SkullCave", "DesertFestival"

You can also just put the name of a specific location (Like “SeedShop” in the example mod)\
\
Location Custom Fields (Add these to custom fields in locations for unique effects):

* "Nature.NIV.OnlyExplicit": Creatures will only spawn in location if location name is explicitly used in the locations list, not "0" or such.
* "Nature.NIV.Forest": Location counts as a forest location for "1".
* "Nature.NIV.NotForest": Location never counts as a forest regardless of tree count.
* "Nature.NIV.Desert": Location counts as a desert location for "4".
* "Nature.NIV.Underground": Location counts as a cave location for "3".
* "Nature.NIV.Outside": Location counts as outside for "0" even if not an outdoors location.
* "Nature.NIV.Beach": Location counts as a beach for "2".
* "Nature.NIV.NotBeach": Location never counts as a beach for "2" regardless of water amount.
{% endstep %}

{% step %}
### minTime (int, default is 600)&#x20;

The time code which represents the time of day when the creature starts spawning.
{% endstep %}

{% step %}
### maxTime (int, default is 2600)

The time code which represents the time of day when the creature stops existing.
{% endstep %}

{% step %}
### frames (int, default is 4)

The number of frames per animation on their sprite sheet. Most animals use four, but this is fully customizable, and can sometimes help show unique animations/behaviours.\
[- see Making Creature Sprite for more details](../making-creature-sprite)
{% endstep %}

{% step %}
### spritePath (string)

The path for the texture of their sprite sheet (from earlier this would be Mods/NITVExample/Fly), but this is also customizable and depends on how you like to load your content! [- see Making Creature Sprite for more details](../making-creature-sprite)
{% endstep %}

{% step %}
### xShadow (int, default is 0)

The offset present in the x direction for their shadow. Generally values -10 to 10 are used to make it look centered.
{% endstep %}

{% step %}
### localSpawnCode (string, default is "0")

The local location / spawning code of the creature.

Local Location Codes:

"0"-Wandering,"1"-On trees,"2"-On Bushes,"3"-On Water,"4"-On large stumps.&#x20;

If you want to make your creature spawn through other means, set this so whatever fits description wise and set the "GSQ" to "FALSE" then use trigger actions to spawn your creature!
{% endstep %}

{% step %}
### yShadow (int, default is 0)

The offset present in the y direction for their shadow. Generally values -10 to 10 are used to make it look centered
{% endstep %}

{% step %}
### price (int, default is 100)

The relative price of the creature before multipliers. A moth for example is 50 which becomes 30ish unless the config for price is changed.
{% endstep %}

{% step %}
### spriteIndex (int, default is 0)

The sprite index of the creature’s item image; generally 0 but can change if you are adding multiple creatures with a single item sprite to share between them.\
&#x20;[- see Making Creature Sprite for more details](../making-creature-sprite)
{% endstep %}

{% step %}
### xDef (float, default is 60.0)

The X position in tiles of the creature’s position in the museum.
{% endstep %}

{% step %}
### yDef (float, default is 15.0)

The Y position in tiles of the creature’s position in the museum.
{% endstep %}

{% step %}
### itemTexture (string, default Mods\NatureInTheValley\Creatures\Items)

The path for the creature’s item texture. (from earlier this would be Mods/NITVExample/FlyItem)  [- see Making Creature Sprite for more details](../making-creature-sprite)
{% endstep %}

{% step %}
### displayName (string)

The twenty fifth is the creature’s display name.
{% endstep %}

{% step %}
### displayDescription (string)

The twenty fifth is the creature’s display description.

EVERYTHING AFTER THIS IS OPTIONAL IF USING CONTENT PACK
{% endstep %}

{% step %}
### xSpriteSize (int, default is 32)

The pixel width of each from in the creature's sprite texture.
{% endstep %}

{% step %}
### ySpriteSize (int, default is 32)

The pixel height of each from in the creature's sprite texture.
{% endstep %}

{% step %}
### GSQ (string, default is " ")

A [Game-State-Query](https://stardewvalleywiki.com/Modding:Game_state_queries) which serves as an additional spawn condition, leave as " " or "TRUE"  for no extra spawn condition. Use "FALSE" to disable nature spawning. Heres some other useful uses!\
\
ANY "SEASON Winter" "SEASON Spring, DAY\_OF\_WEEK Friday"&#x20;

Will mean a creature is able to spawn when it's either winter or it's a friday in spring.

FARM\_CAVE Bats, SEASON Summer

Will mean a creature is able to spawn when both the farm cave is of type bats and the season is summer.

LOCATION\_CONTEXT Here Island

Will mean a creature can only spawn in locations with the location context "Island"
{% endstep %}

{% step %}
### packSize (int, default is 1)

This is a number representing the max pack size of that creature. When naturally spawned, the game will try to spawn X many more nearby.
{% endstep %}

{% step %}
### rotaryAnims (bool, default is false)

Whether your creature will rotate its sprite to "face" the direction it is going while moving. Only really applicable for "top down" moving creatures. The sprite sheet should have duplicate animations as if the creature is "facing" right.
{% endstep %}

{% step %}
### complexIdling (bool, default is false)

Whether the creature has complex idling animations. Instead of there being a single frame per idling direction, each direction has its own idling animation. When making the art this essentially means that you have 9 lines for complex  anims or 5 lines for noncomplex, 1 line for each moving animation, 1 line for each idling animation, 1 line for running away.
{% endstep %}

{% step %}
### friendlyFollower (bool, default is false)

When set to true, the creature will follow the player as long as they are within the given playerRange, and doesRun is set to true. The behavior right now is that they will follow the player until they are within 128pixels (About 2 tiles), before using regular movement AI.
{% endstep %}

{% step %}
### dangerDamage (int, default 25)

The amount of damage done if creature is dangerous.
{% endstep %}

{% step %}
### health (int, default 0)

If 0 and dangerous, sword swings will cause creature to run away. If more than zero the creature is caught once their health reaches zero.
{% endstep %}

{% step %}
### forceSword (bool, default false)

if true, removes the ability for the net to catch this creature. (Should only really be true if dangerous and health > 0)
{% endstep %}

{% step %}
### cueName (string, default "")

the string for the ambient sound effect that the creature makes when nearby.
{% endstep %}

{% step %}
### variantList (List\<string>, default empty)

List of textures which have a possibility to replace the default sprite.
{% endstep %}

{% step %}
### variantChance (float, default 0.1)

Chance (1=100%) that any given variant is chosen, this chance will be checked for each variant.
{% endstep %}

{% step %}
### alternativeDrop (string, default "")

The qualified item id of the alternative item to drop when caught.
{% endstep %}

{% step %}
### onlyAlternativeDrop (bool, default false)

If set to true the creature will only drop their alternative item and not the creature item.
{% endstep %}

{% step %}
### alternativeDropChance (float, default 1)

The chance (1 =100%) that the alternative drop would be chosen.
{% endstep %}

{% step %}
### isTerrariumable (bool, default true)

Whether this creature can be made into a terrarium.
{% endstep %}

{% step %}
### isDonatable (bool, default true)

Whether this creature can be donated to the insectarium / if it should show up in the encyclopedia.
{% endstep %}

{% step %}
### semiAquatic (bool, default false)

Whether creature can move both on land and water, requires unique sprite sheet.
{% endstep %}

{% step %}
### soundRange (float, default 500)

Range in which sound plays
{% endstep %}

{% step %}
### soundFrequency (int, default 1150)

Frequency with which sound plays
{% endstep %}

{% step %}
### useBetterCreatureBounds (bool, default false) RECCOMENDED!!!

Whether to use the new advanced creature bounds logic for the "z" location of creatures and hitbox.
{% endstep %}

{% step %}
### displayedLocation (string, default empty)

String to display in encyclopedia for location, if different than automatic display.
{% endstep %}

{% step %}
### displayedLocalLocation (string, default empty)

String to display in encyclopedia for local location, if different than automatic display.
{% endstep %}

{% step %}
### secondStartTime (int, default 0)

Start for a second period of spawning for creature.
{% endstep %}

{% step %}
### secondEndTime (int, default 0)

End of a second period of spawning for creature.
{% endstep %}

{% step %}
### variantGSQs (List\<string>, default empty)

GSQs validating the use of different variants.
{% endstep %}

{% step %}
### extraDescription (string, default empty)

Additional description to display in encyclopedia.
{% endstep %}

{% step %}
### itemDropItemIds (List\<string>, default empty)

Should be same length as other lists in group. Represents the possible items to give player.
{% endstep %}

{% step %}
### itemDropItemChances (List\<float>, default empty)

Chance for each item in itemDropItemIds to be picked, as a float from 0 - 1.
{% endstep %}

{% step %}
### itemDropOnlyItemBools (List\<bool>, default empty)

Whether each item in itemDropItemIds should cause the base creature item to not be given.
{% endstep %}

{% step %}
### itemDropExclusiveItem (List\<bool>, default empty)

Whether each item in itemDropItemIds should be the only item from that list given if picked.
{% endstep %}

{% step %}
### consistentSoundFrequency (bool, default false)

Whether the sound's "frequency" should be consistent (aka: the duration between sound effects is always the same instead of being semi random)
{% endstep %}

{% step %}
### compelxAnims (bool, default is false)

Whether the creature has complex animations. Complex animations mean the creature will have up and down walking animations, as well as a separate frame for when they are not moving per direction. (Example a snake could be coiled up between movements, then uncoiled when moving) [- see Making Creature Sprite for more details](../making-creature-sprite)
{% endstep %}
{% endstepper %}
