This is actually a lot simpler than it sounds.
You need exactly TWO files:
data/world/maps/base/descr_regions.txt
data/export_descr_buildings.txt
First, open EDB...
THE EDB STUFFAt the top of the file, before the first building, will be a line roughly like this:
hidden_resources sparta rome italy
Now, we'll assume we want to add a unit only available in desert. So now I add a new hidden resource called "desert":
hidden_resources sparta rome italy desert
Now, I go to the building that trains that unit:
building some_building
{
levels a_building_level
{
a_building_level requires factions { greek_cities, romans_scipii, romans_brutii, thrace, parthia, seleucid, }
{
capability
{
recruit "desert ninjas" 3 requires factions { greek_cities, carthage, romans_scipii, numidia, romans_brutii, thrace, parthia, seleucid, }
}
construction 1
cost 400
settlement_min town
upgrades
{
}
}
}
plugins
{
}
}
And simply add that it requires my new hidden resource.
recruit "desert ninjas" 3 requires factions { greek_cities, carthage, romans_scipii, numidia, romans_brutii, thrace, parthia, seleucid, } and hidden_resource desert
I could also make the building require the hidden resource if I wanted:
a_building_level requires factions { greek_cities, romans_scipii, romans_brutii, thrace, parthia, seleucid, } and hidden_resource desert
So that's great! You can now boot up Rome TW and your unit will be available for training precisely
nowhere at all. This should not be surprising, since we haven't told the game where the desert areas actually are yet! Time for descr_regions...
THE REGIONS STUFFThis bit's really simple. Find all the regions you want to have your new hidden resource, look at their resource list, and add your new hidden resource onto the end. That's really all there is to it.
So (this is a Game of Colleges example):
The_Backs
Kings
greek_cities
Latins
157 13 198
timber, hides, pigs, college, arts, science
5
8
If I want to add my desert stuff to this province it just becomes:
The_Backs
Kings
greek_cities
Latins
157 13 198
timber, hides, pigs, college, arts, science, desert
5
8
And that's it!
Hope that's all helpful, do post below with any questions and queries.