-
Notifications
You must be signed in to change notification settings - Fork 19
1.1: MOMI Operations
Provided by pixie (@caterpixie)
MOMI actions/operations are only needed in these specific situations:
- Deleting something that exists in the vanilla files
- Editing one specific entry inside a list
- Adding items to a list that's already on an entry, without wiping out what's already there
- Removing just a few values from a list, without clearing the whole thing
You do not need MOMI actions for:
- Adding a brand new table or sub-table without replacement
- Changing the value of a key-value pair
- Find the thing you are looking to change in the files
- Look at the entry you are trying to change and determine if its a table, array of tables, or an inline list.
- Find the guide below based on the type of entry.
| Name | Description | Example |
|
Table |
A named entry inside single brackets. It can contain sub-tables and key/value pairs |
[march_two_hearts] # table
speaker = "march" # key/value pair
local = "go away nerd"
[march_two_hearts.2] # sub-table
speaker = "olric"
portrait = "sad" |
|
Key/value pair (also called a field) |
A single line within a table |
speaker = "march" |
|
Array of tables |
A repeatable list, written inside double brackets. Each block is one entry inside the list, and they have identical names, therefore no way to tell them apart other than their fields |
[[cop_some_ore.stages]] # first entry
objective_description = "Bring March some copper ore."
requirements = { has_item = { ore_copper = 3 } }
[[cop_some_ore.stages]] # second entry
objective_description = "Bring March some more copper ore."
requirements = { has_item = { ore_copper = 10000 } } |
|
Inline list |
A list written all on one line. |
requires = [
{ npc = "march" },
{ march_heart_level = 2, comparator = ">=" },
{ march_heart_level = 6, comparator = "<" }
] |
No MOMI action is needed. Simply write what you want to add and it will be appended to the vanilla files.
No MOMI action is needed. Write the name of the table that the key/value pair is in that you are changing. Under this, write the key being changed + the new value.
# VANILLA
[adeline_keeps_me_busy]
refresh = "1y"
requires = [
{ npc = "march" },
{ march_heart_level = 6, comparator = "<" }
]
portrait = "sigh"
local = "I'd have more time for real pieces if Adeline didn't keep me so busy making nails and joints..."
next = "1"
# Mod that changes March's portrait
[adeline_keeps_me_busy]
portrait = "neutral"Write the name of the table you want to remove and add MOMIaction = "remove" underneath the table name. You don't need to repeat any of its other key/value pairs.
[adeline_keeps_me_busy]
MOMIaction = "remove"Currently, a single key/value pair cannot be removed using MOMI actions. You can only edit the value or add on new ones. One way to bypass this is to use MOMIaction = "remove" on the entire table and re-writing it with a new name
Inline tables are edited in the exact same way as key/value pairs inside a table. This means new ones can be added, and its contents can be edited/added to without needing MOMIaction or MOMIidentify.
With this said, it has the same limitations as key/value pairs, meaning that you cannot remove an inline table. To remove entries from an inline table, the only option is to rewrite the entire table without that value so that it overwrites the vanilla table.
Since entries in an array of tables don't have names to distinguish each entry, you use MOMIidentify to specify which entry you are trying to edit/apply an action to. MOMIidentify must be placed directly under the name of the entry you are changing
No MOMI action is needed. Simply write what you want to add and it will be appended to the vanilla files. You just need to make sure that the entry has the same name as the other ones.
[[general.categories]]
icon = "spr_ui_store_category_icon_seeds"
constant_stock = [
"seed_new_modded_example"
]Add MOMIidentify right under the category name, and indicate the category icon you are wanting to change. Directly below this, rewrite the key/value pair that you want it to be edited to. You can explicitly write MOMIaction = "replace" or not; leaving it empty will default to replacing.
[[general.categories]]
MOMIidentify = { icon = "spr_ui_store_category_icon_seeds" }
constant_stock = [
"seed_new_modded_example"
]
MOMIaction = "replace" # optional for replacementsAdd MOMIidentify right under the category name, and indicate the category icon you are wanting to add to. Directly below this, write the key/value pair that you to add. Underneath this new key/value pair, indicate the action as MOMIaction = “merge”
# Finds the category by icon and adds your item to its existing constant_stock, leaving what was already there in place.
[[general.categories]]
MOMIidentify = { icon = "spr_ui_store_category_icon_seeds" }
constant_stock = [
"seed_new_modded_example"
]
MOMIaction = "merge"Add MOMIidentify right under the category name, and indicate the key/value you are wanting to edit. Directly below this, write the new key/value pair.
# Finds the category by its old icon and changes it to a new one.
# Note this will cause compatibility issues if two mods try to change the same category
[[general.categories]]
MOMIidentify = { icon = "spr_ui_store_category_icon_seeds" }
icon = "spr_ui_store_category_icon_materials"Add MOMIidentify right under the category name, and indicate the category icon you are wanting to remove. Underneath, indicate the action as MOMIaction = “remove”
# Removes the entire category
[[general.categories]]
MOMIidentify = { icon = "spr_ui_store_category_icon_seeds" }
MOMIaction = "remove"Add MOMIidentify right under the category name, and indicate the category icon you are wanting to edit. Under this, use MOMIremove to indicate the items that you want to remove from the list.
This is particularly useful for mods that might want to remove all vanilla items from a store category and replace them with their own modded items. If two modders both wanted to do this, specifically removing every individual vanilla item from the stock would allow their mods to be compatible with each other, whereas both attempting to remove the category and replace with their own would result with only one of the mods' stock in store.
# Finds the category and removes only those two specific items from
# constant_stock, leaving everything else in the list untouched.
[[general.categories]]
MOMIidentify = { icon = "spr_ui_store_category_icon_seeds" }
MOMIremove = { constant_stock = ["seed_old_vanilla_example_v1", "seed_old_vanilla_example_v2"] }