-
Notifications
You must be signed in to change notification settings - Fork 19
2. Sprites
All the visuals for Fields of Mistria are small individual images known as "sprites". Whether it's a piece of clothing, a character walking around or a building they all refer to these sprite images in the game and they're all stored in the data.win file inside Fields of Mistria. If you want to see the sprites individually, you can open the data.win file with the UndertaleModTool to see how they're structured. MOMI uses a version of UndertaleModTool under the hood so UndertaleModTool isn't required to create or install sprite mods, only if you want to open them and view them yourself.
If you want to create or overwrite a sprite in a MOMI mod you'll need to create a JSON file in the sprites/ folder using the following schema:
{
"sprite_name": {
"Location": "imageLocation.png",
"IsAnimated": false
}
}The sprite_name that you define will be the ID of your sprite in FoM. If you define one that doesn't exist, a new sprite will be created and added to FoM while if you use an ID that's already in FoM then it'll overwrite that sprite with your own image. The Location should be from the top folder of your mod. For example, if your image is in mods/yourmod/images/sprite.png then you would use "Location": "images/sprite.png". Finally, IsAnimated defines whether your sprite is animated or not. Sprites that are animated should point to a folder of mods, while non-animated sprites should point to a single image.
Due to how MOMI imports sprites, your sprites should only be in .png format, other formats may break the install.
Some sprites, such as chests opening and closing, are sprites that are made up of a list of other images. For these instances, you should set IsAnimated to true and point the Location to a folder of sprites, not just a single image. In your folder, each image name should end in a number and the number should always be in ascending order. For example, if you're creating an animated chest opening, your JSON might look like this:
{
"spr_furniture_stone_storage_chest_spring_v1_opening": {
"IsAnimated": true,
"Location": "images/opening"
}
}While your files might look like:
mods/
├─ your_mod/
│ ├─ manifest.json
│ ├─ sprites/
│ │ ├─ my_sprite.json
| |
│ ├─ images/
│ │ ├─ opening/
│ │ │ ├─ frame 1.png
│ │ │ ├─ frame 2.png
MOMI will see that you've marked your sprite as being animated, will look into the images/opening/ folder and fetch all images in ascending order to use as the frames of the animation.
While the basics of a sprite just require an ID, Location and if it's Animated or not there's more information you can define alongside it. The full list of options are:
{
"sprite_id": {
"IsAnimated": false
"Location": "imageLocation.png",
"OutlineLocation": "outlineLocation.png",
"OriginX": 0,
"OriginY": 0,
"MarginLeft": 0,
"MarginRight": 0,
"MarginBottom": 0,
"MarginTop": 0,
"BoundingBoxMode": 2,
"IsPlayerSprite": false,
"IsUiSprite": false
}
}While the rest are optional, here's a quick rundown of what they are:
-
OutlineLocation: Depending on what the use of the sprite is, you may need a second sprite to act as the outline if the sprite appears in the player toolbar or in a store. If you need this, you can add the location of the outline sprite here and it'll be automatically added by MOMI. OriginX/OriginYMarginLeft/MarginRight/MarginTop/MarginBottom-
BoundingBoxMode: This should always be 2 -
IsPlayerSprite/IsUiSprite: When set totrue, this provides extra information to FoM that this sprite either belongs to the Player or is part of the UI
- You can see an example of sprite replacements in action with the files in Effe's Decor - Fridge.
- Every sprites of the game for 0.11.7 have been compiled and organized by Shugar here
- Sprites shown on-screen have a hierarchy in the order in which they appear. It is called Depth (to be verified).