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.

NTW modding tips

From TWC Wiki
Jump to navigationJump to search

This page contains a number of assorted NTW modding tips. They are mostly meant for new modders but sometimes even old dogs can learn some new tricks. Most of these were first compiled by husserlTW in this TWC thread: https://www.twcenter.net/forums/showthread.php?t=369739

General tips

  • Make sure to check this thread if you're just starting to mod.
  • Create frequent backups outside of your Steam folder. This point cannot be stressed enough. Often, when you change something and it doesn't work, it's very hard to find out why and easier to revert to a backup and re-do your changes.
  • If you have a working version of your mod, and you plan to extend upon it, place it in a zipped format with a clear name and a date. This way, if you break the mod, you can go back by extracting the working version as many times as you need - unlike with a conventional backup with which it is surprisingly easy just to take the backup, break it and then realize you don't have a backup of the backup and have to start over.
  • Be careful about changing many things at once. It makes finding what's causing trouble a lot more difficult.


Pack files

  • Always create a working folder for your new pack file. Extract all db tables and files you want to add to your pack to the working folder, then create a new pack in PFM and make paths relative to this working folder. For db tables it's also a good idea to export their TSVs into this folder since you will want to do most of your changes in the TSV files rather than directly in PFM.
  • If you extract a file from a nested folder in PFM (for example db/units_tables/units), the program will create a corresponding directory tree on your hard disk. To add files to your pack, copy the whole created DB directory to your working folder, not only the units file. The pack has to be placed in the root folder, i.e. in the same place as the copied DB folder in the above example.
  • It is very helpful to create a second folder where you export the TSVs of vanilla db tables that you are going to use in your mods. Often, it's easiest to copy vanilla TSV entries to your own files and edit them rather than creating your own entries from scratch.
  • A practical way to organize a mod pack that contains many tables is by using a spread sheet. For example, you could use the first sheet to hold a units TSV file representation, the second to hold one of unit_stats_land, etc. Copy the lines you want to edit from a vanilla TSV table into the corresponding sheet (you can find a tutorial on how to do this in OpenOffice here), then open the TSV files in your working folder and replace the lines with the ones from your TSV by selecting them in your spread sheet editor, copying them and then pasting them into the TSV files - but make sure you preserve the first three lines!
  • Always (except for localisation packs, see the next point) create your mod packs with the type "mod pack" by right-clicking on the pack name in PFM, going to "Change Pack Type" and selecting "Mod". Mod packs then have to be enabled in your user script file or loaded with a desktop shortcut. Don't be lazy and set them to "Movie" type to save the time of editing the user script: Chances are you will forget the pack and it's going to cause incompatibilities and hard-to-find problems with your other mod packs.
  • localisation.loc has to be in movie packs. It doesn't load from mod packs. This means only one localisation file can be active at all times.
  • If your mod pack isn't loaded, it's likely you didn't save the file encoded as Unicode. Make sure you select Unicode or UTF-8 encoding when saving with notepad or your editor of choice.
  • Rename all the DB tables in your mod, for example by prefixing them with "mymod_". DB tables with a different name than the vanilla table are loaded like this: If it's a unique key table (like units or anything where you have something like an ID), entries with the same key will override vanilla entries. This is useful for changing unit caps, cost, recruitment time, etc. If it's a non-unique-key table (like building_units_allowed), you have to override the vanilla table if you want to remove something but this can lead to problems with patches. If you only want to add things, a renamed table works fine.
  • Make sure your entries don't contain accidentally placed whitespace. To quote husserl: "I still remember that when I was trying to add Lancers in several factions for my Startpos Mods, for some factions worked but for some did not and CTD!!! I was hopeless trying to understand why this strange thing happened, until I discovered that in some tables I had entered the unit name "Lancers " with an accidental space at the end. Since in other tables the name was correct "Lancers" without space, the game considered that these were 2 deferent words and crashed in loading."
  • It's sometimes a good idea to sort your files (especially localisation.loc) in alphabetical order in your spreadsheet program and then import them to PFM. This makes things easier to find and prevents double entries.


Maps

  • You cannot directly add new things like regions, cities, town, armies, etc. to the game. The Hybrid technique provides a solution for this (up to a point).
  • To change governments, two changes have to be made: One in FACTION\GOVERNMENT and one in FACTION\GOVERNMENT\GOV_IMP
  • Never change the order of regions in regions.esf or you will get a CTD
YOU can help us improve this Wiki! ~ Look for ways to help and editing advice. ~ If you need further advice, please post here.