COMPACT FURNITURE BASICS
The user handles furniture offsets personally. Do not calculate, change, or tune furniture-item offset, depth_offset, or related placement offsets unless the user explicitly requests it. The examples below are reference material only.
Compact installation for furniture items
This is a streamlined version of the vanilla way of adding custom items into the game. This system relies on MOMI generating most of the required values.
The folder structure
+---compact-furniture
| to register your mod in MOMI
| manifest.toml
|
\---fiddle
| to add your recipe or item to a store
| stores.toml
|
\---momi
\---furniture
\---images
| \---objects
| | objects, shadows, and previews go here
| | these are just examples
| | spr_<furniture_name>_south.png
| | spr_<furniture_name>_south_shadow.png
| | spr_<furniture_name>_east.png
| | spr_<furniture_name>_east_shadow.png
| | spr_<furniture_name>_preview.png
| |
| \---ui
| item and category icons go here
| spr_ui_item_<furniture_name>.png
| spr_ui_item_<furniture_name>_outline.png
|
\---items
| to define the item properties of your furniture
| mod_name_items.toml
|
\---objects
| to define the object properties of your furniture
| mod_name_objects.toml
|
\---sprites
| optional - to adjust sprite properties
| mod_name_sprites.toml
|
As we can see above, we have the main mod folder, which is compact-furniture for the purposes of this guide. This is where we store all our files needed for our mod. The only loose file in this main folder, or root folder as it's usually called, is manifest.toml.
The manifest
This file is needed to let MOMI register the mod in its installation process.
name = "mod name"
author = "your name"
version = "mod version, example 1.0.0 or v1.0 - doesn't have a strict format"
minInstallerVersion = "latest MOMI version, to be safe"
The momi folder
The bulk of the mod. This is where we put our sprites, define our furniture, and adjust their functionality and placement in the game. Since we're working with furniture items in this guide, the nested momi folder we'll be using is called furniture.
The furniture\images folder
spr to indicate that the image is a sprite.The images folder is where we'll put the furniture sprites. It's separated into images\objects and images\ui, which are rather self-explanatory. The objects folder is where we put the sprites of the furniture and shadows plus the preview images for the crafting menu and the ui folder is where we put object icons, custom store category icons and custom scroll icons.
objects folder if it's a UI element?We do not know.
The furniture\images\objects folder
For objects, shadows, and crafting menu preview images.
Let's go over further file naming conventions.
There are several things to keep in mind, the prefix spr, the furniture name and the additional appendixes a sprite can have, such as _cardinal direction, which then together form the specific sprite id.
The furniture name is more of a 'soft' convention, it should contain your author name (or a shortened version of it) and the name of furniture you are working on i.e ari_dining_table.
The advice is to keep it the same across all the related sprites, as well as your object id and item id, which we will talk about later.
The _cardinal direction is as you might have guessed, to distinguish the sprites for the rotations of your furniture. The game allows for only FOUR rotations, and that's it.
However, a neat trick is to use rotations to have variations on your base sprite instead! So you do not need to use _cardinal directions in your sprite name, as long as you name them differently.
The default rotation used by vanilla is usually _south, which is when the sprite faces the player. _north sprite faces backwards. _east and _west sprites face to the side and are mirrored by default if _west is absent, but can also be defined separately. You are not obliged to have any in particular, as long as you are obviously defining at least one of the cardinals.
Other examples of vanilla appendixes are as follows : _top, _on, _spring/winter, _opening, etc. They each belong to a different type of furniture, and if you want to learn more, check out the wiki hosted on MOMI's GitHub page.
\---momi
\---furniture
\---images
| \---objects
| | spr_<furniture_name>_east.png
| | spr_<furniture_name>_south.png
| |
We can see here the file names start with the spr prefix, as they are sprites, and we used the <furniture_name> as our naming convention. The file names end with cardinal direction to indicate object rotations.
We will extend the above naming convention for shadows. Append shadow to the file names.
\---momi
\---furniture
\---images
| \---objects
| | spr_<furniture_name>_east_shadow.png
| | spr_<furniture_name>_south_shadow.png
| |
Crafting menu previews don't need rotations so just append preview to the <furniture_name> or whatever you're using as your sprite file name.
\---momi
\---furniture
\---images
| \---objects
| | spr_<furniture_name>_preview.png
| |
images\objects folder will look like this by the end:\---momi
\---furniture
\---images
| \---objects
| | spr_<furniture_name>_east.png
| | spr_<furniture_name>_east_shadow.png
| | spr_<furniture_name>_south.png
| | spr_<furniture_name>_south_shadow.png
| | spr_<furniture_name>_preview.png
| |
sprite ids. When the code asks you for a sprite, you need to copy the name exactly as you wrote it for it to work. Do not include the .png part!The furniture\images\ui folder
For UI icons.
This includes the small images on the left of the crafting and store menu, plus the small image that pops out when Ari picks a furniture.
Let's go over further file naming conventions. This will be simpler, as we have only two things to consider, the icon itself and the icon outline.
\---momi
\---furniture
\---images
| \---ui
| spr_ui_item_<furniture_name>.png
| spr_ui_item_<furniture_name>_outline.png
|
You can see from the example that we append _ui_item at the front of the file name for the icon, as that is how the game handles it. Similarly to the preview file name append, for the icon outline we only need to add _outline to the end of the icon file name, and MOMI will handle the rest for you.
\---momi
\---furniture
\---images
| \---objects
| | spr_<furniture_name>_east.png
| | spr_<furniture_name>_east_shadow.png
| | spr_<furniture_name>_south.png
| | spr_<furniture_name>_south_shadow.png
| | spr_<furniture_name>_preview.png
| |
| \---ui
| spr_ui_item_<furniture_name>.png
| spr_ui_item_<furniture_name>_outline.png
|
The furniture\items folder
This is where we define the item properties of your furniture, meaning information you would see when you are interacting with it in a menu, like name/description/price etc.
[<furniture_name>_item_id]
name = "Furniture Name"
icon_sprite = "spr_ui_item_<furniture_name>"
description = "Furniture Description"
value = { bin = "self.recipe * 1.1", store = 20 }
tags = [
"furniture",
"unlock_set_tag",
"additional_tag",
]
object = "<furniture_name>_object_id"
recipe_key = "unlock_set_tag"
recipe_is_default = true
crafting_preview_sprite = "spr_ui_menu_<furniture_name>_preview"
crafting_level_requirement = 1
recipe = [
{ count = 1, item = "ore_stone" },
{ hours = 0, minutes = 10 },
]
Let's unpack the two id keys.
<furniture_name>_item_id is what the game recognizes our furniture as. This is what MOMI refers to to write into the game's toml files pertaining to the furniture details like UI elements, tags, and labels.
<furniture_name>_object_id is what the object.toml will refer to when adjusting the furniture's physical properties. This can have the same name as furniture_item_id, and we encourage it.
These are the major keys that will be referred to by MOMI and the game. KEEP THEM CONSISTENT.
The furniture details
[<furniture_name>_item_id]
name = "Furniture Name"
icon_sprite = "spr_ui_item_furniture_sprite_id"
description = "Furniture Description"
value = { bin = "self.recipe * 1.1", store = 20 }
tags = [
"furniture",
"unlock_set_tag",
"additional_tag",
]
nameanddescriptionare UI labels for the in-game menu.- Point the
icon_spritekey to the furniture icon in theimages\uifolder. - The
valuekey determines an object's monetary value. There are two parameters for thevaluekey,binandstore.
3a.bincalculates the amount of tesserae we receive after selling items via the shipping bin.
3b.storedetermines the item's value in the game's stores. We can't sell things directly to stores. tagsare used to organize items in the menu. All furniture has thefurnituretag. Custom furniture need a uniqueunlock_set_tagfor recipe purposes. We may also add a vanilla tag if we're adding into a vanilla set.additional_tagare useful to put your furniture in the other more specific tabs, like tables or lamps, and it can have more than one. All furniture without aset_tag, custom or vanilla, will be categorized asotherin the crafting menu.
object = "<furniture_name>_object_id"
As we mentioned before, the most important part. Without this, the game will not know to connect the two pieces of code and your furniture will not be able to exist as an object in the overworld.
The furniture recipe
recipe_key = "unlock_set_tag"
recipe_is_default = true
crafting_preview_sprite = "spr_ui_menu_<furniture_name>_preview"
crafting_level_requirement = 1
recipe = [
{ count = 1, item = "ore_stone" },
{ hours = 0, minutes = 10 },
]
- Custom
recipe_keyneeds the sameunlock_set_tagwe used fortags, also for recipe purposes. Non-craftable furniture don't need this key. - Furniture will unlock at new game with
recipe_is_default = true. Set tofalseto unlock only with recipe scrolls. - Point the
crafting_preview_spritekey to the furniture preview in theimages\objectsfolder. Optional, best used for fences and other bulkier furniture. crafting_level_requirementto set the required level to craft the furniture. Max is 60.- There are two parameters for
recipe,item/countandhours/minutes. The game does not accept0forcountvalue.hoursandminutesaccept0value.
5a. To use essence for our recipe, changecount = 1, item = "ore_stone"toessence = 1.
The furniture\objects folder
We take the furniture defined in items.toml and add properties and the sprites here so it can exist as an object in the game.
[<furniture_name>_object_id]
size = [4, 2]
collision_grid = "1"
depth_offset = -16
[<furniture_name>_object_id.south]
sprite = "spr_<furniture_name>_south"
offset = [16, 40]
[<furniture_name>_object_id.east]
sprite = "spr_<furniture_name>_east"
offset = [16, 40]
These are the least amount of code we need for our furniture to show up properly in the game.
Remember the <furniture_name>_object_id we defined in the items.toml? This is where it comes to play. Let's examine the header keys.
The general sprite
[<furniture_name>_object_id]
size = [4, 2]
collision_grid = "1"
depth_offset = -16
sizeis the object's hitbox, visualized by white borders we see when we place objects in the world. Each unit here is referring to a half a tile in game, so 8px. So a default tile size is 2,2. Keep that in mind!- Use
collision_gridto define object collisions. There are three values.
2a. Put0to disable collision for the object entirely.
2b. Putting1will let Ari jump over the object (eg, fences).
2c. While2means Ari won't be able to pass the object at all. depth_offsetdeals with sprites overlaying characters. Set the value in pixels if the furniture sprite covers Ari/NPCs in the game.
The cardinal sprite
[<furniture_name>_object_id.south]
sprite = "spr_<furniture_name>_south"
offset = [16, 40]
[<furniture_name>_object_id.east]
sprite = "spr_<furniture_name>_east"
offset = [16, 40]
- The
spritekey points to the sprite image inimages\objectsused for the rotation. - The
offsetvalue, adjust this to line up your sprite with the hitbox the game generates.
2a. Without going too much into it, MOMI generates something we call the anchor point in the bottom middle of the sprite canvas for us. So to extrapolate theoffsetvalue, you will need to determine where on the canvas you want your hitbox to sit, and then calculate the distance in pixels between the hitbox's top left corner and this previously mentioned anchor point.
The furniture\sprites folder
[furniture_sprite_id_cardinal]
frame_size = [x, y]
[furniture_sprite_id_shadow]
frame_size = [x, y]
frame_size is the size of your individual frames in your animation strip.
You can either check the size of a non animated sprite of the same furniture for the values, or extrapolate it from the size of the canvas of your animation strip (x px/no. of frames, y px).
\---momi
\---furniture
\---items
| mod_name_items.toml
|
\---objects
| mod_name_objects.toml
|
\---sprites
| mod_name_sprites.toml
|
The fiddle folder
To write into the game's stores.toml. In other words, to add our items into in-game stores.
[[general.categories]]
MOMIidentify = { icon = "spr_ui_store_category_icon_furniture" }
MOMIaction = "merge"
constant_stock = [
"<furniture_name>_item_id",
{ crafting_scroll = "<furniture_name>_item_id" },
]
For this guide, we are adding the items into a vendor's existing category. There are some things to explain here;
[[general.categories]]means we will be putting our items in the general store. The vanillastores.tomlhas the information for all vendors.- We are adding it to
constant_stock, meaning the vendor will always have the item, butrandom_stockis also an option for a randomized pool. MOMIidentifyandmergeare MOMI actions.MOMIidentifyis meant to find the category we are adding our items to, and by usingMOMIaction = "merge"beforeconstant stockwe're making sure that our items get added into the store's item pool.