-
Notifications
You must be signed in to change notification settings - Fork 8
Merge By ID
Most of the items in the game's library are identified by a numeric ID rather than a human-readable name. The modloader will use these ID numbers to merge the XML nodes into the game's data files. These nodes are replaced wholesale, so you must include the ENTIRE node you're replacing or adding.
If you're adding new items it's recommend to prefix your definition IDs with your Discord user number (e.g. #4511) and a sequential mod number (e.g. 00
for the artificial-plant
example, 01
for exterior-air-vent
, etc) to come up with something reasonably unique, e.g. 451102000
for the Monster Meat crop recipe in the greenhouse
example (and then 451102001
for the next ID in that mod, 451102002
for the one after that, etc etc).
Within your mod, any files that start with a compatible file prefix in the library/
folder will be loaded as xml and merged into the relevant file. For example, haven_MyModData
will be merged into haven
.
If you want to replace an existing game definition, like the included Greenhouse mod does, simply copy that definition into to your mod with the same ID number that the game uses. The mod loader will replace the game's definition with the one from your mod.
If you want to create a new definition, things get a bit trickier because you need to make sure your ID numbers are unique across all mods that might get loaded. Luckily IDs can be any (positive) 32-bit integer which means there's lots of space.
In BOTH cases, any of the surrounding XML must be included as well (this means an <me>
tag for a new or existing buildable must be surrounded by both
<data>
and <Element>
tags).
-
library/haven
- (almost) all nodes
-
library/animations
-
animations
(Identified byn
attribute)
-
-
library/textures
-
t
andre
nodes (Identified byi
andn
attributes respectively)
-
-
library/texts
-
t
nodes
-