-
Notifications
You must be signed in to change notification settings - Fork 2
Rules
Rules are the heart of the modding system. Everything from terrain to actors are defined by them. To see what kind of rules exist, visit the Documentation. Please note that the documentation is up-to-date regarding latest master. Therefore, make sure to use the latest version as well.
If you are modding on one of the releases, no problem! You can generate your very own documentation file by executing the DocWriter in the game directory. After that, a Documentation.html file should appear.
A rule is an interpreted line that looks like this:
examplerule@one=2
Rules are following one specific structure (where [] means the part in braces is optional):
<key>[@<specification>]=[<value>]
Rules are read into the game in the order they are declared (this also applies to the files where they are in). Also, in most cases rules need to be unique regarding their key and specification. While the key part of a rule is used to interpret its value, the specification can be chosen freely.
Rules can also have hierarchy. This is used to group rules together:
imaparent=
imachild@1=hey
imachild@2=hi
imachild@3=hello
Mods are packages that are loaded after the core game files are loaded. One problem is that the game has to know where files referenced by the package or the core game are. Therefore, every package has their own name, which can be used to give the game a clue where to look. In this example, we want to get myimage from the package mypackage:
image=mypackage|myimage
If you leave out the package, the core game assets will be searched for the image. Our generic structure for rules now looks like this (where [] means the part in braces is optional):
<key>[@<specification>]=[[<package>|]<value>]
Now you might wonder whether you can load assets and rules from other mods as well. Yes, you can! As long as that mod is loaded before yours. The loading order is determined by the sequence of string in the settings.yaml and can also be seen in the mod chooser screen.
