Mods: Difference between revisions

From The Colonists
Jump to navigation Jump to search
Line 34: Line 34:
=Codex=
=Codex=
==Base Codex File==
==Base Codex File==
 
You can download all of the base json files from this Github repository: https://github.com/codebyfire/colonists-base-codex
(OLD) Generate default files using the '''Export Base Codex''' button in the Mod Manager window. <br>
Note: if you're using the development branch of the game, check the dev branch of the repository for the latest dev-compatible versions.
Note this has been superseded by the repository on GitHub: <br>
https://github.com/codebyfire/colonists-base-codex


==Codex Objects==
==Codex Objects==

Revision as of 22:41, 6 January 2023

This section is a work in progress!

Setup

Creating a mod

  1. If it doesn't already exist, create a Mods folder inside %userprofile%\appdata\LocalLow\Codebyfire Ltd\The Colonists\
  2. Create a folder for your mod inside the Mods folder, e.g. MyAmazingMod
  3. Everything then goes inside MyAmazingMod. You can use subfolders to organise content or keep it all in the main directory, the mod loader in the game will just look at the name of the file to determine what it is.

Steam Workshop Integration

  1. With a new mod placed in the folder %userprofile%\appdata\LocalLow\Codebyfire Ltd\The Colonists\Mods start The Colonists
    1. Selecting Mods from the main menu will show 2 options:
      1. Workshop Subscribed and unsubscribed Mods on the Steam Workshop - Subscribe/Unsubscribe to Mods here
      2. My Mods Published and unpublished Mods in your local folder - Publish/Unpublish your mods and Workshop visibility here
  2. There should now be 2 files within the %userprofile%\appdata\LocalLow\Codebyfire Ltd\The Colonists\Mods folder of your mods
    1. meta.json - enter the Mod Title and Description for Steam Workshop in this file
    2. thumbnail.jpg - the image file for the mod on Steam Workshop and Mod Panel (a default will be provided if omitted).
  3. When a Mod is published the file PublishedFileId.txt containing the Mod ID will be created
  4. Subscribed mods will be in the folder ``C:\Program Files (x86)\Steam\steamapps\workshop\content\677340\0123456789`` `where 0123456789` is the Mod ID
    1. The Mod ID can be found in 2 places:
      1. In the Published FileId.txt file in the local mod folder
      2. In the link to the mod on the workshop from the Mod Manager interface. e.g. "/filedetails/?id=0123456789"

Enabling mods

  1. Enable mods in either Sandbox, Random Map, or when creating a new Custom Map
    1. Sandbox - "Active Mods" will open Mod Manager with Available and Workshop tabs for activating mods.
    2. Random Map - "Active Mods" will open Mod Manager with Available and Workshop tabs for activating mods.
    3. Custom Map - "Active Mods" available when creating a new Custom Map, will open Mod Manager with Available and Workshop tabs for activating mods. Note that you cannot change active mods once the map has been created. Also note that while local mods can be selected for testing, maps containing local mods can not be published to the Steam Workshop. Published Custom Maps with mods will include the mod(s) for subscribers.
  2. When a game is started all selected mods will be activated and their content processed, i.e. json files, images etc.
  3. All activated mods for the current game are listed in the Info panel which accessed in the top left of the screen.

Hot Reloading

If you're using a local mod, you can update the contents of your mod and then reload the mod mid-game using the 'Reload' button in the Info panel. This is intended as a mod development aid to quickly iterate on certain changes. Be careful though! Some things may go wrong when reloading the codex mid-game, depending on the changes you make! For example, removing a building or resource may not go down well.

Codex

Base Codex File

You can download all of the base json files from this Github repository: https://github.com/codebyfire/colonists-base-codex Note: if you're using the development branch of the game, check the dev branch of the repository for the latest dev-compatible versions.

Codex Objects

Note many objects can be disabled in their main json file. see DisabledObjects

Scripting (C#)

Text/Localisation

Building, Structure, and LandRoute footprint rendering

The render.json file can be used to change, or define, the building, structure, and track footprint shown when they are placed. And the rendering of Tree Fields, Plantable Fields, and the color of Terrain Types and Detail Types on Terrain Types. And the use of colliders by units on building floors.


AnimalField, PlantableField, and TreeField footprint can be controlled in render.json

Summary of files recognized as valid in mods and their naming convention.

Example Mods

Custom Building

Custom Natural Resource

Custom Techs

Custom Land Route

Custom Bot Materials

Custom Terrain Types

Unity Project Example Assets

Example Assets Unity Project