Author Topic: Implementing Area-based recruitment  (Read 3373 times)

Jubal

  • Megadux
    Executive Officer
  • Posts: 35495
  • Karma: 140
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Implementing Area-based recruitment
« on: January 04, 2014, 12:54:24 PM »
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 STUFF

At the top of the file, before the first building, will be a line roughly like this:

Code: [Select]
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":

Code: [Select]
hidden_resources sparta rome italy desert
Now, I go to the building that trains that unit:

Code: [Select]
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.

Code: [Select]
                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:

Code: [Select]
        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 STUFF

This 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):
Code: [Select]
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:
Code: [Select]
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.  :)
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

Lenin Cat

  • Citizens
    Voting Member
  • Posts: 96
  • Karma: 2
  • Unit Pack Oberhaul- pending
    • View Profile
    • Awards
Re: Implementing Area-based recruitment
« Reply #1 on: January 04, 2014, 01:54:36 PM »
Awesome!
You can not haz cheezeburger until all cats can haz cheezeburger.