Basic Modding Guide

### Introduction

This document is intended for those who are new to modding in Riftbreaker. It covers only the basics for mods that edit the properties of exiting buildings, etc and the creation of new buildings that use exiting, but recoloured, building assets (the structure is the same just a different colour).

### Software Needed

- Riftbreaker Tools (Steam, GoG)

- Paint.net (or other application that can edit/save .DDS files)

- Paint.Net Color Range Plugin (https://forums.getpaint.net/topic/118037-remakes-plugin-pack-updated-january-22-2022/)

- Notepad++ (optional)

### Riftbreaker Tools

1. Create workspace Open the RB Tools and click on the + icon to create a new workspace

In the Workspace field enter the name of your mod and click OK. You can change this and other parts of this window later.

2. Copy files needed into your workspace

This will allow you to edit the files without touching the games default files. Useful if you need to start again or want to look at the original version.

**Do not edit the game files themselves.**

Find the files you want in the Game Files section, right-click the file or folder and select “Copy to workspace”

3. Edit the files

For text based files (.ent, .material, .lua, .rt, .dat, etc) use Notepad or Notepad++ (recommended but not required). Make the changes to the files as needed and save the file once done.

For image files (.dds) use Paint.Net or any other application that can edit/save the .dds format.

### Example 1

Increase the amount of physical resources the Solid Material Storage buildings can store

1. Open RB Tools and create a Workspace called “Solid Material Storage Increase”

2. From the Game Files (left column) find the following files and copy them to the new workspace:

1. entities\buildings\resources\solid\_material\_storage.ent
2. entities\buildings\resources\solid\_material\_storage\_lvl\_2.ent
3. entities\buildings\resources\solid\_material\_storage\_lvl \_3.ent

3. Right-click on solid\_material\_storage.ent and select Edit in Editor

Or open File Explorer and navigate to \Steam\steamapps\common\Riftbreaker\mods\Solid Material Storage

Increase and open the .ent file

4. Find this section:

```
ResourceStorageDesc
 {
 Storages
 {
 Storage
 {
 group "global"
 subgroup "base"
 max "200"
 }

```
5. Change the **max** value to the amount of storage you want the level 1 building to be able to store.

6. Save the file.

7. Repeat the steps 3 > 6 for the other two .ent files, changing the **max** value for the different levels of the building.

8. Play the game and enjoy your mod 😊

### Example 2

Add new building that enerates resources (Tanzanite Synthesizer) using a recoloured building icon and model as the Carbonium Synthesizer.

1. Open RB Tools and create a workspace called “Tanzanite Synthesizer”

2. From the Game Files (left column) find the following files and copy them to the new workspace:

* entities\buildings\resources\carbonium\_synthesizer.ent
* entities\buildings\resources\carbonium\_synthesizer\_lvl\_2.ent
* entities\buildings\resources\carbonium\_synthesizer\_lvl\_3.ent
* materials\textures\buildings\resources\carbonium\_synthesizer.albedo
* materials\textures\buildings\resources\carbonium\_synthesizer.emissive (optional if you want to change the colour of the building lights)
* materials\textures\gui\hud\building\_icons\carbonium\_synthesizer.dds
* materials\textures\gui\hud\building\_icons\carbonium\_synthesizer\_disabled.dds
* materials\textures\gui\hud\building\_icons\carbonium\_synthesizer\_lvl2.dds
* materials\textures\gui\hud\building\_icons\carbonium\_synthesizer\_lvl2\_disabled.dds
* materials\textures\gui\hud\building\_icons\carbonium\_synthesizer\_lvl3.dds
* materials\textures\gui\hud\building\_icons\carbonium\_synthesizer\_lvl3\_disabled.dds
* materials\scripts\buildings\_resources.material
* materials\scripts\gui\_hud\_building\_icons.material
* scripts\research\research\_tree.rt

NOTE: materials\scripts and scripts are 2 different folder structures

##### Change the building to provide Tanzanite

1. Rename the entities\buildings\resources\carbonium\_synthesizer.ent file to tanzanite\_synthesizer.ent

2. Open the renamed file and in the following sections change “carbonium” to “tanzanite”:

**NOTE: DO NOT change any of the “mesh” values**

3. If you want to change the amount of Tanzanite the level 1 synthesizer provides change the GameplayResource value amount from “2” to “%new number%”.

4. Save the file

5. Repeat steps 4-6 for the other 2 .ent files

##### Recolour the Building Icons

1. Navigate to or open the \materials\textures\gui\hud\building\_icons folder

2. Rename only the carbonium\_synthesizer.dds and each of the disabled files to tanzanite\_synthesizer

3. Open Paint.net and open the tanzanite\_synthesizer.dds file

4. Follow the How To Use Paint.Net Basics guide [LINK###] to recolour the menu icon for this building. Once you are happy with your colour changes save the .dds file. Write down or screenshot the Hue/Saturation settings that you used.For this example I wanted to replace the standard orange colour of the building to a purple as that’s the colour of tanzanite:

5. As the level 2 and level 3 image files are the same but with just the numbers 2 and 3 added, and so the colour of the building icon doesn’t change with each edit, simply copy those numbers from each of the carbonium\_synthesizer \_lvl#.dds, paste it into the tanzanite\_syntheszer.dds and save the files as “tanzanite\_synthesizer\_lvl2” and “tanzanite\_synthesizer\_lvl2” respectively

##### Recolour the Building

1. Navigate to or open the \materials\textures\buildings\resources folder

2. Rename both files and replace “carbonium” with “tanzanite”

3. Open the albedo file in Paint.Net

4. Follow the How To Use Paint.Net Basics guide [LINK###] to recolour the menu icon for this building. For the Hue/Saturation step use the values you recorded from above. Once you are happy with your colour changes save the .dds file.

For this example I wanted to replace the standard orange colour of the building to a purple as that’s the colour of tanzanite.

5. If you want to change the colour of the glowing lights repeat steps 3-4 for the emissive file.

##### Tell the Game Which .material Files to Use

1. Navigate to or open the \materials\scripts folder

2. Renames the files:

* buildings\_resources.material > tanzanite\_synthesizer.material
* gui\_hud\_building\_icons.material > tanzanite\_synthesizer\_icons.material

3. Edit the files:

###### tanzanite\_synthesizer.material

1. Open the file

2. Delete every line of text EXCEPT:

* the first 2 “import \* from…” lines
* the carbonium\_synthesizer lines of text

3. Replace the text “carbonium” with “tanzanite” in the following lines of text

Note that as we did not bring the “normal” or “packed” .dds files to the new workspace we are not renaming them in this file. This way the game will use the original game files for those and our customer files for the “albedo” and “emissive” files even though they are not in the same folder.

###### tanzanite\_synthesizer\_icons.material

1. Open the file
2. Delete every line of text EXCEPT:

* the first 1 “import \* from…” line
* the carbonium\_synthesizer lines of text
* done worry about the “// ----- “ text those are just comments and have no impact on the game

3. Replace the text “carbonium” with “tanzanite” everywhere

##### Allow the New Buildings to be Researched

There are 2 ways of doing this.

First is to edit the Research Tree itself but this will have issues if you are using another mod that also has a customised Research Tree as only 1 can be used.

Second is the create a custom research file that creates a 4th research tab (Base, Weapons, Alien, 4th).

###### Edit Research Tree

###TO DO ###

###### Create Custom Research File with an extra research tab

1. Navigate to or open the \scripts folder

2. Rename the research\_tree.rt file to research\_tanzanite\_synthesizer\_mod.rt

3. Open the file and delete everything

4. Copy in this text:

```
Research
{
 categories
 {
 ResearchTree
 {
 category "gui/menu/research/category\_mods"
 nodes
 {
 ResearchNode
 {
 research\_flags
 requirement\_tooltip
 requirements
 {
 ResearchNodeRequirement
 {
 research\_name "gui/menu/research/name/resource\_handling\_tanzanite"
 research\_category "gui/menu/research/category\_alien"
 }

 }

 research\_name "gui/menu/research/name/tanzanite\_synthesizer"
 research\_costs
 {
 ResearchCost
 {
 amount "0.000"
 resource "download"
 count "1500.000"
 }

 }

 research\_scripts
 position
 {
 x "0.000"
 y "-324.000"
 }

 research\_awards
 {
 ResearchAward
 {
 blueprint "buildings/resources/tanzanite\_synthesizer "
 is\_visible "1"
 }

 }

 icon "gui/menu/research/icons/resource\_handling"
 }

 ResearchNode
 {
 research\_flags
 requirement\_tooltip
 requirements
 {
 ResearchNodeRequirement
 {
 research\_name "gui/menu/research/name/tanzanite\_synthesizer"
 research\_category "gui/menu/research/category\_mods"
 }

 ResearchNodeRequirement
 {
 research\_name "gui/menu/research/name/headquarters\_lvl3"
 research\_category "gui/menu/research/category\_base\_buildings"
 }

 }

 research\_name "gui/menu/research/name/tanzanite\_synthesizer\_lvl2"
 research\_costs
 {
 ResearchCost
 {
 amount "0.000"
 resource "download"
 count "2000.000"
 }

 }

 research\_scripts
 position
 {
 x "0.000"
 y "-216.000"
 }

 research\_awards
 {
 ResearchAward
 {
 blueprint "buildings/resources/tanzanite\_synthesizer\_lvl\_2"
 is\_visible "1"
 }

 }

 icon "gui/menu/research/icons/resource\_handling"
 }

 ResearchNode
 {
 research\_flags
 requirement\_tooltip
 requirements
 {
 ResearchNodeRequirement
 {
 research\_name "gui/menu/research/name/tanzanite\_synthesizer\_lvl2"
 research\_category "gui/menu/research/category\_mods"
 }

 ResearchNodeRequirement
 {
 research\_name "gui/menu/research/name/headquarters\_lvl7"
 research\_category "gui/menu/research/category\_base\_buildings"
 }
 }

 research\_name "gui/menu/research/name/tanzanite\_synthesizer\_lvl3"
 research\_costs
 {
 ResearchCost
 {
 amount "0.000"
 resource "download"
 count "2500.000"
 }

 }

 research\_scripts
 position
 {
 x "0.000"
 y "-108.000"
 }

 research\_awards
 {
 ResearchAward
 {
 blueprint "buildings/resources/tanzanite\_synthesizer\_lvl\_3"
 is\_visible "1"
 }

 }

 icon "gui/menu/research/icons/resource\_handling"
 }

 }

 }

 }

 type "custom"
 editor "5411"
 version "1"
}

```

5. What this all means/does:

* a) ResearchNode

This is where the code for this new research starts

* b) category "gui/menu/research/category\_mods"

sets the name of the new 4th research tab to “mods”

* c) ResearchNodeRequirement sets any requirements there are to unlock this research.

As you can see from the Tanzanite\_synthesizer\_lvl2 and lvl3 entries you can have more than 1 ResearchNodeRequirement

* d) research\_name "gui/menu/research/name/resource\_handling\_tanzanite"

this sets the Tanzanite Handling research as what research is needed to unlock this research.

The actual name of the Tanzanite Handling research can be found by open the Research Editor (see above), finding the research that you want as the requirement (ticking the “Show hidden icons” box helps), clicking on the icon and in the top right is the Name field.

* e) research\_category "gui/menu/research/category\_alien"

This is the research category where the above research requirement can be found. The actual name of this category can also be found in the Research Editor and mouse-over the “Alien research” tab at the top

* f) research\_name "gui/menu/research/name/tanzanite\_synthesizer"

Sets the name of this research

* g) ResearchCost

Is where we set how much research is needed

* h) count "1500.000"

This is where we set the actual research cost value in seconds. Use other research via the Research Editor to find comparable costs

* i) position This is the X/Y coordinates in the Research interface of the game.

A position of X “0” and y “0” means the icon will be in the middle of the interface

A negative X position moves the icon to the left

A negative Y position moves the icon up.

Set whatever values you like and after you can drag and drop in the Research Editor.

* j) blueprint "buildings/resources/tanzanite\_synthesizer"

This is where you set what the research provides when completed.
In this case it is the building blueprint for the new Tanzanite Synthesizer

* k) icon "gui/menu/research/icons/resource\_handling"

This is where you tell the game what icon to use for this research

6. Save the file.

7. Check your spellings, look for empty spaces, etc

A simple spelling mistake, a double space or a space before/after a work can break the mod.

8. Load the game and enjoy the mod