This post is a quick guide for how to get into modding in Objects in Space.
Mod support has only been tested with a few simple mods so far, but it’s a fairly simple concept so we hope it won’t run into too many issues.
Mods sit in the ObjectsInSpace/mods folder, which is created by default every time you run 0.9.9
Here’s how it works:
Once the engine is loaded, the first thing that happens is the file ‘objectsinspace.txt’ is checked. This is a master file containing a number of ‘include’ statements, which in turn include all the game data for the game. These are all human-readable (browse them for yourself and see), and kept (for now at least) loose and easily accessible in the ‘assets’ folder.
When a mod is loaded, after the main objectsinspace.txt file is loaded, the file ‘include.txt’ is also loaded.
Mods are used as search paths for the game’s native files in lieu of the ones in the main assets folder. So, for instance, if you wanted to replace all the reactor modules with your own, you can replace the modules_generators.txt file with your own in the mod, and that file will be loaded in place. In this way you can not just add, but remove/replace game content with your own.
The same goes for art assets.
The other file which matters for mods is the internal description file - modinfo.txt. This contains the name, a mod version, the required OiS version, and whether or not the mod is enabled.
The contents of a sample modinfo.txt are this:
For now, you will have to look into the game’s log files to see which mods are detected and loaded, but in the coming weeks I hope to add a segment of the Options screen to show the status of any loaded mods.
There are limitations to mods in Objects in Space, as the game does not use a scripting engine for game logic. The result is that you can alter any of the myriad stats for ships, modules, components, stories, star systems and the like, but the core mechanics of how the game functions are effectively hard-coded.
Share any first attempts at mods with us and we’ll help you iron out the kinks!
Have fun customising!