General Mod structure
A mod consists of a description file as well as a number of things it adds to the game like objects, dioramas, localizations etc..
- To get started, have a look at the green tomato example which you can find in your save game folder under StreamingAssets/kubi.example.greentomato.
- The ModInfo.xml contains the base info about you (optional) and your mod (required). The format is quite simple, have a look.
- All things that your mod adds go into the respective subfolder. For example, a new diorama would go into dioramas/MyDiorama/MyDiorama.xml.
Creating objects, workshops, monsters etc.
In order to create a new object it is best to start with and copy an existing thing. E.g. if you want to make an ogre, you could copy the ObjectType/actors/Slime folder and rename everything to Ogre.
When restarting the game, the ogre should show up in the game.
Editing the VOX files
You can edit the voxel model by using a program like MagicaVoxel.
- Important: When making an animation, all frames need to have the same size setting, otherwise the game cannot import them correctly.
- Building models: The first frames of your voxel animation are the build frames, i.e. the different stages during construction. The frames after are the frames used for the animation when it is built or producing.
Editing the XML files
You can edit the object’s properties by editing the xml-file in a text editor. The documentation for what each field does can be found here.
In general, adding Info-blocks adds a new kind of behaviour or property to an object. For example, adding a MiningInfo allows your colonists to harvest it.
Some general remarks:
- Boolean values can be specified as 0 (false) or 1 (true)
- String[] values can be given as a comma separated list
- Colors can be given via hex code, e.g. #8EE45C
- Factions can be Player, Neutral or Enemy
- NumRange is a range of ints, e.g. 5:8
- Recipies have the format Input=Output=Time, e.g. 2*Log=WoodenBoard=16
This is a first draft so things are likely unclear or incomplete. If some information is missing, please contact me (info@bossconstructor.de) and I’ll add it for the next version!
Creating localizations (translations)
In order to create a new localization, do the following:
- Locate and go to your unity3d/Unity Technologies/Unity Labs/Kubifaktorium/.
- There you will find a file named LocalizationTemplate.txt.
- Create a folder StreamingAssets/Localization/[Your Language]
- Copy the template to that folder and name it [Your Language].txt
- Afterwards, you should be able to select your language in the settings menu. Note that changing it requires you to restart the game.
- Edit [Your Language].txt to fit your language. (the hard part…)
- Use _ to denote hyphenation-spots.
- Strings that are not translated will be taken from the fallback language you specify at the top of your language file.
- The next time you start the game, it will automatically create a Missing_[Your Language].txt file where all the strings are collected, which still require localization.
- In order to prevent duplicate work, it might make sense to post in the Discord channel (https://discord.gg/FMBQVmP) to maybe find someone to help out.
Creating map modifiers
Map modifiers influence the procedural map generation process. You can use these to make custom spawn groups and add new terrain types. For more info on each, have a look here.
- If you want to spawn something, e.g. an enemy camp, use CustomSpawnInfo.
- If you want to add a new terrain/biome, use TerrainInfo and ShaderInfo.
- If you want to alter an existing terrain, e.g. add more mountains, use TerrainModifierInfo.
- To set the map size, use MapSizeInfo.
- Use ModifierInfo to specify how your modifier can be used and how it is shown in the custom map setup screen.
Creating dioramas
Dioramas are small 8x8 scenes which are shown in the background of the main menu. Adding them is simple and does not require and coding or modelling.
- Start a normal game and make the scene for your diorama.
- When done, select the stockpile tool and mark an area while holding the control key.
- Anything outside the 8x8 range will not be in your diorama. Smaller dioramas than 8x8 are possible though.
- Your diorama is now saved to a new file in your save game folder, e.g. diorama1.xml.
- Create a new folder for your diorama in you StreamingAssets folder, e.g. StreamingAssets/DioramaInfo/MySheepDiorama and copy the saved xml file there. Rename the file to match the folder name, e.g. MySheepDiorama.xml.
- Done. Your diorama is now in the diorama pool and will be eventually shown. You can speed this up by deleting the premade dioramas.
- Note: There are some known limitations. Actors in dioramas will not move. Plants will always be fully grown.