Welcome to the TWC Wiki! You are not logged in. Please log in to the Wiki to vote in polls, change skin preferences, or edit pages. See HERE for details of how to LOG IN.

Difference between revisions of "Export descr buildings.txt (RTW Modding)"

From TWC Wiki
Jump to navigationJump to search
(Full List of Building Effects)
(Full List of Building Effects)
Line 109: Line 109:
 
*law_bonus (public order bonus due to law) 1-x (5-x%)
 
*law_bonus (public order bonus due to law) 1-x (5-x%)
 
*population_health_bonus (public health) 1-x (5-x%)
 
*population_health_bonus (public health) 1-x (5-x%)
*trade_base_income_bonus (increases trade goods) 1-32767 (10-327670%) [5] - adds 10% to base value of land trade & sea exports (source: experimentation; Suppanut)
+
*trade_base_income_bonus (increases trade goods) 1-32767 (10-327670%) - adds 10% to base value of land trade & sea exports (source: experimentation; Suppanut)
 
*farming_level (farms) (farms and food pruduction improvement) 1-5 (1-5) [5]
 
*farming_level (farms) (farms and food pruduction improvement) 1-5 (1-5) [5]
 
*population_fire_risk_bonus (reduces risk of fire) *
 
*population_fire_risk_bonus (reduces risk of fire) *
*taxable_income_bonus (tax income bonus) 1-32767 (10-327670 add to tax income directly)[6] (source: experimentation; Suppanut)
+
*taxable_income_bonus (tax income bonus) 1-32767 (10-327670 add to tax income directly) (source: experimentation; Suppanut)
 
*trade_level_bonus (increase in trade) - affects land trade only
 
*trade_level_bonus (increase in trade) - affects land trade only
 
*population_loyalty_bonus (public order) - does not appear to work
 
*population_loyalty_bonus (public order) - does not appear to work

Revision as of 12:55, 5 July 2014

Summary

This article is based on The Complete EDB Guide for Rome:Total War the original article was written by Dol Guldur and imported with his permission as part of the Scriptorium project. The article may have been altered since import - please refer to the history page for details of changes, or reference the original document.

This is an in-depth explanation of the export_descr_buildings.txt file, which is the primary base for modding buildings and determining which units can be recruited from them.

Dol Guldur put the original article together for his own reference, but decided to open it up to all, with the request that they also aid in improving and adding to it. If you are not at all familiar with the basics of the EDB file then you should become so before reading this. The file works alongside a good few other files and may not have the desired effect if these associated files are not modded.

Please help make this the one-stop source for EDB-related information. This Wiki article can be updated to include further information but please also post your comments, corrections and additions in the general forum of the Org RTW Workshop in this discussion thread.

Hidden resources

The file begins proper with a declaration of the hidden resources. You may have up to 64 of these. They should all be listed here. The file seems to accept both space- and comma-separated lists. Do not use a hidden_resource in the EDB file and forget to declare it as this will result in a crash to desktop (CTD). It is reported that the rome hidden resource must be kept as the game uses it when checking victory conditions. These hidden resources can be assigned to regions in the descr_regions.txt file.

Building Trees

You will then find listed in the EDB file the building tree for each building type complete with a block of code for each building. You may have up to 64 such trees with a maximum of 9 levels (buildings) each though spread over a maximum of 5 settlement levels (though buildings attached to villages will not show up on the building browser). You can read more about this in the thread initiated by Black Crow at http://forums.totalwar.org/vb/showthread.php?t=56549

The tree initiates with a declaration of the building type. Here's the beginning of the tree that lists buildings which provide archers and other missile units...

 building missiles 
 { 
 levels practice_field archery_range catapult_range siege_engineer 
 {

the first line is the building type. After the opening curly bracket the levels of that building type are listed (space-delimited and with "levels" preceeding).

You can designate your own names for the building type should you wish to not make them universally available to all factions/cultures. However, core_buildings (aka government buildings), walls and hinterland buildings (roads, mines, and farms) cannot be factionally or culturally designated (though some of their levels may be excluded from certain cultures/factions).

For example, you could have:

 building missiles_roman 
 { 
 levels practice_field archery_range catapult_range siege_engineer 
 {

Which of course could be used to specify a purely roman tree of such buildings. Remember not to change the names of the levels (though you may choose to not use some or allow only certain roman factions their use).

Building Blocks - Requirements

The tree then lists a block of code for each building (i.e. each of the levels declared). Continuing from our example above we will look at the first level of the "building missiles" tree, the practice_field:

 practice_field requires factions { barbarian, ct_carthage, eastern, parthia, egyptian, greek, roman, }
 {

The first line states the requirements necessary to be satisfied in order for the building to be available for construction. All factions reside within the 6 hard-coded cultures, and so this particular building can be built by all factions. Any combination of factions/cultures can be listed. Both visible and hidden resources can be used as requirements as may "building_present_min_level x y" where x is the building type and y the level of that building type. This latter simply requires a certain minimum level of building of a building type to be present in that settlement before the practice_field can become available for construction. The connector "and" can be used to compound requirements, for example:

 practice_field requires factions { barbarian, roman, } and resource iron and hidden_resource woodland 
 and building_present_min_level market trader
 {

Full List of Requirements

resource
hidden_resource
building_present (as building_present_min_level except that it tests for the buidling type only - e.g. building_present barracks)
building_present_min_level
marian_reforms
factions { x, }

The connectors "or" and "not" can also be used in addition to "and". X represents a faction, culture, a list of the same - or all ("all,"). To find out more about how to use requirements and connectors take look at this thread: http://forums.totalwar.org/vb/showthread.php?postid=642173

Note 1: Not conditionals (even if true) and positive conditionals that result false seem to break the culture/faction for the slave faction if those buildings are placed at game start - see this thread: http://forums.totalwar.org/vb/showthread.php?t=81322

Note 2: All of the above can be used as capability requirements too though the building_present/building_present_min_level should not be used for recruitment lines as it will cause a CTD when the player uses the right-click feature added in later versions of RTW.

Building Blocks - Capability

Example:

 capability
 {
 recruit "carthaginian peltast" 0 requires factions { spain, }
 recruit "barb peltast gaul" 0 requires factions { gauls, }
 recruit "barb peltast german" 0 requires factions { germans, }
 recruit "barb slinger briton" 0 requires factions { britons, }
 recruit "barb archer dacian" 0 requires factions { dacia, }
 recruit "barb archer scythian" 0 requires factions { scythia, }
 recruit "carthaginian peltast" 0 requires factions { carthage, }
 recruit "carthaginian archer" 0 requires factions { numidia, }
 recruit "east peltast" 0 requires factions { armenia, pontus, }
 recruit "east slinger" 0 requires factions { parthia, }
 recruit "egyptian peltast" 0 requires factions { egyptian, }
 recruit "egyptian slingers" 0 requires factions { egyptian, }
 recruit "greek peltast" 0 requires factions { greek, }
 recruit "roman velite" 0 requires factions { roman, }
 recruit "roman light infantry auxillia" 0 requires factions { roman, } and hidden_resource gondor
 recruits_morale_bonus bonus 1 requires factions { dacia, }
 }

The Capability section lists the capabilities (i.e. the recruitment capability and building effects) of any given settlement which contains this building. The pool of potential requirements that can be attached to both recruitment and effect lines are basically the same as those used for the building's construction requirement (see above).

Note that if you use the marian_reform requirement then it has been reported that it needs to go at the end.

The "0" listed with recruits refers to the level of Experience the unit begins with when first recruited. It can of course be any number between 0 and 9.

Capability requirements

Much the same as the building requirements listed above. The following one, however, can only be used in the capability lines though it does not seem to work properly anyway:

building_factions { x, } (does not seem to work but is supposed to test if the building was originally built by faction/s x - read more about the testing in the EDB discussion thread)

I here list all known capability effects (which I sort by approx. category for your convenience):

Full List of Building Effects

  • happiness_bonus (public order due to happiness) 1-x (5-x%)
  • population_growth_bonus (pop. growth) 1-25 (0.5-12.5%)
  • law_bonus (public order bonus due to law) 1-x (5-x%)
  • population_health_bonus (public health) 1-x (5-x%)
  • trade_base_income_bonus (increases trade goods) 1-32767 (10-327670%) - adds 10% to base value of land trade & sea exports (source: experimentation; Suppanut)
  • farming_level (farms) (farms and food pruduction improvement) 1-5 (1-5) [5]
  • population_fire_risk_bonus (reduces risk of fire) *
  • taxable_income_bonus (tax income bonus) 1-32767 (10-327670 add to tax income directly) (source: experimentation; Suppanut)
  • trade_level_bonus (increase in trade) - affects land trade only
  • population_loyalty_bonus (public order) - does not appear to work
  • recruits_morale_bonus (increases morale of units recruited) 1-4 (1-4)
  • recruits_exp_bonus (upgrades XP of units recruited) 1-5 (1-5)
  • armour (armour upgrade) 1 (1)
  • weapon_simple (upgrades melee (light) weapons) 1 (1)
  • weapon_bladed (upgrades bladed (heavy) weapons) 1 (1)
  • weapon_missile (upgrades missile weapons) 1-5 (1-5)
  • weapon_siege (upgrades siege weapons) *
  • weapons_other (?) *
  • bodyguard (improves general's bodyguard) ? * (comes into effect only after Marian Reforms)
  • trade_fleet (trade fleets) 1-3 (1-3) [5] - reportedly has no effect
  • mine_resource (income from mining) 1-4 (1-4) [5]
  • road_level (improved roads and trade) 0-2 (0-2) [5]
  • gate_strength (gates) 1-2 (reinforced, iron-bound)[1] [see also 4]
  • gate_defences (gate defence) 0 (scorched sand/boiling oil)[2] [see also 4]
  • tower_level (towers) 1-2 (arrow, ballista)[3] [see also 4]
  • wall_level (walls) 0-4 (palisade, wooden, stone, large stone, epic stone) [4]
  • stage_games (allows gladiatorial games) 1-3 (1-3) [5]
  • stage_races (allows races) 1-2 (1-2) [5]
  • religious_belief [pagan/zoroastrian/christianity] 1-x (5-x%)
  • construction_cost_bonus_military (percentile cost reduction for recruitment buildings but does not seem to work) 1-100 (1-100%)
  • construction_cost_bonus_religious (percentile cost reduction for temples) 1-100 (1-100%)
  • construction_cost_bonus_defensive (percentile cost reduction for walls) 1-100 (1-100%)
  • construction_cost_bonus_other (percentile cost reduction for civil buildings but seems to apply to all buildings except religious ones) 1-100 (1-100%)
  • construction_time_bonus_military (percentile time reduction for constructing recruitment buildings but does not seem to work) 1-100 (1-100%)
  • construction_time_bonus_religious (percentile time reduction for constructing temples) 1-100 (1-100%)
  • construction_time_bonus_defensive (percentile time reduction for constructing walls) 1-100 (1-100%)
  • construction_time_bonus_other (percentile time reduction for constructing civil buildings but also seems to apply to all buildings except religious ones) 1-100 (1-100%)

Notes on above list...

[1] wooden are default though not explicitly stated
[2] does not appear to work; stone walls of any kind come with scorched sand/boiling oil
[3] default towers are watchtowers though not explicitly stated
[4] defensive capabilities seems to come with the wall_level regardless of what value they are given! See note below.
[5] see Quietus's A Comprehensive Rome: Total War Guide (Tools & Other Resources) at the end of this Guide.
[6] needs further research because it adds more taxes than it says in the building description.
For example you add taxable_income_bonus 25, in the building description it will say "Tax income bonus: 25%" and with 400 people you would normally get 328 denari now you would get 914 which is an increase of
about 179% but it messes up the tax system. (for more information see: http://forums.totalwar.org/vb/showthread.php?37831-Tax-Income thanks to Therother)
* untested or unknown use

Notes on format...

Effects containing the "_bonus" element in their name should be coded with a stand-alone "bonus" added before the integer even when there is a "bonus" in the effect's name itself. E.G. population_growth_bonus bonus 1. However, population_growth_bonus bonus +1 also works. Sometimes omitting the "bonus" does work but can cause problems - for example, the building scroll may not display the actual bonus (even though it works), and no negative number can be introduced because the engine looks for either an integer (not a number with a "+" or "-" before it in this case) or the word "bonus".

In the original file farming_level, armour and the various weapon effects sometimes carry the stand-alone "bonus" and sometimes do not. It would seem that the cumulative and desired effect would necessitate "bonus" in each usage, but I do not know why this is not the case in the original file. "Armour 1" (for example) seems to ensure the armour attribute of the unit is 1 above the EDU-stated armour but is not cumulative (however, it does not seem to reduce higher armour so it is not setting the armour variable to "1"). So it also seems sensible to always use the "bonus" before integers for this grouping of effects.

Trade_fleet, mine_resource, road_level, and the games, races and the four defensive effects carry no stand-alone "bonus" in the EDB file.

Negative effects...

population_growth_bonus bonus -5 displayed the expected -2.5 in the building scroll but seemed not to affect the settlement population growth indicator on the settlement scroll. The same seems true for law_bonus and happiness_bonus. religious_belief , however, does seem to work in the negative (this needs more testing).

Notes on (hardcoded?) defensive effects...

The following defensive buildings (walls) seem to entail the following effects:

Palisade - wooden gate - arrow towers

Wooden wall - reinforced gate - arrow towers

Stone wall - reinforced gate - arrow towers (incendiary ability) - boiling oil

Large stone wall - iron gates - arrow towers (incendiary ability) - boiling oil

Epic stone wall - iron gates - ballista towers (incendiary ability) - boiling oil

Building Blocks - Faction_Capability

These are similar to capabilities except they are applied faction-wide rather than just in one settlement (regional). For example, inserting:

 faction_capability
 {
 construction_time_bonus_defensive bonus 50 requires factions { parthia, }
 }

after the Capabilty block of a building (and before the construction line) will, when such a building is built by Parthia, reduce building times of defensive structures (i.e. walls) by half in all Parthian settlements.

Building Blocks - End

The end of each building block comprises the construction time (in turns), the cost, the minimum level of settlement necessary for the building in question to be built, and upgrades (if any). Note that the latter is quite correct to be in the plural - you can list more than one upgrade (top-level buildings should of course have no upgrade listed).

 construction 3 
 cost 1200 
 settlement_min large_town 
 upgrades 
 { 
 archery_range 
 } 
 }


You will find "plugins" at the very end of the building trees - ignore these, they cannot be implemented.

Note on Barbarian Building Trees

Although factions in the barbarian culture apparently can be designated 4th and 5th level settlements at game start there seems no mechanism for triggering upgrading past a third level settlement in the game itself. In other words the Barbarian culture is limited in its upgrades to (from a village) town - large town - city. It cannot upgrade to large or huge cities. You can read more about this in this thread: http://forums.totalwar.org/vb/showthread.php?t=49691 Of course, in BI this has all changed and all cultures may upgrade through all five government buildings.

Note on Building Names & Descriptions

The names and textual descriptions of all buildings (inc. the universal ones such as core_buildings) can all be specified per faction (as can building requirements, capabilities and faction capabilities of course). Dol Guldur has written a tutorial on this at http://forums.totalwar.org/vb/showpo...2&postcount=56

Note on Multiple Temples & Indestructibility of Buildings

Although some modders have reported that it is the initial prefix of the temple buildings (levels) that allows these buildings to be built in the same settlement as temples, other research shows that removing the prefix in just the tree name will bring the same result (but without having to change all the other files associated with advice, traits, ancillaries, sound etc.)

Following this same logic we can now add the "hinterland_" prefix to building tree names to make previously destructible buildings indestructible - that is, it will disable the hammer button in the building scroll.

Note on Associated Files

data\export_buildings.txt

This file lists the in-game textual description of the building name, the building description, and a short version of the building description. It should match the code name in the EDB.

This file also contains the "_name" elements which provide the text for the building thread summaries (i.e. the text for each building type in the in-game Building Browser).

data\text\export_descr_buildings_enums.txt

This file enumerates the tags for the textual descriptions of the building names and descriptions (long and short). It seems to be an obsolete file.

data\descr_ui_buildings.txt

From discussion thread (thanks to Nikolai1962):

bunch of lines in this file of the form

temple_of_battle_shrine shrine temple_of_battle_temple temple temple_of_battle_large_temple large_temple temple_of_battle_awesome_temple awesome_temple temple_of_battle_pantheon pantheon temple_of_farming_shrine shrine

what these all do is give the game an alternative name to look for when loading a building graphic. so in vanilla in tells the game for all the different temple buildings all the shrine level ones load the shrine graphic etc.

This can save on the number of graphics you have to keep track of, rename etc. For example if you had modded the game to have seperate barracks for each of the barb factions called brit_barracks, gaul_barracks etc, instead of having a separate graphic for each one you could write

brit_barracks barracks gaul_barracks barracks etc.

in this file and the game will look for the graphic called "#barbarian_barracks" in the UI folder/pak file.

Nero666 reports that deleting either of the lines referencing Carthaginian near the start of the list in the DUB file will overcome the problem of not being able to add that culture to new buildings without causing an error. For more information please see link below: LINK: http://www.twcenter.net/forums/showthread.php?t=13734

Tools & Other Resources

Required programmes: Notepad (or other text editor)

Optional tools: Hadrian building editor, Excel macro for recruit lines

EDB Recruit Lines Excel Macro by Godless Graham http://forums.totalwar.org/vb/showthread.php?t=49448

Hadrian building editor by GodsPetMonkey http://www.twcenter.net/downloads/db/?mod=245

Quietus's A Comprehensive Rome: Total War Guide (visit Economic section to read how buildings affect trade) http://forums.totalwar.org/vb/showthread.php?t=45315


External Links

Related Posts:

Initial content for this article was based on: Org Scriptorium Article

Posted here with the permission of the original author: Dol Guldur

Please note that the content may have been altered since import. Subsequent amendments are welcome but are not the responsibility of the original author.