Mods: Difference between revisions

From The Colonists
Jump to navigation Jump to search
updating building floor footprint to new file (e.g. buildingfloor_201_L2.png)
No edit summary
Line 68: Line 68:


=Building, Structure, and LandRoute footprint  rendering=
=Building, Structure, and LandRoute footprint  rendering=
The [[ModRender|'''render.json''']] file can be used to change the building, structure, and track footprint shown when they are placed.<br>
The [[ModRender|'''render.json''']] file can be used to change, or define, the building, structure, and track footprint shown when they are placed.
<s>The file '''floor_buildings.png''' contains the graphics for the current buildings, structures, and tracks</s> obsolete.<br>
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.<br>


<s>The file '''floor_base.png''' can be used to modify buildings, plots, and tracks with ID under 200 (existing)</s> obsolete<br>
<s>The file '''floor_extra.png''' can be used to modify buildings, plots, and tracks with ID over 200 (new)</s> obsolete<br>


Building footprints are 128 x 128 pixels for each tile with 0,0 being in the bottom left.<br>
'''buildingfloor_201_L2.png''' would contain the floor for building of ID=201 at level=2.<br>
Structure footprints are a 68 x 68 tiled grid with 0,0 being in the bottom left, with a 2 pixel "bleed" border.(Changing) <br>
==[[buildingFloorCoordDict|Building Footprint]]==
==[[buildingFloorCoordDict|Building Footprint]]==
==[[structureFloorCoordDict|Structures Footprint]]==
==[[structureFloorCoordDict|Structures Footprint]]==

Revision as of 22:42, 19 December 2022

Mods are in development!
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 Mod Manager will show 3 tabs:
      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 and change Mod 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 (a default will be provided if omitted). File size recommended = 200x200 pixels
  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

Enabling a mod and in-game reloading

  1. Enable mods in either Sandbox, Random Map, or 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 - Create New Map (or edit your existing map) - Map Settings - Required Mods (Manage) will open Mod Manager with Available and Workshop tabs for activating mods. Published Custom Maps with mods will include the mod(s) for subscribers.
  2. Activate a mod and the game will process all other content in your mod, i.e. json files, images etc.
  3. You can update your mod and reload the codex mid-game using the button in the top left info panel.


   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

(OLD) Generate default files using the Export Base Codex button in the Mod Manager window.
Note this has been superseded by the repository on GitHub:
https://github.com/codebyfire/colonists-base-codex

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

Example Mods

Custom Building

Custom Natural Resource

Custom Techs

Custom Land Route

Unity Project Example Assets

Example Assets Unity Project