Total War: WARHAMMER III

Total War: WARHAMMER III

Fully Custom Garrison - 6.x Update
BlackJackGear  [developer] 8 Apr @ 2:07pm
Submodding Guide
This guide lists all the db tables and how the entries should be set up for compatibility with the main mod.
Fair warning, this is not really difficult but very tedious.
Garrison Generation
This section describes how to change which factions get access to existing units.
This is relevant if the unit is already included in the submod and you only want to change its availability for garrison generation.
building_culture_variants_tables
This is the only table necessary for adjusting unit access.
Things to keep in mind:
1. Every building in building_levels_tables MUST have an entry in building_culture_variants_tables!
2. NEVER change player buildings, only those that DONT end with "_player"!
3. Don't edit my submod directly, make a new one with your changes.

Now how to actually change access?
First column (building) needs the building key from building_levels_tables. (This is just "bjg_building_level_" + key_of_unit_from_main_units_tables).
Next three columns are culture, subculture and faction, put here the culture / subculture / faction for which you want to enable / disable the unit.
Description and Icon can just be "wh_main_PLACEHOLDER" and "empire_reiksfort", they are not important.
If you want this entry to disable the building check the disabled box otherwise it will be enabled.
Keep the rest the same as in my submod.
These changes are for both player and ai, since player garrison generation uses the same buildings to model building permissions.

And that's it, with this you can adjust garrison generation to your liking.

Full Setup
This section describes how to set up full compatibility with new units.
armed_citizenry_unit_groups_tables
Requires two entries for every unit you want to be compatible, one for ai and one for player,.
My name is usually "bjg_unit_group_{unit_key_from_main_units_tables}", but can be anything.
The player entry is usually named the same as the AI entry with "_player" added at the end.

armed_citizenry_units_to_unit_groups_junctions_tables
Requires two entries for every unit, one for ai and one for player, and links the unit to the unit groups from the previous table.

Id:
Must be unique globally !

Priority:
For the AI entry this is the custom battle cost + 100, tho you can set this to anything you want.
For the player it is custom battle cost + 5000, to always replace have higher priority then units from buildings.
Heroes have this resulting value multiplied by 10 so that they always have higher priority then regular units.

Unit:
This is the unit key from the main units tables.

Unit Group:
This is the key from the unit group table above.

building_chains_tables
Requires two entries for every unit, one for ai and one for player.
Fields not mentioned here are either empty or mostly unimportant, if in doubt check my compatibility submod.

Key:
The naming is important here, the entries must be named like this "bjg_chain_{unit_key_from_main_units_tables}" and "bjg_chain_{unit_key_from_main_units_tables}_player".
Otherwise my scripts will not pick up on the units correctly.

Chain Category:
military - but can be anything really

Building Superchain:
Very important, this links the units to their categories and the MCT options for garrison composition.
Naming need to be like this "bjg_superchain_{unit_category}"
Supported categories are currently: warmachine, chariot, monster, melee_infantry, missile_infantry, monstrous_infantry, melee_cavalry, missile_cavalry, missile_cavalry, hero and generic.
Generic is the fallback if you don't know where to put the unit.
If you create a new superchain and put it here it will fallback to the MCT Fallback option as a last resort.

Optional Sort Order:
Unit tier, 6 for heroes, is not strictly necessary tho.

Can Be Dismantled:
true

Is Foreign Slot Chain:
true

building_chain_set_items_tables
Requires two entries for every unit, one for ai and one for player.

Chain:
The key for the chain from the building_chains_tables one entry for player and one for ai.

Set:
Must be bjg_bcg_garrison_building_chain_set for all entries.

building_chain_availability_sets_tables
Requires two entries for every unit, one for ai and one for player.

Chain:
The key for the chain from the building_chains_tables one entry for player and one for ai.

Id:
Must be everyone for all entries.

building_levels_tables
Requires two entries for every unit, one for ai and one for player.

Level Name:
Naming is important here, must be "bjg_building_level_{unit_key_from_main_units_tables}" for ai and "bjg_building_level_{unit_key_from_main_units_tables}_player" for player entries.

Chain:
The key for the chain from the building_chains_tables one entry for player and one for ai.

Level:
Must be 0.

Create Time:
Important, this has to be the number of turns it takes to recruit the unit.

Create Cost:
Important, this has to be the recruitment cost of the unit.

Building Instance Key:
This has to be "bjg_ai_garrison" for ai entries and "bjg_player_garrison" for player entries, at the moment there is no difference so not an issue if mixed up.

Can Convert:
false

Should Show Building In Ui for Technology:
false

Can Be Damaged:
false

Primary Building Slot Requirement:
Should be unit tier, but has no real effect.

Visible In UI:
true

Additional Loot Value:
Unit upkeep value.

building_level_armed_citizenry_junctions_tables
Requires two entries for every unit, one for ai and one for player.

Id:
Must be unique globally !

Building Level:
Key from the building levels table.

Unit Group:
Key from the unit groups table.

settlement_type_to_building_chains_junctions_tables
Requires 14 entries for every unit, 7 for ai and 7 for player.
At the moment every chain requires 14 entries, split between 7 player and 7 ai ones, example below:

bjg_chain_{unit_key_from_main_units_tables} wh3_dlc23_chd_factory
bjg_chain_{unit_key_from_main_units_tables} wh3_dlc23_chd_outpost
bjg_chain_{unit_key_from_main_units_tables} wh3_dlc23_chd_tower
bjg_chain_{unit_key_from_main_units_tables} wh3_main_dae_khorne
bjg_chain_{unit_key_from_main_units_tables} wh3_main_dae_nurgle
bjg_chain_{unit_key_from_main_units_tables} wh3_main_dae_slaanesh
bjg_chain_{unit_key_from_main_units_tables} wh3_main_dae_tzeentch
bjg_chain_{unit_key_from_main_units_tables}_player wh3_dlc23_chd_factory
bjg_chain_{unit_key_from_main_units_tables}_player wh3_dlc23_chd_outpost
bjg_chain_{unit_key_from_main_units_tables}_player wh3_dlc23_chd_tower
bjg_chain_{unit_key_from_main_units_tables}_player wh3_main_dae_khorne
bjg_chain_{unit_key_from_main_units_tables}_player wh3_main_dae_nurgle
bjg_chain_{unit_key_from_main_units_tables}_player wh3_main_dae_slaanesh
bjg_chain_{unit_key_from_main_units_tables}_player wh3_main_dae_tzeentch

Every chain from building chains tables needs an entry for wh3_dlc23_chd_factory, wh3_dlc23_chd_outpost, wh3_dlc23_chd_tower, wh3_main_dae_khorne, wh3_main_dae_nurgle, wh3_main_dae_slaanesh and wh3_main_dae_tzeentch.

If these entries are missing the unit buildings cant be built in those special settlements.

building_set_to_building_junctions_tables
Requires two entries for every unit, one for ai and one for player.

Building Chain:
The key for the chain from the building_chains_tables one entry for player and one for ai.

Set:
Must be "bjg_building_set_garrison" for ai and "bjg_building_set_garrison_player" for player chains.

building_culture_variants_tables
Now we get to the most interesting table, this one must have at least 1 entry for every building in the building levels table, so at least 2 for every unit.
With this table we control which factions actually get access to the units for their garrison generation.
FOR AI ENTRIES
Its pretty straightforward, put in the key from building levels, then either culture, subculture or faction, depending on whom you want to have the building.
If you want to give it to a subset of a culture or subculture, you can work with the disable column, for example see drycha in the main mod or something like orcs.
If you have an ai building variant but dont want it to be accessible to anyone assign it to faction "wh_main_chs_chaos_qb1".
FOR PLAYER ENTRIES
All the player buildings go to the faction "wh_main_chs_chaos_qb1" nowhere else!

Description and Icon can just be placeholders since the buildings are never visible ingame.


Thats it congrats on reading all this lol.
If you really want to go through all this in any meaningful capacity I suggest automating it or just asking me to add it to the submod.
Last edited by BlackJackGear; 16 Apr @ 2:44pm