Results 1 to 5 of 5

Thread: How to change name of upgrade levels for castles?

  1. #1

    Default How to change name of upgrade levels for castles?

    What files do I need to edit to alter the in game UPGRADE LEVEL that generates in the settlement details page and when you hover over a settlement? For example, when you open up the settlement details page in game it says: "Metz - Motte & Bailey" or "Valencia - Wooden Castle" or "Florence - Town" and when you hover over those places, the little pop up will say "Rebel Motte and Bailey", "Rebel Wooden Castle" or "Rebel Town"

    More details: I found that if you edit the data/text/export_buildings.txt file for those structures, you can change the name of the building details page, but it still doesn't change the name on the settlement details page or when you hover over it.

    The reason why: I'm currently making a overhaul mod that changes a bunch of in game mechanics and upgrade paths. Ideally, this is what I want the settlement conversion to look like:

    Village (No ability to convert)
    Wooden Palisade <---> Motte & Bailey
    V ................................... V
    Wooden Wall <---> Wooden Castle (Stone Keep)
    V ............................... V
    Stone Wall <---> Castle

    BUT the game (hardcoded I think?) has a mapping for settlement levels. Lvl 2 Castle (Wooden Castle) is tied to the Lvl 2 town (Wooden Palisades) during the conversion and I can't get a level 2 town to go backwards to a level 1 castle no matter how hard I try. I have played around with the "convert_to" levels and the settlement_min levels in the edb, but no luck... SO! The plan is to circumvent the problem by bumping all the castles down a level and ignoring the level 1 castle which looks like it will work great.... except for this naming problem. Any idea? Thanks!

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Goa - India
    Blog Entries

    Default Re: How to change name of upgrade levels for castles?

    Well, you are looking at a particular settlement when opening the settlement detail page - hence the display of the settlement name. You might have noticed the arrows next to that name, they advance the display to the next settlement - not helpful if it then doesn't display the settlement's name, wouldn't you think?

    Or did I totally misunderstand?

    The upgrading of settlements is handled in a number of files: descr_cultures (basic set up), export_descr_building (how it upgrades), descr_settlement_mechanics (when it upgrades). The actual battle models should be linked to the settlement level's name so I don't expect any issues there. What you suggest will require to edit all of the above files as they are interlinked, I suggest to keep plenty of backups when trying to implement your idea, given the complexity.

    The guys in the IWTE forum will be able to help you if run into issues with the battle models.

  3. #3

    Default Re: How to change name of upgrade levels for castles?

    The faction-specific settlement level names can be found in expanded.txt in entries such as below:

    {EMT_ENGLAND_HUGE_CITY}English Huge City
    {EMT_ENGLAND_LARGE_CASTLE}English Fortress
    {EMT_ENGLAND_LARGE_CITY}English Large City
    {EMT_ENGLAND_LARGE_TOWN}English Large Town
    The building levels in export_descr_buildings.txt aren't actually tied to these settlement levels. The "core_building" chain has a hard coded name: whenever any level of this building is constructed, the city level increases by +1. Likewise, when any level of the "core_castle_building" chain is constructed, the castle level will increase by +1. You can add as many levels (up to 9 of course) to these buildings chains as you like with whatever internal names you like. Furthermore, the display names of these upgrade-inducing buildings can be made faction-specific in export_buildings.txt, so go crazy.

    Same deal for the conversion buildings. When any level of the "convert_to_castle" chain is constructed, the city converts to a castle and vice versa for the "convert_to_city". The name and number of levels for these buildings doesn't matter, and as you have already seen, neither these conversion buildings nor the "convert_to" lines for the core buildings actually do anything - which level of city or castle a settlement converts to is hard coded.

    EOP provides a way to specify which levels settlements should be converted into which is quite useful for cases such as yours, and also for the fact that huge cities are otherwise hopelessly stuck as huge cities.

  4. #4

    Default Re: How to change name of upgrade levels for castles?

    Awesome! Thanks so much for the info guys! I totally missed the expanded.txt and the hard coded city/castle level makes perfect sense. I tested some edits on the expanded.txt and it's working beautifully. I also did as Callistonian suggested and have altered the building upgrade names so they match what I want them too. Still need to take a look at EOP. I also need to figure out how to get the Lvl 1 castle battle maps to appear on the level 2 castle during a fight. I'm think I might try to some file-name-changing-hacks. Side note: Changing the wall_level in the export_descr_buildings.txt changes how it looks on the campaign map. I'm so close to making a level 2 castle like like a level 1 castle! Thanks again!

  5. #5

    Default Re: How to change name of upgrade levels for castles?

    Quote Originally Posted by Zefire View Post
    Side note: Changing the wall_level in the export_descr_buildings.txt changes how it looks on the campaign map.
    This is incorrect. I just tested again to confirm; the wall_level effect doesn't change which model is used for cities or castles on the strategy map. From what I remember, it doesn't do anything for the battle map either. So, it's only real effect is for AI build decisions, if it's even used there.

    Which models are used by a settlement on the strategy map and battle map are based on a few factors, none of which are the wall_level effect: 1) whether it's a city or a castle, 2) the settlement level, and 3) the 'faction_creator'. The faction_creator is set by descr_strat.txt at the start of the campaign. Whenever a settlement is upgraded, the level is incremented by +1 and the faction_creator changes to the faction that currently owns the settlement. Capturing a settlement does not change the faction_creator. I don't believe that converting a settlement (between city and castle) changes the faction_creator.

    The strategy map settlement models are read as .cas files. Which file is used is determined by the culture of the faction_creator faction. If you look in descr_cultures.txt, you will find the linkages between cultures and .cas files for each settlement type. It is possible to create faction-specific settlement strategy models by adding a 'faction_variants' subfolder in the directory where the other settlement strat models are saved, e.g.: data/models_strat/residences/faction_variants/england/northern_european_village.CAS. In this example, villages with faction_creator england would use this .cas file instead of the default one found in the residences folder.

    Swapping the village and town strategy map models, for example, is therefore a simple matter of either changing which .cas files are specified for which settlement level in descr_cultures.txt or changing the names on the .cas files themselves.

    Quote Originally Posted by Zefire View Post
    I also need to figure out how to get the Lvl 1 castle battle maps to appear on the level 2 castle during a fight. I'm think I might try to some file-name-changing-hacks.
    The battle map models used by settlements are also based on whether they're city or castle, their level, and the faction_creator, as well as a few other factors. However, because battle maps are so much more complex than strategy map models, there is no single file like descr_cultures.txt that coordinates all of their data. Instead, battle maps are coordinated individually in .worldpkgdesc files which can be found in data/settlements. Unfortunately, these .worldpkgdesc files, which are only about 1 KB and are basically just headers, contain the paths (directories) to the asset files they reference, which means there's no good way to actually find the .worldpkgdesc files for the settlement levels you want to edit. Furthermore, the file names on the .worldpkgfiles are unimportant so just renaming them won't do anything; all that the game cares about is their content. You're at the mercy of whoever set up the directories in the settlements folder - if they're logically organized, it shouldn't be too difficult. For example in vanilla: data/settlements/north_european/settlements/village might take you straight to the .worldpkgdesc file for the Northern European village battle map.

    In order to open, edit, and save a .worldpkgdesc file, you will need IWTE. This application is necessary for settlement modding in Med II and its latest versions make it extremely useful for all types of 3D modding. You can read about it's functions here and download it here.

    In order to swap the battle maps of any two settlement levels, you will need to find both .worldpkgdesc files and swap the data contained therein using IWTE.

    If you want to get deeper into what can be done with .worldpkgdesc files, Leo made an introductory guide which you may find helpful.
    Last edited by Callistonian; February 17, 2024 at 04:53 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts