Total War: WARHAMMER II

Total War: WARHAMMER II

76 ratings
Creating and Editing Buildings
By Cryswar
This guide will muck about with buildings, explaining how to edit/create them and offering ideas of how to make unique and interesting ones.
2
7
   
Award
Favorite
Favorited
Unfavorite
Preface
As with every guide I write, I will be shilling the Rusted Pack File Manager[github.com] to no end. I've explained how to use it previously (unit creation guide) so I won't waste further time with it here.
Buildings Overview
So first off let's discuss how buildings do.

As a very loose overview, building chains and superchains (some overlap, but think barracks 1-3; all three are part of the 'barracks' chain and superchain) are all part of a Building Set, aka "advanced military buildings" or "basic military buildings." Buildings can have Effects linked to them to increase unit caps or give extra gold per turn, or unlock recruitable units (again, barracks).

All things considered they're pretty intimidating at first blush but actually very simple and easy once you get a handle on them, so let's get started!
building_superchains
A building superchain is a... super... chain... ok all joking aside it can be a collection of chains or be defined for just a single chain, depending on what you're doing. For example, in vanilla, most races barracks belong to the same superchain.

HOWEVER, I will note that putting multiple buildings in the same superchain for the same faction can lead to very annoying UI issues. So for safety's sake, I'd generally recommend making a unique superchain for each building chain you make.

The table itself is very simple - just one box. Call it whatever you want, but as always try to stick to a reasonable naming scheme, you'll need this later.
slot_template_to_building_superchains
This is another simple table, but to go through it quickly;

  • ID should be unique, as usual.
  • Superchain is the key we JUST filled out last section.
  • Slot Template tells the game where the building goes - is it a horde secondary building, like the Chaos Warriors chain? Is it a horde primary building if you're making a completely custom faction? Is it a secondary building you can only build in Altdorf like wh_main_special_altdorf_secondary? You can have multiple slot templates linked to a building superchain - look up say, wh_main_sch_human_barracks, there's like 50 bloody slot chains you can build it in! If you're making a horde it's much easier, horde_secondary is pretty much all you'll ever use normally.

Note that in Warhammer 3, slot_template_permitted_building_chains is the table instead. When I update this guide properly for tww3 I'll rewrite all this
building_chains
This is where we define a building chain inside of its superchain. You can have multiple chains linked to a superchain if desired.

  • Key is the exact same deal it always is - keep it unique, keep it simple, and copy it over to Notepad or whatever so you can access it again easily.
  • Tech and Encyclopedia groups are unused in vanilla, leave 'em blank.
  • Chain Category is generally military or money, rarely happiness, with a few special exceptions. I don't think they actually DO anything but I try to fill them out anyways just in case there's some weird edge case where they matter.
  • Superchain is where you put the superchain its linked to.
  • Optional Sort Order lets you decide where in the building set the building shows up - negative sort order pushes it to the left, positive to the right. Size matters; -5 pushes it further left than -4. If you're not sure/don't care, just leave it at 0 and game will handle it. Poorly.
  • Optional Required Horde Commander is rarely used but very powerful - this field lets you set buildings to only be buildable by a specific agent_subtype. In vanilla I believe this is only used by the Vampire Coast legendary lords to get their special buildings, but you can do alllll kinds of zany shenanigans with this when modding.
building_chain_availability_sets
VERY simple table - this links a building chain to an availability set. wh_main_bas_chs makes it available to all Chaos factions for example. Unless you're making a super hella mega custom faction, just use a vanilla availability set and you're done.
building_instances
This table lets you define how many of a given building you can make. In almost all circumstances, that will be 1 - though if you want to make people pick between different chains or whatnot you can enter a higher number here.
building_levels
Heeeere we have a juicy table finally! There's lots of things to look out for here, I'll try to catch them all. As a rough overview though, this table is where you tell the game WTF a barracks actually is - how many levels it has, what each one costs to get, what requirements it has, etc.

  • Level Name - Yada yada unique and all that. Needs a separate row for each level of the building desired. Single tier buildings can just use the chain name or whatever, but most buildings have multiple levels so I would recommend numbering them properly for easy reference; if you're making a new Empire Barracks building with 3 levels, you will create 3 new entries, maybe named emp_barracks_1, emp_barracks_2, and emp_barracks_3
  • Chain tells the game what chain this level is part of.
  • Level STARTS AT ZERO, NOT ONE - game will crash when you try to select the building if you make the lowest level of a building 1 instead of 0! Beyond that, it's simple; first level is 0, second level is 1, etc.
  • Create Time does exactly what it says on the tin. Most horde buildings only take 1 turn to complete, for 'normal' buildings I would recommend copying from the nearest vanilla building for reference.
  • Create Cost is the base cost of the building in gold/dark magic/favor/whatever the hell the faction's equivalent of money is.
  • Upkeep Cost isn't used much in vanilla, but if you want to make people lose money every turn for having this building, this is a way to do it.
  • Commodities, Only in Capital, X Prestige, Faction Unique, Religion Requirement, First in World Bundle, Resource Requirement are all unused in vanilla and should be left blank/at 0 as appropriate.
  • Can Convert means that the building can be converted/destroyed; should be checked unless you have a very specific reason not to do so.
  • Building Instance Key links to your instance, no surprise there.
  • Development Point Cost is used almost exclusively for horde buildings and settlement main buildings in vanilla, but you can add a cost to any building you want. This costs population surplus. Hordes have increased cost for each additional building (either +2 or +4 per building I forget); that is added to this number to get the actual ingame cost. So just 'cuz something says it costs 2 dev points here doesn't mean it won't cost 4 or 6 ingame after a building or two.
  • Can Be Damaged should be defaulted to on unless you specifically want it to be immune to damage.
  • Primary Slot Building Level Requirement starts from 0 if you're a horde, 1 if you're a normal faction, and means the primary building of the horde/settlement. In other words, a requirement of 1 means that your main building needs to be level 1 or higher, whereas level req 4 for a horde means tier 5. Confused? You should be. Dagnabbit CA.
  • Visible in UI should probably be on. You know. If you want to see the building. You could probably leave this off if you wanted to make an invisible building with some background effects, but that'd require scropting/startpos to put into settlement and would still waste a slot so... yea.
  • Food Cost is used in vanilla for some Wood Elf buildings. And yes, Amber is technically Food, explains a lot about those poncy gits actually.
  • Slave Cap Contribution is really only used by Dark Elves in vanilla, but if you added/edited a faction that had slaves this would let you increase the cap for them too.
building_culture_variants
Yay, another fun table!

This one links to each building level you just finished, and is used to limit buildings to a particular culture/subculture/faction, link it to its description, and give a UI icon for it. Mostly very simple but...

  • You can require multiple of culture, subculture, and faction. For example, in vanilla, Norscan stuff generally requires both the wh_main_chs_chaos culture AND the wh_main_sc_nor_norsca subculture. However, 99% of the time you can just have a faction lock or culture lock and it'll be fine - if you link it to your custom Chaos faction, you don't need a wh_main_chs_chaos culture requirement, that's already a given since your faction can only be Chaos.
  • Icon can just be jacked from a vanilla building.
  • Disables isn't used much, but if you want a certain building to be available to say, the tomb kings culture but NOT arkhan, you can use two rows - one set up normally, and the other set up specifically for Arkhan's faction wh2_dlc09_tmb_followers_of_nagash and check Disables for the Arkhan row.
building_upgrade_junctions
This table is how you tell the game that emp_barracks_1 links to emp_barracks_2, and that barracks 2 links to level 3, 3 links to 4, etc. You'll need one row for each part of the link. For example;

chaos_slaanesh_1 chaos_slaanesh_2
chaos_slaanesh_2 chaos_slaanesh_3
building_sets
This table is rarely used, but included for completion's sake anyways.

A building set is a... set... of buildings... ok, look, you know how most factions have Basic Military and Advanced Military tabs? those are building sets. Most custom buildings can just go into an existing set, but if you want to make a new set specifically for lord-unique buildings for your Chaos mod, or 'Army Magic Support' buildings or whatever, you will need to make a new set for them here.
building_set_to_building_junctions
Unlike the last one, this table is required for any new building. There's a variety of ways you can do it - you can either link each level individually to a set, ex. in vanilla wh2_main_brt_resource_dyes_1, wh2_main_brt_resource_dyes_2, and wh2_main_brt_resource_dyes_3 are all separately linked to the wh2_dlc09_set_brt_dyes_pottery set. Or you can just link the full chain in one fell swoop, a la wh2_dlc11_special_ship_aranessa chain is linked to the wh2_dlc11_set_ship_unique set.

I personally find chain linking to be much faster and easier whenever possible, but depending on what you're doing building wise you may decide to do level linking instead.
building_effects_junction
This is one of my favorite tables and also one of the most potentially complex - unlike say, character_skills_to_effects, there's an almost dizzying number of scopes to worry about here and far more that are commonly used. However, in return, there are a ton of options! I'll go over the base mechanics real fast and then discuss how it can be used.

  • As with skills, you will need a separate row for each effect for each level of the building. This is VERY important to keep in mind - if you want a 20% upkeep reduction for the building, you have to apply that effect separately for every level of the building you want to have it.
  • Beyond that, building level / effect links work the same as they do with skills; you tell the game the building level and then the effect linked to it. Check my skill/effect guide if you're not familiar with effects in general.
  • Effect Scope works the same as usual, but keep in mind that you have to use building to X scopes for MOST things... but not always; especially for hordes you may use scopes like force_to_force_own regularly. Be sure to check similar things in vanilla! There are so many scopes it can get VERY confusing fast.
  • Value works exactly as it says on the tin. Value Damaged is a lesser value for when the building is damaged.
  • Value Ruined is almost always 0, but for stuff like main building settlement slots it doesn't change (ex. a ruined T5 capital may have 9 slots regardless of how damaged it is) and some income buildings may offer a small % of their income even when ruined.

Now, what can you actually do with these effects? Well... a lot.

Growth can be defined here - you'll need to use different effects for 'normal' city growth (wh_main_effect_province_growth_building, used at region_to_province_own scope) vs horde growth (wh_main_effect_hordebuilding_growth_core, used at force_to_force_own scope) but the idea is the same.

Income is commonly termed GDP in vanilla effects. There are many vanilla effects about this, though many do basically the same thing. You can make your own in effect_bonus_value_basic_junction if desired but vanilla has a really good variety so for most purposes you won't need to. Hordes can be given 'generic' income via wh_main_effect_economy_gdp_culture at scope force_to_force_building, normal factions can use that effect (scope: building_to_building_own) or any of the many other existing effects depending on what you want the income to show up as coming from.

Buffs are rarely used in vanilla, but are available to both horde and normal factions. Think the Beastmen building that gives stats to all units in the horde. As with most effects you can use unit sets to limit the buffs to only specific unit types (ex. only Centigors or only Fimir Warriors). As a general rule of thumb, if a horde building is supposed to buff units in that horde you'll use effect scope force_to_force_own (though Noctilus's special building uses force_to_force_own_lords_army - why? no one knows!), but normal buildings (ex. Wood Elf outposts) can use a scope like faction_to_force_own to give it to all armies factionwide, or you could probably try something like building_to_forces_own_regionwide to give say, armor to armies in the region you made a special garrison building. Experiment and find out!

Bonuses to recruit stats isn't something I'm an expert on admittedly but I remember it was a thing in Shogun 2, and doable here too! The simplest way I know of to do it (not necessarily the only) is to junction an existing effect like wh_main_effect_force_unit_stat_melee_attack or wh_main_effect_force_unit_stat_armour to the building with a scope of province_to_province_own ; once you get the building up, anything made in that province will get the buffs. SO FAR I haven't found a way to make it work with hordes, will update if/when I do. I am also unsure if it's possible to link this to sets, a lot of these weirder junction types (ex. effect_bonus_value_battle_context_unit_attribute_junctions which gives attributes when at sea or when fighting dark elves etc) have no support whatsoever for unit sets. So you may have to just settle for "+5 melee attack to ANYONE recruited here." Again, will update if I figure out how to do that.

Unit Caps are also done here! Think Tomb Kings - each Warsphinx building you make is +1 cap to Khemrian Warsphinxes - the building itself only lets you recruit them, it's actually an effect called wh2_dlc09_effect_unit_cap_tmb_veh_khemrian_warsphinx_0 attached to each building, scope building_to_faction_own, value of 1, that increases the sphinx cap by 1 each time you make that building. Their weaker units work the same way; barracks 1 gives +4 archers, lvl2 gives +6 or whatever I don't actually remember. You can do the same with custom units and buildings! Link your custom effect to the unit_cap bonus value ID in effect_bonus_value_ids_unit_sets, set the building-effect junction value for it to 1, set the base campaign cap to whatever baseline you want, we'll say 1, and then each time you make that building you'll have an extra 1 of them available on top of the original baseline of 1. (You can also do this with skills).
building_units_allowed
Aaaand now we're back to my least favorite table. This one is simple, but... repetitive. As with character/building levels to effects, you need a row for every level of the building and for every unit; unlike those you also need a unique ID for each one which is a pain in the arse to do.

XP, Conditions, Faction, and Disabled are never used in vanilla; if you want to give bonus XP to what a certain unit type starts off with (ex. a unique building that gives +2 recruit rank to Helblaster Volley Guns), use the building_effects_junction table we discussed previously and (if necessary) define a custom effect, linked to unit_xp_mod bonus value ID in the effect_bonus_value_ids_unit_sets table as usual, defining and filling a custom set if needed.

Same deal if you want to muck with recruit time, recruit_time_mod bonus value ID, same setup.

Again, remember that every single level of a building needs to have every unit available linked to it in a separate row - if you have a building give access to Vargheists at tier 1, you need to give it separate entries that each also grants Vargheists at levels 2, 3, and 4 if they exist.
building_level_armed_citizenry_junctions_tables
Despite the weird ass table name and all the weird column names, this table is actually extremely simple: this is how you add units to the settlement's garrison. The format is pretty simple;

  • ID needs to be unique as usual.
  • Building Level needs to be filled out for each level that grants units, similar to effects etc.
  • Unit Group is... kinda dumb.

You can't directly add a unit to a building garrison; instead, you create a custom unit group in armed_citizenry_unit_groups_tables and add as many units as you want to it in armed_citizenry_units_to_unit_groups_junctions_tables.
armed_citizenry_units_to_unit_groups_junctions_tables
This is where you actually put units in groups for garrison purposes. Most is fairly self explanatory; unique ID, use the unit group you already defined, add the unit(s) needed. In vanilla, most groups are only one unit; if your building adds multiple units I'd put them all in the same group so you don't have to worry about more IDs and rows than necessary.

Priority is very important - if a settlement has >20 units in the garrison, it'll pick which actually show up based on priority. Low priority number will show up before high priority units - 1 is pretty much guaranteed, something like 120 will almost certainly disappear.

Heroes and monsters tend to be priority 1-20 and will almost never get pushed out, artillery tends to show up in the 120s and often does.
Text
As with most content in the game, the ingame text doesn't come from db tables, but from something called 'locs'. I assume short for localization.

These use a different folder structure, and can be imported from local_en.pack in the data folder, instead of data.pack.
building_chains.loc
This is where you actually name the building chain. As with many loc files, that means two entries;

building_chains_encyclopedia_name_
building_chains_chain_tooltip_

So say building_chains_chain_tooltip_chaos_scyla_unique

building_culture_variants.loc
This one is actually one of the most complex loc files, I'll explain what I mean in a sec.

First of all, you need one entry for each level - so say your building levels are chaos_balor_1 and chaos_balor_2, you'd start off looking at something like
building_culture_variants_name_chaos_balor_1 building_culture_variants_name_chaos_balor_2 etc.

If you have the building linked to a specific culture, subculture, or faction, you need to append the key with that. So to reuse my example above, if they're locked to the faction talons_of_tzeentch, that means the ACTUAL loc key will be building_culture_variants_name_chaos_balor_1talons_of_tzeentch and
building_culture_variants_name_chaos_balor_2talons_of_tzeentch

If you muck up the appends, the name won't appear at all - so be careful with that! If your building isn't attached to any culture/subculture/faction you can skip that step and just use building_culture_variants_name_chaos_balor_1 though.
building_short_description_texts.loc
Sort of a simpler version of the last table, this one doesn't have any shenanigans with culture/faction locking, just building_short_description_texts_short_description_ followed by your building level key, ex. building_short_description_texts_short_description_chaos_balor_3 One row for each building level as usual.

Description can be whatever you want, you can copy-paste the same description for all levels of a building if you're lazy or go fancy with your lore knowledge if you want.
building_sets.loc
You won't need this often, but including it for posterity anyways. Pretty self explanatory and simple - name and description for custom building sets here. Use the filler keys and append your building set key to them.

building_sets_onscreen_name_
building_sets_onscreen_description_
CAI Construction System
Unlike some things, like skills and units, the AI is.... really not great at making your building out of the box. At least in my experience, they never seem to make custom buildings, even if they're extremely important, like when I'm adding lord-unique horde buildings for Storm of Chaos. So if you want to do THAT, you will need to play with the CAI system a bit. How much you need to do depends a lot on how smart you want to try to make the AI about it, I'll touch on some of the basic tables below but you'll want to look through the full list and decide what you need.
cai_construction_system_building_values_tables
This seems to be the most basic 'core' table to getting the AI to understand your building. While inordinately long and complex, you won't actually need to do anything with 90% of the columns for a lot of stuff, so... yeah.

The first 10 columns are basically how you want the CAI to understand your building. Vanilla mostly uses building start inclusive/end inclusive, but you can instead just include the chain, superchain, whatever; look at how the Shrine of Khaine superchain or Tomb Kings ritual chain are handled for examples.

Score or Score Start Inclusive Start/End seems to be the default weighting for the building, the higher the more prioritized. So if you're making a building that you REALLY want the AI to make as soon as it can, set it high, like 500 or even 5000.

The next few sets of columns are identical in function but differ in scope; you can change how the AI handles it based on province or faction. You can tell it to only make 1 per faction if you want, or copy the vanilla weighting to make sure they don't build multiple, you generally don't need 4 barracks in the same province unless they offer special bonuses.
cai_construction_system_synergies_tables
This one is (imo) a little easier to understand, it's pretty well encapsulated by the name - this is how you help the AI understand "well, if I made a barracks here, I should probably make an armory too" or "well, I made this building, I guess I shouldn't make that building."

The main thing to note here is that, as far as I can tell, having both building levels and superchains filled in ISN'T optional here, for whatever reason it wants both, for both the existing building and the synergy building. Not actually hard to fill out, just a fair number of columns.

Synergy Level Key is very important because it's how the AI understands how strong the synergy or antisynergy is. Plenty of vanilla examples, and I can't really tell you how to fill it out since I have no idea what your building is. Just note that you can see how much the values are in cai_construction_system_synergy_levels_tables and even make your own if you want.

Also note the Synergy Scope Key - this helps the AI understand if you just don't want it to make 4 barracks in the same province, or if you don't want them to build cavalry in the same region as a barracks for whatever reason.

This table can be ignored if you just really want the AI to make your building in general or the building is only available in one location anyways, ex. a valuable landmark at Altdorf or a special building for a horde lord like the Vampire Coast unique stuff.
Conclusion
I could not possibly have come as far as I have as a modder without the excellent people at the C&C Modding Discord.[discord.gg] I cannot recommend it highly enough; while you won't ALWAYS get an answer, I've found it to be by far the best place to get help and interact with other modders. Plus you get to bug Vandy for scripting help!

Vandy's guide to buildings[docs.google.com] goes into more depth on how things work than mine, which mostly focuses on what you can do with them, and may be easier for you to read or impart morer valuable information. Figured I should try to give it a bit more deserved visibility.
59 Comments
Speculumundi 5 Feb, 2024 @ 7:02am 
@Oh_Man[TFE] Thanks for the tip! I was wondering why Free Company Milita and Kossars weren't showing up in a Dwarf landmark tavern I made in Karak Kadrin.
Speculumundi 5 Feb, 2024 @ 6:59am 
@WanoDark Yes. But you can already use Mixu's Unlocker for this as it includes a startpos.esf file that unlocks slot templates not included in vanilla. I think you first need to put the respective slot template from his mod (open the data.pack of his mod in RPFM) into slot_templates_tables in your own mod but in slot_template_permitted_building_chains_table in your mod you can than enter his slot template and it should work.
WanoDark 10 Jan, 2024 @ 12:41am 
Thanks a lot for the guid. But I have a question: how to create a unique landmark if the settlement does not have a unique slot template? startpos only?
Oh_Man[TFE] 22 Jul, 2023 @ 5:12am 
It was because of a base game bug causing the issue when using faction-specific landmarks.

Another issue I want to warn about:
units_to_military_grouping_permission

You need to add unit to this table for armed_citizenry if you are trying to put units in garrison that don't belong to that race (ie putting Wood Elf units into a High Elf garrison).
Oh_Man[TFE] 10 Jul, 2023 @ 8:24am 
I'm trying to get a landmark for a specific faction. The .loc part of the guide doesn't work. The landmark title AND short description doesn't appear when the faction is specified. building_chains__.loc still works.

Interestingly, when I unspecify faction, all other landmarks lose their titles and short descriptions.

Warhammer 3 weirdness... anyone know the solution??
[G-T-F] Gnombert 20 Dec, 2022 @ 9:30pm 
so i looked throu 4 guides on how to rename a building...nothing worked...finaly found this..instantly worked without any problem..nice dude...just left a token of appreciciation on top, thanks mate your guides are the best
PDV 5 Oct, 2022 @ 9:30pm 
Looks like the junction tables have changed quite a lot for TWWH3. Also, Vandy's guide is down (also down on github.io). Thanks for the guide, and I hope you can update it soonish.
mastervovan 19 Jun, 2022 @ 5:47am 
hellooo thx for guide. can u please help . mazz t4 wall mod (adds building lvl 4 walls to lvl 4 minor settlements) it doesnt work. can u help whatg to do to fix it ??
HungryBat 27 Nov, 2021 @ 9:05am 
Now I realise it has been a while, and I've made a mod that people seem to enjoy (https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2630818297) thanks to your help. I've only been using RPFM and I want to know if there is a way to remove base game code, can I purge the garrison of a building, or can modding only add code?
I know some people have said something along the lines of "set priority to 0" however in my RPFM tables, I have no idea where I can find lines like this.
If you happen to know a way of hiding building effects or remove garrisons from the base game, that would be super helpful 
xyao19 26 Nov, 2021 @ 1:24pm 
Something strange here. I made a custom building with some income buffs and new units to recruit for high elves. But both Ai and i can build it. The Ai even builds it at very begining of the game. I tried a lot of ways to make it player only following this guide but failed. In the end, i deleted all economic buffs effects in building_effects_junction_tables then it worked.

So i'm so confussed that people say that Ai will not make custom building in default. Now i want add my buffs back into my building with stopping Ai to build it, but how?