.worldpkgdesc - M2TW
A further explanation of how battlemap elements are loaded can be found on Battle Map Buildings - M2TW
- 1 Location and Name of .worldpkdesc files
- 2 Editing the .worldpkgdesc file
- 3 For Custom Battles
Location and Name of .worldpkdesc files
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
if you add a copy of the packagedb.txt to your mod-folder it will also search
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 &
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
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.
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.
Not all of the possible content types are included in each .worldpkgdesc. They can be added in if required, doing that via hex-editor is slightly complicated by needing to also add an integer for the count of the types used. IWTE will do this automatically for you, and by default displays all the possible types with 'unused' for the unused ones.
This is used to select a settlement or individual building or ambient in the battle editor.
- settlement - used for settlements including castles and forts
- ambient - used for ambients such as monasteries, 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'
This is the path to the .world file the pkg will call, e.g.
note this starts relative to data/ level the name of the mod-folder and data/ are not included
For techtrees only. The categories used in the vanilla settlements are;
However, you can use any category name you want, to get the techtree building to appear this must match the name of the techtree slot in the settlement.
For techtrees only. The sizes used in vanilla settlements are;
You can add different sizes but to get the techtree building to appear this should match the name of the techtree slot in the settlement.
Theoretically, if you change your techtree slots and packages to say 62x62, then that should stop the vanilla 64x64 building models appearing, unfortunately however, if you don't have anything that can fill those slots for a particular settlement the game can be 'overenthusiastic' in its interpretation and still put the 64x64's in!
|Common name||EDB core building||descr_walls.txt level||pkg 'type' required|
|Large Town||wooden_wall||level 1||large_town|
|Large City||large_stone_wall||level 3||large_city|
|Huge City||huge_stone_wall||level 4||huge_city|
|Motte And Bailey||motte_and_bailey||level 0||wooden_castle|
|Wooden Castle||wooden_castle||level 1||stone_keep|
Please note that the 'type' name and the wall level used for the settlements are hard coded. The wall level used is included here for info only as it determines which ladder/tower size attacking armies use and may influence your choice of model to use for settlements.
Editors note: Explanation for fort use needs to be added here.
This needs to be the internal name of the culture you want to use the settlement etc, e.g. northern_european, mesoamerican. From vanilla cultures the following culture names work as expected:
The 'greek' culture and 'eastern_european' do not work if used in the culture slot, they have a hard coded default as follows;
- greek uses southern_european pkg results
- eastern_european uses northern_european pkg results
If you have added a new named culture, or changed the internal name of an existing one, the new culture name can be used here.
This needs to be the internal name of the faction you want to use the settlement etc.
Use of this function allows one faction in a culture to use different buildings from the other factions in that culture.
For most cases the culture entry on the pkg should match the culture of the faction as specified in descr_sm_factions.txt, however because of the hard coded default behaviour of the greek and eastern_european cultures a faction belonging to the greek culture needs southern_european listed as its culture, and a faction belonging to the eastern_european culture needs northern_european listed as its culture.
If you want a faction to reliably use a specific settlement in custom battle you will need to give every faction in its culture group a faction specific .worldpkgdesc for that settlement level - if you do not cover every faction you will get a random selection of either the faction specific settlement or the main culture's settlement appearing.
Intended to alter the fortification level, e.g. use of arrow versus canon towers. Doesn't seem to work.
For Custom Battles
To get one faction, or the problem eastern_european and greek cultures to use a different settlement model in custom battle from their culture's default model, make a .worldpkgdesc file for EVERY faction in the affected culture. See notes in faction section above for how to code EE and greek factions.