Modding/mod.rules

From Cosmoteer Wiki
Jump to navigation Jump to search
Code location (what's this?): Cosmoteer.Mods.ModInfo

The main entry point to your mod. When creating in mod, you define a special mod.rules file that provides the definition of your mod and the specific actions you want to take.

All mods need it, and some types of mod can contain just this one file.

Also known as ModInfo in the source code, it contains the following fields :

mod.rules
Property Syntax Required Description
ID ID = author_name.mod_name Yes Every mod must have an ID that is used to uniquely identify the mod and differentiate it from other mods. In order to avoid ID conflicts with other mods, you *must* follow the "author_name.mod_name" format. Do *not* use "cosmoteer" as your author name -- that is reserved for official mods only!
Name Name = "My Mod Name" Yes You must give a human-readable name for your mod. This is what will be shown in the user interface.
Version Version = 1.0.0 - The version of the mod that will be shown in the user interface.
CompatibleGameVersions CompatibleGameVersions = ["0.20.27"] Yes This is a list of Cosmoteer versions that this mod is known to be compatible with. If this mod is turned on and it isn't known to be compatible with the version of Cosmoteer that the player is running, a warning will be displayed. When upgrading the game, mods that aren't known to be compatible with the new version will also be automatically disabled.
ModifiesGameplay ModifiesGameplay = true - This should be set to true for any mod that makes gameplay changes that could affect multiplayer games. Setting this to false *MAY* make it possible to play with someone else who doesn't have this mod, so long as this mod doesn't actually make any gameplay changes. (Setting this to false will *NOT* magically allow you to play with someone who doesn't have this mod; it will just make the error less informative.) If omitted, the default is true.

Was renamed from ModifiesMultiplayer in 0.24.0 update.

Author Author = "Your Name/Handle" - The name of the mod creator(s) that will be shown in the user interface.
Logo Logo = "logo.png" - A logo to display for your mod in the user interface. If you specify one, the logo.png file must be in the same directory as the mod.rules file.
Description Description = "Description here" - A longer description of what your mod does to the game. See the example_mod mod.rules file for how to add multiple lines.
StringsFolder StringsFolder = "strings" - Mods can define their own per-language string files. The values in a string file (such as en.rules) will add to and override any values in the base string file (such as Data\strings\en.rules). Each language supported should have its own string file named after the two-letter 639-1 language code for that language. Strings can also be used to provide in-game lore.
ShipLibraries this is of type ModInfo.ModShipLibrary[]? - Presumably, this is the list of ships that go with your mod, if for example you're adding a faction.

Limitations

It is worth noting that there are a few files you're not allowed to change. Trying to do so will result in an error.

List of unauthorized files

((TBA))

Modifying another mod

Sometimes, for compatibility or synergy, you may want to modify what another mod does.

You can use an Action like this one :

AddTo = "<C:/Users/###/Saved Games/Cosmoteer/STEAM ID/Mods/MOD NAME/RULES FILE NAME.rules>/IN-FILE PATH"

Replace the parts in capital letters with the appropriate ones for your case.

Disabling a part from another mod.

One way is to Add a IsBuildable = false to it to make it illegal.