Good day, I am playing with the EDB and an aspect that gives plenty of opportunity of customization that hasn't been included in the tutorial section is the Hidden_Resource.
What is an Hidden_Resource (HR)?
An Hidden_Resource is a coding that gives restriction. The HR is linked to a region, part of the map or any other restriction you apply. Let's write an example on what I want to mean.
We will start with a HR, let's create one called "England"
Then here's the coding line in the EDB.
Now what it means is you can recruit a longbowmen unit only in regions with the HR England tag(London, York, Nottingham for example are the regions with the hidden_resource England, so you can recruit longbowmen only in these regions).
What it means, is regions that do not have the HR England tag will have a decreased availability of Longbowmen (see, the unit refill rate has decreased andthe unit pool size is much lower).
Note: The "not" is not necessary, it only makes another condition but if you want to limit a recruitment of building to one region only, just add the "and hidden_resource xxx" only.
How to create a new Hidden_Resource
You need to play with three files (Important, do back-up files in case you do something wrong!!)
- Export_Descr_Buildings.txt file (EDB) (Located in the your mod/data folder)
- Descr_Region.txt file (Located in your mod/data/world/maps/base)
- map.rwm (Located in your mod/data/world/maps/base)
Step 1
Open your EDB, see the first line of the file? It's the list of HR.
Step 2
Now, you have to write a hidden_resource, let's say a random name "polycarpe". Now you will have to paste this HR name at the end of the HR list like this:
Step3
Now choose your units, buildings, bonus, etc. that you want to restrict with a HR, let's take the Longbowmen unit
Now save your file.
Step 4
Open your descr_regions.txt. file. This is the whole list of regions of the mod. Now let's take an example of Dublin.
Now add "polycarpe" in this entry
Save the file.
Step 5
Now, after these steps, the game won't recognize the changes. You will need to delete the map.rwm file. (Don't worry, the game will generate a new map.rwm file with you new changes).
Here you go, you just create a new hidden_resource. Enjoy the modding.
I want to thanks Ishan for explaining me how to create a hidden_resource.
Important note: The Hardcoded limit of total number of hidden_resource is 64.