.worldpkgdesc - M2TW
Which settlement, techtree or ambient turns up in the game for each specific use is controlled by a .worldpkgdesc file. Each .worldpkgdesc file calls one specific .world file.
The .world file's name and folder location that is specified inside the .worldpkgdesc file and other parameters can be amended with a hex editor or the IWTE tool.
Location and Name of .worldpkdesc files
packagedb.txt
The packagedb.txt file determines where the game will search for .worldpkgdesc files. Its normal contents are;
; List of directories to search for packages .\settlements
which means the game will search inside
- data/settlements
if you add a copy of the packagedb.txt to your mod-folder it will also search
- mods/my_mod/data/settlements
The .worldpkgdesc files in the specified folders will all be read when M2TW loads (prior to reaching the menu). The .worldpkgdesc files in the /packs folders will also be read meaning you cannot effectively delete any original .worldpkgdesc's.
Mod-folder versus M2TW data
Mod-folder versions of a named .worldpkgdesc do not 'overwrite' the data folder version
unlike other files, a mod-folder version of a .worldpkgdesc does not replace the data or /pack version in game, so naming your pkg the same as the original version and having;
- data/settlements/north_european/settlements/city/north_european_city_a.worldpkgdesc &
- my_mod/data/settlements/north_european/settlements/city/north_european_city_a.worldpkgdesc
does not mean your mod-folder version will take precedence. Unless the mod-folder version can be made more specific, i.e. by including a faction specific control, then the contents of both pkgs will be read and used.
.worldpkgdesc file name
The name of the .worldpkgdesc file is irrelevant
so "copy of north_european_city_a.worldpkgdesc" and "xxxxnorth_european_city_a.worldpkgdesc" will still be read and used, for this reason beware of leaving unwanted copies of the files in your /settlements folder.
Contrary to popular belief the naming of the files and folders in /settlements is completely irrelevant to which culture uses which building. You could call a set of files/folders "Freds_custom_thing.****" and have that settlement turn up for Northern_european factions' towns if you set the contents of the .worldpkgdesc correctly. Likewise, the .worldpkgdesc doesn't have to be in the same folder as the .world it calls. The reason for naming files/folders after cultures and city levels, and placing the relevant pkg in each is purely for ease of understanding what is meant to be turning up where!
Editing the .worldpkgdesc file
Tools
Hex Editor
The .worldpkgdesc files can be edited with a hex editor. A typical view of a file in the XV132 editor is shown on the right. Note that each string is preceded by an integer that gives the number of characters in the string, e.g. as shown the integer 17 for the string 'northern_european'. Editing the file with a hex editor is more difficult than using IWTE, but a hex editor can also be useful to quickly view the file contents.
IWTE
A typical view of a .worldpkgdesc open for editing in IWTE is shown on the right. If the 'OK' button is clicked IWTE saves a new version of the file with _WD added to the end. This file will be functional - see note about file naming above - if you no longer need the original file you must delete it.
Contents
Name:
Pkg Group:
Options;
- settlement - used for settlements including castles and forts
- ambient - used for ambients such as monasterys, farms and mills
- ambientmisc - used for some smaller ambients such as ruined walls - not known if there is a functional difference to 'ambient'
- rivercrossing - for bridge and ford models to be used as river crossings
- techtree - used for the buildings that fill techtree slots within settlements, e.g. barracks, churches and 'slot-fillers'
Pkg Path:
This is the path to the .world file the pkg will call, e.g.
- settlements/South_European/Castles/Fortress/south_european_fortress_A.world
note this starts relative to data/ level the name of the mod-folder and data/ are not included
Category:
For techtrees only. The categories used in the vanilla settlements are;
- market
- smithy
- church
- guild
- tavern
- university
- cultural_building_small
- cultural_building_large
Size:
For techtrees only
Type:
Variant:
Culture:
Environment:
Unkown use