Results 1 to 1 of 1

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

  1. #1
    Shaidar Haran Senior Member SAM Site Champion Myrddraal's Avatar
    Join Date
    Feb 2004
    Location
    UK
    Posts
    5,752

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

    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
    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:

    Code:
     ;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:

    Code:
    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:

    Code:
     recruit "carthaginian peasant" 0 requires factions { spain, }
    At the end of your unit add: and hidden_resource myresource. It should look like this:

    Code:
     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:

    Code:
    Britannia_Inferior				
    	Eburacum				
    	britons				
    	Brigantes				
    	232 41 198				
    	lead, dogs, pigs		
    	5
    	5
    At the end of the resources, simply add ‘, myresource’

    Code:
    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.
    Last edited by Myrddraal; 07-26-2005 at 10:19.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO