Page 1 of 2 12 LastLast
Results 1 to 20 of 40

Thread: How to Edit Settlements

  1. #1

    Default How to Edit Settlements

    The way settlements look is defined by the files in the "settlements" folder. Such files are easily editable, but can be very confusing at first. For this tutorial, you will need:
    http://www.chmaas.handshake.de/delph...vi32/xvi32.htm - A hex editor
    http://www.statman.info/conversions/hexadecimal.html - A hex converter
    And an unpacked copy of Medieval II Total War. In the Medieval II Total War/data/settlements folder, there are many different types of files. However, the most important type of file is the .worldpkgdesc file. This allows you to shuffle around settlements between different cultures. Navigate to your Medieval II Total War/data/settlements/north_european/settlements/village folder to begin. Open up the north_european_village_a.worldpkgdesc file with the hex editor. It should look like this:




    Note that there are two halves to the viewing window - the right half shows what the file would look like in notepad, the left half shows what the file looks like in hex (a series of letters and numbers instead of regular characters). Confusing, huh? For clarity, I have divided the file into some sections:



    The red section is the internal name of the settlement. This is the name that you will use in other text files to refer to it (it is rarely used). The orange segment is the location of the .world file. This defines what the settlement looks like. The yellow section tells you what culture uses the settlement. The green section tells you in what environment the settlement is found (forest, desert, etc). Finally, the blue segment tells you what type of settlement it is. Ignore the black boxes for now. So, for example, using the information provided in this file we can tell that the settlement defined here is called north_european_village_A, uses the .world file (that is, has it's layout and buildings defined by the file) settlements/north_european/settlements/village/north_european_village_A.world, is used by the North European culture (England, Scotland, France, Holy Roman Empire, and Denmark), can be found in any environment, and is a village. That's very nice and all, but how do you edit it? This is where the black boxes come in. These black boxes are called indicator boxes, and they are used in reading the file. When the computer reads this file, it doesn't see the file with the words in it like we do, and with all the meanings spelled out. It just sees text. It doesn't know when one word ends and the next begins. This is what the indicator boxes are for. They tell the game how many characters are in each word (for example, they tell the game that there are 7 characters in the word village). If you are familiar with the battle_models.modelsdb file, then these indicator boxes serve the exact same function as the numbers at the beginning of each line. Let me give an example. Look on the left side of the window, the hex side. In the yellow section of the file, do you see the indicator box that says "11" in it? Now look on the right side of the window. Do you see the indicator box in the yellow section that has what looks like a left-pointing arrow in it? The two are actually the same. Editing something on one side of the window edits it on the other side as well. (If you don't see what I'm saying, replace the "11" with a "12" by selecting the indicator box on the left side and typing in "12". You should see the left-pointing arrow turn into an up-and-down pointing arrow. If you are using Windows XP, these special symbols may all look like rectangles on the right side. Don't worry about that; your changes are having an effect even if the symbol continues to be a rectangle). Since the left side is in hex, take the number 11 and run it through the online converter (the second link at the beginning of the tutorial). 11 in hex is really 17. What is the next word after that indicator box? northern_european. How many characters does northern_european have (including the underscore)? It has 17 characters. If, for example, I wanted to change the culture to middle_eastern, which has 14 characters, I would have to replace the 11 in the indicator box with a 0E to reflect the decreased number of characters. Otherwise, the game will crash. Confusing? You bet. Annoying? Definitely. But that's the way it is. Now lets try editing the file. I'll start by giving you your options for each category:
    Name: use anything you want
    World file: use any world file in the data/settlements folder.
    Culture:
    northern_european
    southern_european
    eastern_european
    greek
    middle_eastern
    mesoamerican
    any
    Environment:
    generic
    (the rest are guesses, as I have never used this feature and do not know if it works)
    mediterranean
    sandy_desert
    rocky_desert
    unused1
    steppe
    temperate_deciduous_forest
    temperate_coniferous_forest
    unused2
    highland
    alpine
    tropical
    semi_arid
    Type (there are many options, but these are the ones you'll probably be using):
    village
    town
    large_town
    city
    large_city
    huge_city
    default_fort (Fort)
    wooden_fort (Motte and Bailey)
    stone_keep (Wooden Castle)
    castle
    large_castle (Fortress)
    fortress (Citadel)

    Let's do an example. If you wanted to make the East European village look like a north_european fort, this is what you'd do:




    Note how I changed the indicator boxes to reflect the new number of characters. I would save this file anywhere in the settlements folder - it doesn't matter where, so long as it's in the settlements folder.


    What's new in Kingdoms?

    Kingdoms introduces a new line, the faction line, that lets you make specific factions have specific settlements. For an example, look in your Medieval II Total War/mods/teutonic/data/settlements/north_european/castles/castle folder and open tc_castle_a.worldpkgdesc file.

    How do I make this settlement appear in custom battles?

    This is a really interesting question, because using the exact same method and typing the exact same thing will only work some of the time. The best way I have found is to use the "faction" line in Kingdoms. Make a seperate worldpkgdesc file for every faction in a culture (continuing with our village example, we would make a worldpkgdesc file for all the east_european factions - Poland, Russia, and Hungary). Name the files whatever you want (make sure that the names in the red box are different!). Set the faction to whichever faction you are using for this culture (so I would set one's faction to russia, one's to poland, and one's to hungary). Set the culture to any. That works about half of the time. Note that this method will only work if you use every faction in a culture, and if the culture has at least two, or preferably three, factions.

    I hope that this tutorial was clear and helped you to understand how to edit settlements!
    Mythic_Commodore

    Coder on Dark Ages: Roman Revival, the alternate history mod for BI.

    Under the Patronage of Augustus Lucifer, member of the House of Ward.

  2. #2
    wilddog's Avatar Paintedwolves run free
    Join Date
    Jan 2005
    Location
    UK
    Posts
    2,337

    Default Re: How to Edit Settlements

    Hi
    I've been trying to get this to work in kingdoms for most of the day. I had no problems changing existing NE settlements. Simply replacing the folder in the mod file with whatever I wanted to use and renaming the .world file to what the old folder had had in it. However when I came across this thread I tried some of the combinations and pretty much failed to get anything to work. The .worldpkgdesc file as far as I could check didn't seem to be read in my tests. Renaming it/changing content made no difference. On the other hand renaming the .world file caused it to default back to the main data base items instead.

    Do you have an example of it working in Kingdoms?

    Edit - We found our problem. Too many backup copies which was confusing things. sorry.
    Last edited by wilddog; May 22, 2009 at 02:40 AM.

  3. #3

    Default Re: How to Edit Settlements

    EDIT 2020! : Please note some of the info in the OP is wrong/incomplete, please refer to the Wiki Article .worldpkgdesc .
    _____________________________

    Am getting a bit further with understanding this - our confusion yesterday was related to fact that our method (replacing the .world folder and ignoring the .worldpkgdesc folder) was giving 100% success rate in changing what appeared in custom battles - whereas you were only getting right thing coming up part of time... we however weren't getting anything faction specific to work on camp_map (as we were ignoring the .worldpkgdesc and it obviously needed setting in there)

    Have now realised game caches all the .worldpkgdesc files at start up, that are in
    data/settlements/
    or in
    mod_folder/data/settlements
    the part that was particularly confusing me is if you make back up copies of old entries inside settlements
    so you've ended up with a few file paths like:
    mod_folder/data/settlements/Copy of northern_european/old_settlements/xtown
    around, it'll pick up and use the .worldpkgdesc files from those folders you'd been assuming weren't in use as well - I see what you mean about it doesn't matter where in settlements you save the file now!

    The problem with the custom battles seems to be that the game has loaded all the .worldpkgdesc files and has a distinct preference for using the relevant one it finds in the main data folder and not your mod_folder

    it will however after having decided to use the data level .worldpkgdesc file look back in mod_folder first for contents.. so for example if you wanted to use the south_european wooden_fort in place of the north_european town in custom battles you need to copy the
    south_european_wooden_fort_a.worldcollision
    and
    south_european_wooden_fort_a.world
    to a
    settlements/north_european/settlements/town/
    folder in your mod folder and rename them to
    north_european_town_a.worldcollision
    and
    north_european_town_a.world
    respectively which is what the pkg file at the upper level is looking for (you shouldn't need to copy / rename the rest of the files because the other files are pathed to the old south_european_wooden_fort from inside the .world folder.


    EDIT: if you're using the XV132 hex editor you should find you can change the numbers that record the length of the text strings by using its inbuilt tools - from tool menu use 'encode number' and select 'byte' option you can also use the 'data inspector' set to show bytes so you can read them when you click on the relevant square.

    EDIT2: Oooh look 10 years ago!!!! My info above about getting settlements to switch for custom battles is partly wrong - you can do it as described OR it does actually work by .worldpkgdesc IF you make a faction specific pkg for every faction in a culture.
    Last edited by makanyane; May 17, 2020 at 04:03 AM. Reason: custom battle info clarification in edit2

  4. #4
    ceretic's Avatar Centenarius
    Join Date
    Feb 2007
    Location
    London
    Posts
    831

    Default Re: How to Edit Settlements

    In 'Rule Britannia' the directory C:\Program Files (x86)\Steam\SteamApps\common\Medieval II Total War\mods\british_isles\data\settlements\north_european has only one file in it called "ambiant_settlements" within which there are four subdirectories, namely:

    stone_fort_a
    stone_fort_b
    stone_fort_c
    stone_fort_d

    here is an image of the stone_fort_a details.



    All of the settlements in this mod are large towns or cities (but able to make castle-type units) and I want to improve realism by making many of them small towns and some of them castles.

    Is this possible... and how
    "Morydd left not one man of the army alive, but ordered each to be brought before him, one after another, to be killed and then flayed; and he rested for a short while, and then had the others to be flayed alive and afterwards burned." Ystorya Brenhined y Brytanyeit, Jesus MS. LXI


  5. #5
    Frunk's Avatar Form Follows Function
    Moderator Emeritus

    Join Date
    Jun 2009
    Location
    Gold Coast
    Posts
    6,497

    Default Re: How to Edit Settlements

    Would anyone happen to have the images for this backed up?

  6. #6

    Default Re: How to Edit Settlements

    Quote Originally Posted by Frunk View Post
    Would anyone happen to have the images for this backed up?
    unfortunately not - also some of the stuff in the OP is outdated/wrong assumptions - it's also not really "how to edit settlements" - it's more "how to switch which settlement is used via editing the .worldpkgdesc" which I do need to try and write up a bit better somewhere (and can now also be done via IWTE and doesn't need the hex editing stuff discussed above)

  7. #7

    Default Re: How to Edit Settlements

    So I've added De Bello Mundi settlements to the mod I'm making and changed the cultures and factions to the ones I need on the ".worldpkgdesc" files with the hex editor as shown in this tutorial but nothing changed, am I supposed to do something else? Or is there an easier way to do it? I only want to change the culture/factions of the settlements not editing anything else.

    I've tried IWTE but it just opens a prompt window, not sure what am I supposed to do... Anyone experienced with settlements scenes on campaign map who can help? Thanks in advance.
    Last edited by MagusCaligula; March 02, 2019 at 05:40 AM.

  8. #8

    Default Re: How to Edit Settlements

    Re: IWTE what computer OS are you using? you should get the prompt window and the program window - the program window has a wilddog as the image and that might have ended up minimised in your task bar.

    re: nothing changing - have you got a copy of
    packagedb.txt in your mod-folder?
    you need it to get it to read the .worldpkgdesc's in the mod-folder

  9. #9

    Default Re: How to Edit Settlements

    Quote Originally Posted by makanyane View Post
    Re: IWTE what computer OS are you using? you should get the prompt window and the program window - the program window has a wilddog as the image and that might have ended up minimised in your task bar.

    re: nothing changing - have you got a copy of
    packagedb.txt in your mod-folder?
    you need it to get it to read the .worldpkgdesc's in the mod-folder
    Yeah I was missing that file, added it now from DBM. Also you're right about IWTE, I just needed to click on the icon in the prompt window, I'll see if now everything goes fine, I'll let you know later Thanks a lot.

  10. #10

    Default Re: How to Edit Settlements

    The problem was exactly the missing packagedb.txt thanks again I have a question: can I add more than 1 specific faction and if so, I just add the 2nd one right next to the 1st or do I create another faction entry?
    Last edited by MagusCaligula; March 02, 2019 at 10:45 AM.

  11. #11

    Default Re: How to Edit Settlements

    Well I thought everything was fine as the barbarian settlements did seem fine but the greek settlements aren't loading the correct models/textures. I have the BlockSet with the Textures which I thought was what was needed. Is there anything else I need to do?

  12. #12

    Default Re: How to Edit Settlements

    There's a couple of hard-coded 'oddities'. For Eastern European the models will default to Northern European unless you give your EE factions pkgs with NE as culture and then faction specific name. For Greek culture the battle maps will load as Southern European, unless you give the greek factions pkgs with Southern_European as the culture and then the faction specific name. (changing the internal culture names also fixes this but gets you into other modding problems...)

  13. #13

    Default Re: How to Edit Settlements

    Quote Originally Posted by makanyane View Post
    There's a couple of hard-coded 'oddities'. For Eastern European the models will default to Northern European unless you give your EE factions pkgs with NE as culture and then faction specific name. For Greek culture the battle maps will load as Southern European, unless you give the greek factions pkgs with Southern_European as the culture and then the faction specific name. (changing the internal culture names also fixes this but gets you into other modding problems...)
    Well that's really annoying but it explains certain things I found odd in DBM files regarding cultures. What complicates it more is in my mod (using Ancient Conquest as base) for example Greek factions have North European culture and Greek culture is what Carthage and Numidians have so it's a bit of a mess lol I'm thinking now it would maybe be easier to correct all the culture stuff. What you mean by other "modding problems"? I created a new culture from scratch in my mod and it was relatively easy to do so, or do you mean changing the vanilla ones would give me problems?
    Last edited by MagusCaligula; March 03, 2019 at 08:11 AM.

  14. #14

    Default Re: How to Edit Settlements

    So the problem was I didn't corrected the culture in the files for specific Greek faction. But are those the only cultures with the hardcoded issues? The others are fine?
    Last edited by MagusCaligula; March 03, 2019 at 10:32 AM.

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

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,096
    Blog Entries
    35

    Default Re: How to Edit Settlements

    In other words - changing the actual names (not just the display) of cultures will avoid these problems\oddities? Is there a chance this is connected with entries in the descr_ui_buildings file, despite the obvious (ui) name?










  16. #16

    Default Re: How to Edit Settlements

    it's not descr_ui_buildings.txt that has
    Code:
    	mesoamerican middle_eastern
    	mesoamerican eastern_european
    	middle_eastern eastern_european
    	greek southern_european
    which wouldn't account for EE getting NE, and Middle_eastern & Mesoamerican have their own battlemap buildings and don't default automatically

    anyway, I'm fairly sure I've tried amending that, and the 'portrait mapping' bit in descr_cultures, before coming to the conclusion it was hard-coded.


    @MagusCaligula - yes, it's only 'Eastern_european' and 'Greek' cultures that have the issue. And to clarify it's only the factions that have those culture names in sm_factions that are affected so if you have 'Greece' 'Greeks' 'Doric' / whatever as faction names but they're in the Northern_european culture, they'll work as normal - so long as your culture groupings work for whatever else you're trying to do there's no point changing that. & you can get your Carthage and Numidians that are using the 'Greek' culture to use whichever battlemap settlement you want by having the .worldpkgdesc for them say culture=southern_european, faction=carthage, etc.

    You can internally re-name the vanilla cultures if you want to, the "problems" with doing that is just that it effects an awful lot of files and it needs to be done with some care and attention, not just a straight find-and-replace, or you'll mangle things where your culture name is also part of a model name etc.

  17. #17

    Default Re: How to Edit Settlements

    Thanks I already understand the settlements themselves fine I think. Yeah replacing a lot of files names is quite a pain, I'd rather not do it lol

    Regarding the techtree, to link the models to my own buildings in export_descr_buildings I just need to edit the builging type in the .worldpkgdesc am I right? Or is there something else I need to do? Thanks for your help

  18. #18

    Default Re: How to Edit Settlements

    for techtrees Type: needs to match the building level name in EDB

    that is the main thing.

    But also "category" and "size" needs to match what is shown for the techtree slots in the relevant settlements to get them to show up... If you're only dealing with vanilla settlements you won't need to change that, but EB and DBM I think have changed theirs, so you might need to change that too.

    Unfortunately!!!! From my testing you can only get one EDB buildings' techtree to turn up in one 'category' slot for the relevant faction. Soooo you need to match them quite specifically.

    eg if you want 'church1' as a building to appear for 'northern_european' in category=church, size=32x32 slot you can write the pkg for that. But you can't also get it to appear as a techtree in other settlements category=religious, size=32x64 slot or any combination in between...

  19. #19

    Default Re: How to Edit Settlements

    Is the "category" anywhere else besides .worldpkgdesc? It doesn't seem to be anywhere else, I mean in the code.

  20. #20

    Default Re: How to Edit Settlements

    "category" is only in .worldpkgdesc and the .world files - it's not related to anything in export_descr_buildings or any other text file.

    To view the category names (and sizes) for a settlement - use IWTE to 'read 3 binaries' 'gameobjects' tab and 'view techtrees' button - if it's a long name for the tech category you might have to use 'update techtree' button and select the techtree to view the details.

    The DBM settlements had quite a complicated mix of techtree names and sizes, with names like "templeDBM_axum", and some sizes that didn't fit the spots allocated! - I did do a bit of a simplification job on them for rafmc1989 last year, I don't know if those amended ones are in their current release or not...

Page 1 of 2 12 LastLast

Posting Permissions

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