Modding Frequently Asked Questions
---Modding 101---
Getting started - Tools
If you aren't already familiar with RPFM, some important notes and features;
- Be sure to do the initial setup, linking it to the correct game and game folder. Also set the default game to your preferred option by opening preferences (ctrl+p) and selecting TWW2 from the dropdown menu near the bottom right.
- Diagnostics Tool allows you to instantly catch most errors in mods, especially broken keys in db tables which are the cause of most crashes when modding. You can enable or disable it view View->Toggle Diagnostics Window. You will also want to download the Total War Warhammer 2 Assembly Kit, then go back to RPFM, and from the menu up top, select Special Stuff -> Warhammer 2 -> Generate Dependencies Cache, which will help diagnostics tool understand almost every table far better.
- MyMod functionality is incredibly useful and powerful, allowing you to select a folder of choice to back mods up in (I use Microsoft OneDrive for instant online backups) and use the "Install" and "Uninstall" options to instantly copy mods from that folder into the data folder for testing, or remove them if needed.
- You can toggle the global search window, either via hotkey (default Ctrl+Shift+F) or from the top menu just select View -> Toggle Global Search Window option. You may wish to target the search better by untoggling 'all' and refocusing it on DB for faster searches.
However, unfortunately there is no other alternative for startpos modding, which is how you add new playable factions, change settlement slot templates for landmarks etc, and increase the number of slots in settlements (ex. making every major capital have 9 slots).
Asskit can be downloaded directly from steam, in the "tools" section of the library.
You won't actually NEED this for many kinds of modding, but it can be very helpful and efficient when messing around with skill nodes, skill locks, etc in particular, and if you end up doing any scripting Notepad++ is a solid option as well.
Getting Stated - The Basics
At its most basic, modding in TWW2 generally involves using your mod's packfile to overwrite vanilla table entries to change vanilla data, or add your own entries to create new units, skills, etc. in addition to vanilla stuff.
In most cases, this will involve viewing vanilla values from data.pack, then copying them to your own mod's pack and changing/adding as needed. You DO NOT edit data.pack itself, to be sure we're clear here.
For example, if you want to add a new effect to the Dark Elf confederation penalty bundle, you'd find the bundle's key (wh2_main_bundle_confederation_def), create your effect_bundles_to_effects_junctions table, and attach a new effect to that bundle's key (say, idk, replenishment).
If you want to CHANGE the existing effects, in most cases you use the same effect at the same scope, but with a different value. In this case, maybe you don' like the -40 relations penalty, so you use wh2_main_faction_diplomacy_penalty_dark_elves_confederation, scope faction_to_faction_own, but change the value to -2 instead of -8.
Some tables work in a manner that makes them very difficult or impossible to overwrite without data coring the entire table, which absolutely obliterates compatibility with other mods and should be avoided like Nurgle's plague unless ABSOLUTELY necessary. Other tables, like effect bundles, things can be overwritten but not easily removed. In those cases it's generally better to just overwrite a vanilla value with 0 and deal with some wasted space on screen rather than worry about getting everything looking perfect. If you data core effect_bundles_to_effect_junctions without a REALLY good reason and a clear warning on your mod page, I hate you.
Creating a Mod
You can name the mod whatever, but remember to use underscores instead of spaces and keep it simple. And be sure to have the correct game selected!
Adding Tables
- Right clicking on the packfile icon->add->add from packfile->navigate to Steam\steamapps\common\Total War WARHAMMER II\data->open data.pack->open the DB folder->doubleclick on the tables you want to add, then delete all entries in the table and rename it
- Ctrl+d or right clicking on the packfile->create->create DB and fill it out
For simple DB editing purposes, the latter is infinitely faster, easier, and simpler, with the added benefit of letting you name the table and not having to clean it out. However, it is good to know the former because for some purposes, like variants, you will need to use that approach, though for them you would generally go to variants.pack or variants_2.pack instead of data.pack.
If you do add a db table the first way for whatever reason, an easy way to clean it out is to use Special Stuff->Warhammer 2->Optimize Packfile.
Don't forget to rename the table! leaving it as data__ is called data coring, making your table COMPLETELY replace the vanilla one, and will destroy compatibility and probably cause crashes. The name doesn't have to be unique within the pack (you can name everything malekith_bacon), but should be unique compared to other mods (so maybe crys_malekith_bacon).
Learning How To Learn
Below I will include many of the questions I've seen asked often, but you can actually just figure them out for yourself pretty easily in most cases by perusing CA packs, either opening data.pack from the data folder, or you can 'open all CA packfiles' instead.
In general, if you understand what effects, skills, and abilities are and how they connect, you'll be able to make sense of other stuff much more easily, since much of the game plays into one of those three, whether it be buildings with effects or effects that grant abilities to units.
You can also use the aforementioned global search in RPFM (or asskit) to find info on something - for example, if you want to change the High Elf confederation penalties, global search "confed" or "confederation" and it won't take too much skimming to see that effect_bundles_to_effect_junctions is a place to edit those per-race.
Using the tree view on the left, if you want to learn more about abilities, or what all tables cover that, you can type in a one-word query, or even a part of a word, to get all tables with that text in their name - to use abilities for an example again, searching for "ability" or "abilities" will miss some, so just searching "abilit" will catch both. Some things can be ass to search for, but in general this can help a lot.
Or maybe you just want to see how the Poison phase works, search "poison" and you'll see all the ways it can be applied to units/lords/etc via effects, but further down the list you'll also it has entries in special_ability_phases_tables and special_ability_phase_stat_effects_tables to work with.
Note that column headers can be moused over and will often (not always) have a short description of what the column does; if that columns links to a key somewhere else, mousing over the header will generally tell you exactly which table it's drawing the key from.
---------
You can use these kinds of techniques in this guide as well, and in fact I highly recommend it! Ctrl+f for "spell" or "ability" to get to that section quickly, and I've tried to use some of the more common attributes, mentions of magic/fire damage, etc. to make them easier to find even if you don't actually know what an ability is or what Stalker is.
Uploading a Mod
- Your mod's packfile should be in the data folder, which you can reach at any time in RPFM via game selected->open game's data folder.
- A .png image file in the data folder, with the exact same name as your mod's packfile. Ex. if your mod is named crys_nude_malekith.pack, this png should be crys_nude_malekith.png.
- The .png should be roughly square-ish, and not too big, sub-1mb for safety, ideally
- The exact dimensions of the image aren't that important, most modders use ~250-500 width/height. Just don't try to use something 5000x5000 and be surprised when it doesn't work.
- You can't change the packfile's name for an uploaded mod. You CAN change the display name and description on the Steam page anytime. So pick a packfile name you like, and is relatively informative, but don't worry about capitalization and underscores and stuff.
Assuming you have everything set up right, you then open the vanilla game launcher, click on Mod Manager, find your mod in the list, and click on the little folder icon. Follow the basic instructions and agreements from there.
---FAQs---
Faction Bonuses
Note that frontend_faction_effect_junctions_tables is solely visual, but changes the displayed faction effects in faction select, so you'll want to edit that too for visual consistency.
Lord Bonuses
How do I add Poison or Magic Attacks?
Ok, first off, let's make a clear distinction between Contact Phases like Poison, Sundered Armor, or Madness of Khaine, and toggles like Magical Attacks or Flaming Attacks. A unit can have any combination of Magical Attacks or Flaming Attacks simultaneously, but can only ever have one active phase - phases replace each other, so you can replace Poison with a better poison, but not have poison AND better poison.
Note that this is true even if a unit has a built in phase, ex. if you had a Witch Elf in Khalida's army, she would lose her Madness of Khaine contact effect and gain Poison instead.
That said, if you want to innately add a phase to a unit's melee attacks, use the melee_weapons_tables table, specifically the "Contact Phase" column. This will add the phase to every instance of that unit forever, great if you want all Empire Swordsmen to Discourage anyone they attack, not so great if you only want to add that contact phase to swordsmen in Karl Franz's army.
If you want an effect to grant Poison to every unit in the scope, ex. lord's army or factionwide (please don't do this), effect_bonus_value_special_ability_phase_record_junctions_tables does the job. In vanilla, this is usually used with scope character_to_character_own (for a lord, or scrap upgrade) or general_to_force_own, like Helman's Blight.
Unfortunately you cannot add a melee phase to a unit set directly via effects - If you really want to add Discourage to Empire Swordsmen, you'll have to use a passive ability that imbues the unit with a permanent phase, and in that phase's 'Imbue Contact" column, fill in the desired negative phase, in this case wh_dlc06_unit_contact_discouraged, then use unit_set_unit_ability_junctions_tables and effect_bonus_value_unit_set_unit_ability_junctions_tables to tie the ability and unit set together to an effect that you can then finally, put onto Franz's skill with scope general_to_force_own. Yes it sucks, but such is life.
Ranged weapons work similarly and cannot directly have a phase added, HOWEVER, they do have another option: you can switch out missile weapons for units via effects, using unit_missile_weapon_junctions_tables and effect_bonus_value_missile_weapon_junctions_tables. Note that this calls for the main_unit key and does not include unit sets, but you can have multiple rows, so you add as many units as desired.
Melee Weapons
As with many things in modding, there are multiple ways to edit or affect these depending on exactly what you want to accomplish.
If you want to edit every single Chaos Spawn in the game to have better AP damage, the easiest way to do it is to go to land_units and find the Warriors of Chaos's Chaos Spawn entry (wh_main_chs_mon_chaos_spawn), then find the Melee Weapon column entry (wh_main_chs_claws_chaos_spawn), and copy-paste that somewhere else, like notepad. Now we go to melee_weapons_tables and enter that key, which shows us their weapon's stats that we can lift to our mod and edit as we please, for example changing it from 118 normal and 42 AP damage to 12/140 respectively. You can also add a bonus vs infantry or large here (vs cav doesn't work), give them splash attacks (which is limited by animation), make their attacks magical or flaming, etc. Most are pretty self-explanatory, First Strike and Bonus vs. Cavalry are deprecated but the rest generally do what they say they do.
If you instead want to give Sarthorael a skill that grants +10 Bonus vs Infantry to Chaos Spawn, you would instead use effects - create a custom skill if needed, then make a custom effect, target the chaos spawn unit set, and go from there.
Ranged Weapons
This is a very similar process to melee units, with the main difference that you'd use projectiles_tables to edit all Ratling Gunners instead of melee_weapons_tables, and that there's a middleman; land_units links to missile_weapons which links to projectiles_tables. Projectiles are much more complicated in general than melee weapons unfortunately, and have MANY options to tweak. Some of the major ones you may use;
- Damage can be changed via the Damage and AP damage columns
- Range can be changed via the Effective Range column
- Accuracy can be tweaked many ways; a higher Marksmanship Bonus improves accuracy, smaller Calibration Area improves accuracy, less spread helps, increasing Calibration Range closer to Effective Range makes the unit accurate up to their listed range, etc. You can also the unit's increase Accuracy in land_units
- Muzzle Velocity alters the projectile's speed
- Explosion Type allows the projectile to spawn an explosion, which can simply deal damage in an area (ex. Mortars) or spawn shrapnel (ex. ROR Ushabti Greatbows). Note that while projectiles are subject to friendly fire, explosions have an option to disable friendly fire, like the Blessed Trebuchets!
- Projectile Number allows you to do shotgun-esque bursts of multiple simultaneously-spawned projectiles. Think Reaper Bolt Throwers on spreadshot mode. Note that without a high enough Spread value, all those projectiles will overlap, you may have to experiment to find a spread value that works well for what you're trying to do.
- Burst Size and Shots per Volley allow you to do stuff like Irondrake flamethrowers or Ratling Gunner volleys, but be aware that these are HEAVILY animation dependent and volleys especially are very unlikely to function correctly unless the animation is already built to support a volley of that exact size and duration.
Using effects to buff ranged weapons works the same way here, but note that some aspects of projectiles, like explosion damage or accuracy, can only be changed via ability phases, so similar to how we used a 'carrier' ability to give Empire Swordsmen the Discouraged contact effect, we can use a carrier ability to give Hellcannons a different contact phase, or we could use a missile weapon swap to give Warp Lightning Cannons in Ikit's army a different projectile that moves much faster and deals more damage.
Note that ammunition is set in land_units, not here!
Abilities
Attributes
Stalk, Vanguard, Perfect Vigor, Unbreakable, Wallbreaker, Strider, Causes Terror, and the like are all Attributes, which can be built into a unit permanently, or added by campaign effects.
If you want to build an attribute directly into every instance of a unit, you can attach a custom Attribute Group (containing your desired attributes) to the unit's land_units entry, which will give it to every unit of that type gamewide. To do this, create a new key in unit_attributes_groups_tables, add the attributes you want to that key in unit_attributes_to_groups_junctions_tables, then just call that key in land_units table's attribute group column.
If you want a technology or skill to grant an attribute to a certain gorup of units, like a skill giving Perfect Vigor to Greatswords in Franz's army, that's best done via unit_set_unit_attribute_junctions_tables and effect_bonus_value_unit_set_unit_attribute_junctions_tables.
If you just want to give Settra the "Unbreakable" attribute via his innate, or give everything in an army Stalk regardless of what unit it is, effect_bonus_value_unit_attribute_junctions_tables is faster and easier.
Skills
Skills, specifically known in db as Character Skills, allow a lord to grant themselves, their army, or their faction bonuses as they level up. They come in many varieties, from the 'normal' redline and blueline skills to sets unique to specific lords like Settra or Tyrion, as well as what many people know as traits, actually called Background Skills, the passive bonus that most lords offer, like Knowledgeable or Tactician or Infernal Dominance.
In general, a skill works by linking to effects to actually boost your army or whatever, but some skills, like the Dark Elf Name of Power skills or how most legendary lords have skills for their special items, can activate dilemmas or grant ancillaries instead.
Skills are actually quite easy to make thankfully, though it takes several tables to do. This guide covers the basics of skill creation, but depending on what you're doing you may need a more in depth understanding of effects from this guide, or if working with Names of Power possibly dilemmas from this guide.
Creating a New Unit
Creating a New Lord
Please be aware that making a fully functional Legendary Lord with a unique skill tree, abilities, army buffs, mounts, items, etc. can be an enormous amount of work and at times very frustrating. It is however, EXTREMELY rewarding to complete!
Creating a Playable Faction
Regardless, I do have a guide for it here.
Working with Phases
Adding something like Poison, Sundering, or Flammable is a bit weird, but fairly easy. Just editing them is trivially easy.
You define the phase's key and basic info in special_ability_phases_tables, which you'll worry about MOSTLY used for heals/damage over time but can also freeze vigor, leadership, imbue flaming or magical (or another phase!), etc. Most of them are pretty self explanatory, but for Fatigue Change Ratio note that -1 is a full vigor refresh (ex. Regrowth) while a 1 completely empties vigor (ex. Muster of Malevolents or Dark Conduit).
special_ability_phase_attribute_effects_tables lets you add attributes to the phase, like Stalk or Rampage.
special_ability_phase_stat_effects_tables lets you pick what stats to add or multiply. There are a few bonus value IDs here that CANNOT normally be affected by effects, like accuracy, explosion damage, and splash attack power, and a number that you can edit in weird ways; want an armor mult instead of an add? Phases can do that, good luck doing that with effects!
If you're using an ability to apply the phase (say, Lore of Beast's Flock of Doom spell, or the Norscan passive Berserk, you'll need to use special_ability_to_special_ability_phase_junctions_tables to attach them together.
Note that most abilities only need one line, using Order 1. However, there are a few abilities, like the aforementioned Norscan Berserk, that may have multiple phase entries with different orders - if you look that one up, you'll see that berserk_i is order 1, then leads into berserk_ii in order 2, then eventually gets to berserk_iii in order 3.
Also, please remember that a weapon can only have ONE phase at a time - if a unit naturally inflicts Poison, and you give it Armor Sundering via an effect, it will permanently lose poison attacks. Phase responsibly!
---
Icon is easy to miss and kinda frustrating. Unlike abilities, skills, etc., there's no table to tell the game where to look for an icon for your phase. Instead, you have to add a new icon (which can just be a renamed vanilla icon) down the ui/battle ui/ability_icons folder tree, with the exact same name as your phase (+.png). Ex. if your phase is named my_damaging_poison, that icon had better be named exactly my_damaging_poison.png or you'll just get a white box ingame.
Unlocking a Faction
There are several ways to unlock a faction that already exists, depending on your preferences and goals.
First off is to follow the guide in the last section, skipping stuff that already exists. This allows you to customize every aspect of the faction as desired, including setting up a 'proper' built-in legendary lord leader instead of messing around with scripts, but means your mod is not compatible with most startpos mods on the workshop. I think Crynsos's faction unlocker guide is still accurate as well?
Alternatively, you can build off of Mixu's Unlocker, and its unlocked submod here. This has pros and cons; much of the hard work is done for you, all you have to do is mess around with db tables, and anything compatible with Mixu's unlocker will be compatible with yours, but you're making yourself reliant on someone else's mod. It's a good mix of easy and powerful though, and generally recommended since Mixu updates very consistently and quickly after DLC.
Finally, you have the option of using Crynsos' Faction Unlocker, which makes pretty much every vanilla faction and some new ones playable immediately, so you can just edit them with your own mod. Once again you're putting yourself at the mercy of someone else's mod, but with a minimum of work on your end, in return for the unlocker often being outdated. It also makes more changes to vanilla gameplay and campaign balance than Mixu's.
Making a New Mount
Creating/Editing Items
Technology Tree
Buildings
For more information on unlocking unit recruitment from a building, details on how weird building scopes can get, editing availability, changing how the AI handles it, or creating your own building from scratch, I have a fairly in depth guide that covers all that and more besides.
Faction Colors
Tweaking or Submodding Other Mods
If you just want to edit something minor about someone else's mod for personal use only, you can just open their packfile in RPFM and edit it as desired. Simple, easy, and if you know how to mod it's almost impossible to screw up. If the modder has been MIA for a while and the mod is broken, it's pretty common to upload the fixed version as a separate mod, linking back to the original mod. Taking and reuploading an active modder's work is the reason baby jesus cries; modders put A LOT of work into what they do, it's no exaggeration to say some mods are in the hundreds or even thousands of hours of work from a single person by now.
That said, submods exist for a reason if you want to offer an edited version of a mod, it's generally accepted to upload a submod, which requires the original mod but changes some aspects of it. Maybe you want to reduce upkeep for some SFO units, or let people build 3 of a given unit instead of 1. On a purely personal level I would recommend you not word it as "dumbasses can't balance so I'll do it for them" but in general most modders won't actually care if you want to upload an easymode/hardmode submod for their mod.
That said, especially for smaller scale/more personal mods that DO reply to everything, it's generally polite to ask permission unless they explicitly allow it.
Cataph has an EXCELLENT guide for submodding, which is linked here[tw-modding.com], I strongly recommend reading it in its entirety before doing anything else.
This guide was created by its original author on the Steam Community. Are you the author and want it removed? Request removal.