PDA

View Full Version : How to make province specific units/buildings (or using hidden resources)



Myrddraal
01-02-2005, 00:00
Modding Resource Header

Title: How to make province specific units/buildings (or using hidden resources)

Posted by: Myrddraal

Modding area: Units (recruitment) / Buildings (construction)
Required programmes: Notepad (or other text editor)
Optional tools: Excel macro for recruit lines in edb (https://forums.totalwar.org/vb/showthread.php?t=50456)
Hardcoded limits: There can be a maximum of 64 hidden resources, this must include the Rome resource (and Italy for the Marian Reforms).
Summary: Hidden resources are used to limit the areas in which units are recruited and buildings can be constructed. They differ from normal (trade) resources in that they do not appear on the map and provide no income. This tutorial shows you how to add and use these hidden resources.

__________________________________________________



How To - Make province specific units
or using hidden resources

Making a unit which can only be built in a certain province is done using a ‘hidden resource’, which is allocated to regions, but cannot be seen by the player.

To make a unit construction dependent on the existence of a hidden resource, first go to export_descr_buildings.txt in the Data folder. The top of this file should look like this:


;This file is generated from a spreadsheet
;Please do not modify by hand




hidden_resources sparta

building core_building
{
levels governors_house governors_villa governors_palace proconsuls_palace imperial_palace
{
etc

To add a hidden resource simply add it next to sparta, like this:


hidden_resources sparta, myresource
In this case the resource is called ‘myresource’

Then, find the building that makes the unit you want to make region specific. Below its name should be a list of the units this building can recruit. this should look something like this:


recruit "carthaginian peasant" 0 requires factions { spain, }

At the end of your unit add: and hidden_resource myresource. It should look like this:


recruit "carthaginian peasant" 0 requires factions { spain, } and hidden_resource myresource

I don’t know if its significant, but every time CA use this, they have put two spaces between the ‘}’ and the ‘and hidden_’


Now go to data\world\maps\campaign\ and choose the appropriate campaign folder (If you want to edit the imperial campaign, go to data\world\maps\base), open up the descr_regions.txt file and find the province you want the unit to be available in. It should look like:


Britannia_Inferior
Eburacum
britons
Brigantes
232 41 198
lead, dogs, pigs
5
5

At the end of the resources, simply add ‘, myresource’


Britannia_Inferior
Eburacum
britons
Brigantes
232 41 198
lead, dogs, pigs, myresource
5
5

You can add this resource to as many provinces as you like. Done.