Adding Buildings To RTW

by Hussarknight

RTW already has many buildings in it. This guide will show you how to make your own!

These are the files that we'll be editing:

Required

  • RTW\data\export_descr_building.txt
  • RTW\data\text\export_buildings.txt
Optional
  • RTW\data\ui\<culture>\buildings\#<culture>_<building level>.tga
  • RTW\data\ui\<culture>\buildings\#<culture>_<building level>_constructed.tga
  • RTW\data\ui\<culture>\buildings\construction\#<culture>_<building level>.tga
Before you change any of these files make a backup of them. That way, if worse comes to worse, you'll always have a working file to fall back on.

Part One: Export_Descr_Building.txt

We'll start out by editing RTW\data\export_descr_building.txt. (EDB for short.) In this file, you'll find a list of all buildings in the game. It is easiest to copy an existing building and use it as a template for your own building. For this guide, I'll be adding a temple to Cupido to the Roman factions. It will have only two levels, because Cupido is only a minor god for the Romans. I start out by copying the entry for temple_of_love and pasting it at the bottom of the EDB file. Then I remove the levels I don't want. By doing that, I get this:

building temple_of_love
{
   levels temple_of_love_shrine temple_of_love_temple
   {
      temple_of_love_shrine requires factions { scythia, pontus, greek_cities, }
      {
         capability
         {
            happiness_bonus bonus 1
            population_growth_bonus bonus 1
         }
         construction 1
         cost 400
         settlement_min town
         upgrades
         {
            temple_of_love_temple
         }
      }
      temple_of_love_temple requires factions { scythia, pontus, greek_cities, }
      {
         capability
         {
            recruit "barb head hunting maidens scythian" 0 requires factions { scythia, }
            happiness_bonus bonus 2
            population_growth_bonus bonus 2
         }
         construction 2
         cost 800
         settlement_min large_town
         upgrades
         {
         }
      }
   }
   plugins
   {
   }
}

building - Here you set the name of the building. This cannot contain any spaces. For the example, I will name the building temple_of_minor_love.

levels - This sets the available levels for this building. They, too, cannot contain spaces. You need to use a space between two different levels. Our example building will have two levels, a shrine and a temple, so we'll change this to levels temple_of_minor_love_shrine temple_of_minor_love_temple.

name - This is the name of the first level. This is followed by any requirements for the construction of this building.

These are the requirements you can use:

  • resource [name] - For valid resources, see descr_strat.txt.
  • hidden_resource [name] - This is a special type of resources that doesn't appear on the map but is only used internally.
  • building_present [type] - Valid types can be found in the EDB.
  • building_present_min_level [type] [name] - Again, these can be found in EDB.
  • marian_reforms - This building can only be build after the Marian Reforms.
  • factions { [faction], [faction] } - Choose the factions you want to be able to construct this building. You can also use cultures here.

You can use multiple requirements by connecting them with "and". Like this:

income_east requires factions { seleucid, } and resource iron

You can also put "not" in front of a statement. This means that the following statement must be false for the building to be constructable. Like this:

income_east requires factions { seleucid, } and not hidden_resource sparta

The last operator is "or". This means at least one of the two conditions this is placed between must be true for the building to be available. Like this:

mines requires factions { barbarian, } and resource silver or resource gold

In our example, the first level is called temple_of_minor_love_temple. It can only be built by the Romans, so this is what the result will look like:

temple_of_minor_love_shrine requires factions { roman, }

We'll also change it for the temple level:

temple_of_minor_love_temple requires factions { roman, }

Capability - What follows inside the curly brackets are the effects of the building. There are several different things you can add here:

  • taxable_income_bonus bonus x - This increases the tax income, where x is the percentage by which tax income is increased.
  • trade_base_income_bonus bonus x - This increases income from trade. The higher x is, the more the trade income is increased.
  • happiness_bonus bonus x - This increases the public order due to happiness. The higher x is, the more influence it has.
  • recruits_exp_bonus bonus x - This will give any units trained in a settlement with this building starting experience. X represents the number of chevrons.
  • recruits_morale_bonus bonus x - This gives a morale bonus to all troops trained in the settlement. X is, as always, the amount of morale points.
  • law_bonus bonus x - This improves law, which will improve public order and reduce corruption. Once again, x is the value.
  • recruit ["unit name"] x - This gives the option to recruit the specified unit. You need to use the type entry as found in RTW\data\export_descr_unit.txt. Here, x stands for the amount of experience this unit will start with. This can be improved further by recruits_exp_bonus bonus x
  • farming_level x - This will improve the income and population growth based on farming. X stands for, as always, for the value.
  • weapon_simple x - Any units with a weapon classed as "light" will receive a weapon upgrade of x levels when they are trained here.
  • weapon_bladed x - Same as above, but for units with "heavy" weapons.
  • weapon_missile x - Any units with a weapon classed as "missile" will receive a weapon upgrade of x levels when they are trained here.
  • armour x - All units trained here will start with armour at level x.
  • trade_fleet x - This will give the settlement x trade fleets. Each trade fleet will allow the settlement to trade via one trade rout.
  • population_health_bonus bonus x - This gives a health bonus of x to the settlement. This will increase both population growth and public order.
  • road_level x - This can be used to improve roads. 0 means dirt roads, 1 stands for paved roads and 2 stands for highways.
  • mine_resource x - This improves the mines in the province. The higher x, the more mining income is increased.
  • stage_games x - This will make it possible to give games in the settlement. The higher x is, the more public order is increased because of this.

As with the buildings themselves, you can also use requirements on effects. The same effects you can use for buildings you can also use for effects.

The temple of Cupido will increase population growth and happiness, but only for the Romans and the Greek_Cities, as they were the only ones that actually recognised Cupido as a god (he was named Eros for the Greeks). So I change the capabilities to this:

capability
{
   happiness_bonus bonus 1 requires factions { roman, greek_cities, }
   population_growth_bonus bonus 1 requires factions { roman, greek_cities, }
}

For the temple, we'll use the same effects, but change the level to 2:

capability
{
   happiness_bonus bonus 2 requires factions { roman, greek_cities, }
   population_growth_bonus bonus 2 requires factions { roman, greek_cities, }
}

construction - The construction time in turns

cost - The amount of denarii this building costs to construct.

settlement_min - This sets the minimal level a settlement must have to construct this building. The valid values are:

  • village
  • town
  • large_town
  • city
  • large_city
  • huge_city
If you set this to village, the building will not appear in the building browser. If you set it to another level it will appear. On the building browser, the buildings appear in the order they're in in EDB.

Going back to our example case, we'll want the shrine to be constructable in a town. The price will be 400 and the building will be built in one turn:

construction 1
cost 400
settlement_min town

The upgrade from the shrine, the temple, will take two turns to build and 800 denarii to construct and will be available from the large town level:

construction 2
cost 800
settlement_min large_town

Upgrades

upgrades
{
}

Inside the curly brackets you can put the upgrade of this building. If it doesn't have an upgrade, just leave it empty. Any buildings you place here should exist in the part of the entry above this.

For the temple to Cupido, we'll want the shrine to be upgradable to the temple. This is what the upgrades part will look like:

upgrades
{
      temple_of_minor_love_temple
}

The temple doesn't have an upgrade, so we'll leave the upgrades part empty for that.

Plugins

plugins
{
}

As far as I know this doesn't do anything, so it is best to leave it as it is. For our example temple we'll also leave this empty.

Alright, part one is now finished. Part two (which is a lot shorter than part one) will explain how to edit the other files.

Part Two: Export_Building.txt

Now we've set the building's properties it's time to make it's descriptions. Start by opening RTW\data\text\export_building.txt. In it, you will find the descriptions for all buildings in the game for each culture.

It is easiest to copy an existing entry and paste it at the bottom of the file. Now replace the name inside the curly brackets with the one of one of the building levels you just created. For example, copy this:

{temple_of_love_shrine_greek}      Shrine to Aphrodite

{temple_of_love_shrine_greek_desc}
This Shrine is dedicated to Aphrodite, the Olympian Goddess of Love, Beauty and Procreation. If it's rampant, naughty and fun, she's the goddess of it! When she appears in mortal form Aphrodite sometimes has the misfortune to inspire obsessional love bordering on the completely mad!\n\nReligion acts to make a people feel happy and content to know that the Gods are honoured. \n\nThis Shrine can be improved as the settlement grows in size and importance.

{temple_of_love_shrine_greek_desc_short}
This Shrine is dedicated to Aphrodite, the Olympian Goddess of Love, Beauty and Procreation. If it's rampant, naughty and fun, she's the goddess of it!

Paste it to the bottom of the file, and change it to this:

{temple_of_minor_love_shrine_roman}      Shrine to Cupido

{temple_of_minor_love_shrine_roman_desc}
The Shrine is dedicated to Cupido, the Roman God of Love. He is the helper of Venus, the Roman goddess of love. With his sharp arrows he can give humans luck in love, but those he hits with a blunt arrow will suffer from horrible heartache.\n\nReligion acts to make a people feel happy and content to know that the Gods are honoured.\n\nThis Shrine can be improved as the settlement grows in size and importance.

{temple_of_minor_love_shrine_roman_desc_short}
This Shrine is dedicated to Cupido, Roman God of Love. He is the helper of Venus, the Roman goddess of love.

This has to be done for all cultures that will possess the new building. Remember this only sets the description for the Shrine level of the building. The next level - temple - will have to likewise be copied and pasted and altered as above.

The text outside the curly brackets is the description of the building. Change this to your own. You only need a description for the cultures that can build the building. To make the description continue on a new line in the game, use n\. The rest of the description in the text file should continue on the same line. For a new paragraph, use n\n\.

Congratulations, you now have a fully working and functionally building. If you wish, you can now continue adding in your own images for the building.

Part Three: Images

Inside your RTW\data folder, create a new folder called UI (unless it is already there). Inside this folder, create a new folder for each culture that can construct this building. The folder should have the name of the culture, for example "roman". Inside the folder with the culture name you should create a folder called "buildings".

Inside this folder you'll have to place two files for your new building, with the names:

  • #[culture]_[building level].tga
  • #[culture]_[building level]_constructed.tga

Inside the "buildings" folder there should be another folder called "construction". This will contain one file:

#[culture]_[building level].tga

The first image is the one that is used at the bottom of the screen when you select the town and for when the building is on the construction queue. It should measure 78 pixels in width and 62 pixels in height. It looks best when the background of the picture is transparent. For instructions on how to do this, see here under "Transparent Unit Cards".

For our example building, these files will be named #roman_temple_of_minor_love_shrine.tga for the shrine and #roman_temple_of_minor_love_temple.tga for the temple.

The second image is the one that appears on the scroll with information about the building. It should be 361 pixels wide and 163 pixels high. For our example building, these files will be named #roman_temple_of_minor_love_shrine_constructed.tga for the shrine and #roman_temple_of_minor_love_temple_constructed.tga for the temple.

The image inside the "construction" folder is used on the scroll where you can select which building to construct. It should be 64 by 51 pixels. For our example building, these files will be named #roman_temple_of_minor_love_shrine.tga for the shrine and #roman_temple_of_minor_love_temple.tga for the temple.

For our example, I used the temple images from vanilla RTW, which I extracted from the pak files with Vercingetorix's PAK Extractor here. For a temple you do need to rename them to the format described above to have them appear in-game.

That's it! You've created your first own building in RTW.

You can download the Temple of Cupido here

I hope you've found this guide useful. If you have any comments or questions, please let me know.

"));