# Modding Tutorial: Adding new resources

**URL:** <https://forum.dionicsoftware.com/t/modding-tutorial-adding-new-resources/3286>\
**Category:** FF Mods\
**Created:** [September 29, 2022, 1:40pm UTC](https://forum.dionicsoftware.com/t/modding-tutorial-adding-new-resources/3286 "2022-09-29T13:40:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Null3rror](https://forum.dionicsoftware.com/user_avatar/forum.dionicsoftware.com/null3rror/32/2143_2.png) [@Null3rror](https://forum.dionicsoftware.com/u/Null3rror)\
**Post date:** [September 29, 2022, 1:40pm UTC](https://forum.dionicsoftware.com/t/modding-tutorial-adding-new-resources/3286/1 "2022-09-29T13:40:05Z")

</div>

This tutorial covers how to add new resources to the game.  
Make sure to go through [“Making your first example mod” Modding Tutorial](https://forum.dionicsoftware.com/t/modding-tutorial-basic-overview-making-your-first-example-mod/930/2) and [“Changing existing parameters” Modding Tutorial](https://forum.dionicsoftware.com/t/modding-tutorial-changing-existing-parameters/932), so you can understand this tutorial easier.

To add new resources, we need to modify `resource.json`, which contains definitions for all resources in the game. To better understand the structure of this configuration file, you can check out [FFModKit](https://github.com/Ponzel/FFModKit/tree/master/ExampleFilesFromTheGame).

# Example Walkthrough on how to add a new Fish resource

## 1. Folder setup

Go to the mods folder at `C:\Users\YOUR_USER_NAME\AppDataLocalLow\Oachkatzlschowaf Interactive\Founders Fortune\mods` and create a folder for your mod. Let’s call it “Fish Mod”.

## 2. config.json file

In this folder, create a file called `config.json`. Open the file using any text editor and paste the following:

```auto
{
	"name": "Fish Resource",
	"version": "1.0",
	"author": "RunTime_Terror",
	"website": "https://dionicsoftware.com/",
	"description": "Fish as an edible resource",
	"compatibleVersions": [
		"Release 1.2.4"
	],
}

```

These infos are used by the game and by Steam to display your mod properly.

## 3. Configuring your resource.json file

In order to use any new object in the game, you need to tell Founders’ Fortune about it. This is done by writing json files. In this example, we create a configuration file for a fish resource. Put a file called `resource.json` in your mod folder.

Let’s add two new resources, a “Raw Fish” and a “Grilled Fish”:

```auto
{
	"RawFish": {
		"defaultPrice": 6,
		"buyProbability": 1,
		"sellProbability": 1,
		"typicalTradeAmount": 200,
		"isAlwaysAvailable": true
	},
	"GrilledFish": {
		"defaultPrice": 60,
		"buyProbability": 1,
		"sellProbability": 1,
		"typicalTradeAmount": 100,
		"isAlwaysAvailable": false
	}
}

```

For more examples, check the game’s `resource.json` configuration file. We uploaded it to [FFModKit](https://github.com/Ponzel/FFModKit/blob/master/ExampleFilesFromTheGame/resource.json)

## 4. Checking which aggregated resources need changing

We need to add these new fish resources to some aggregated resources (e.g. FoodEdible, FoodCooked…) so colonists can eat fish. In this example, we only want to **add** these two new resources, so we need to check the child resources of these aggregated resources from the [game’s resource.json](https://github.com/Ponzel/FFModKit/blob/master/ExampleFilesFromTheGame/resource.json).  
We put **some** of the aggregated resources that need to change for this example here for your convenience:

```auto
"FoodRaw": {
        "defaultStockpile": 120,
        "childResources": ["Apple", "Tomato", "Pumpkin", "Potato", "Strawberry", "Wheat", "RawMeat", "Milk"],
 },
    "FoodCooked": {
        "defaultStockpile": 20,
        "childResources": ["BakedApple", "BakedPotato", "BakedTomato", "GrilledMeat", "PumpkinStew", "MeatAndPotatoes", 
            "FruitSalad", "Cheese", "Bread", "StrawberryCake", "AppleStrudel"],
 },
"FoodEdible": {
        "childResources": ["Apple", "Tomato", "Pumpkin", "Potato", "Strawberry", "BakedApple", "BakedPotato", "BakedTomato", 
            "GrilledMeat", "PumpkinStew", "MeatAndPotatoes", "FruitSalad", "Cheese", "Bread", "StrawberryCake", "AppleStrudel"],
 },
"SimpleMeal": {
        "childResources": ["BakedApple", "BakedPotato", "BakedTomato", "GrilledMeat"],
},

```

## 5. Configuring patch.json file

Now that we know which aggregated resources we need to change, let’s add “RawFish” and “GrilledFish” to them via `patch.json`:

```auto
{ 
	"replaceOperations": {
		"resource/FoodRaw/childResources": ["Apple", "Tomato", "Pumpkin", "Potato", "Strawberry", "Wheat", "RawMeat", "Milk", "RawFish"],
		"resource/FoodCooked/childResources": ["BakedApple", "BakedPotato", "BakedTomato", "GrilledMeat", "PumpkinStew", "MeatAndPotatoes",
			"FruitSalad", "Cheese", "Bread", "StrawberryCake", "AppleStrudel", "GrilledFish"],
		"resource/SimpleMeal/childResources": ["BakedApple", "BakedPotato", "BakedTomato", "GrilledMeat", "GrilledFish"],
		"resource/FoodMeat/childResources": ["RawMeat", "GrilledMeat", "MeatAndPotatoes", "RawFish", "GrilledFish"],
		"resource/FoodEdible/childResources": ["Apple", "Tomato", "Pumpkin", "Potato", "Strawberry", "BakedApple", "BakedPotato", "BakedTomato",
			"GrilledMeat", "PumpkinStew", "MeatAndPotatoes", "FruitSalad", "Cheese", "Bread", "StrawberryCake", "AppleStrudel", "GrilledFish"]
	},
	"removeOperations": [
		
	]
}

```

## 6. Adding localization.json file

Add a `localization.json` file to your folder. Let’s do some translation:

```auto
{
	"resourceName_RawFish": {
		"english": "Raw Fish",
		"german": "Roher Fisch"
	},
	"resourceName_GrilledFish": {
		"english": "Grilled Fish",
		"german": "Gegrillter Fisch"
	}
}

```

You can also check `localization.json` in the [Example Mod](https://github.com/Ponzel/FFModKit/tree/master/Example%20Mod/FFModKit%20Example%20Mod) to find out how to add the necessary text for your object. If you want, you can even support different languages 😃

## 7. Done!

Start the game and check the “Mods and Extra Content” point in the main menu. You should be able to see your mod and have it active to play.  
Start a game and see if it all works!

 ![image](https://forum.dionicsoftware.com/uploads/default/original/2X/4/446da50e70a217bd59a2bb7067bb07c0b024d063.jpeg)

---

<div class="post-metadata">

**Author:** ![Null3rror](https://forum.dionicsoftware.com/user_avatar/forum.dionicsoftware.com/null3rror/32/2143_2.png) [@Null3rror](https://forum.dionicsoftware.com/u/Null3rror)\
**Post date:** [September 29, 2022, 1:53pm UTC](https://forum.dionicsoftware.com/t/modding-tutorial-adding-new-resources/3286/2 "2022-09-29T13:53:31Z")

</div>

# Additional notes about modding resources

We added a new resource category called “Misc”:

 ![image](https://forum.dionicsoftware.com/uploads/default/original/2X/4/46fc0bc1fec7920d90ad66b794b65543d72a1d1f.png)

This “Misc” category doesn’t need any storage, so you can add any resource you can imagine, like “BEANs” or, heck, even a “Chaos Emerald”.  
Happy modding!

---

<div class="post-metadata">

**Author:** ![system](https://forum.dionicsoftware.com/uploads/default/original/2X/0/0d9c9e08c9000ab1f77ef2725aedca131bca5d47.png) [@system](https://forum.dionicsoftware.com/u/system)\
**Post date:** [October 29, 2022, 1:54pm UTC](https://forum.dionicsoftware.com/t/modding-tutorial-adding-new-resources/3286/3 "2022-10-29T13:54:20Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
