Results 1 to 17 of 17

Thread: Roadmap to the .txt Basic Files

  1. #1

    Default Roadmap to the .txt Basic Files

    For first time modders, it can be a bit daunting to dig into the files and see what is what, especially with the amount of jargon and acronyms that get thrown around the forums, or the sometimes mysterious locations of certain core things that you will need when making or editing your own mods. I myself have spent literally hours going folder by folder, file by file, looking for a single tiny piece of code whose location I was unaware of. For this reason, I decided to give the newbies out there a small leg up, something I would have loved to have had when starting out, and hopefully motivate some more people to try their hands at modding (there are dozens of teams in need of fresh faces and skilled coders, so why not see if you like it ).

    The structure of this post will be as follows. I will inlay the folders where things are located via inset boxes, and then will specify what the acronyms/jargon terms are that might be used for various things in that folder, point out which file the acronym refers to, and give a very brief summary of what the file is good for, including whether there is anything in there to pay attention to. I will also offset explanations via ";;;", so watch for that. Importantly, I won't go through all files, only those which I know to be of importance for first time modders, in particular the various .txt files that are central to the game mechanics (I assume more experienced/advanced modders who might be doing more involved work on skins, animations, AI, and sounds know their way around well enough already). Now, since all mods for Medieval 2: Total War are modfoldered under m2tw/mods/your_mod (at least as far as I know), that will be the starting point for all folder location explanations. As an example, if I were to be looking for the file that explains everything about the buildings in my mod (located in /m2tw/mods/my_mod/data), I would go to the following:

    m2tw/mods/my_mod
    m2tw/mods/my_mod/data
    export_descr_buildings.txt



    Good! Now that you know how we'll be navigating, let's be off! We'll just start at the furthest folder out, and work our way in. Again, inlaid boxes will be used extensively to aid navigation, so make sure you double-check exactly where everything is located.

    First thing you will need to do is make sure you have all the files unpacked, so that you are dealing with simple text files, rather than the standard files which are not really workable for the everyday casual modder. For a solid guide on this first step see Withnwar's Basics. Also be sure to get the docudemons, which has tons of useful info that will save you much time hunting through forums for answers; see GrnEyedDvl's Ultimate Docudemons post. Now that you've got the files ready for viewing and alteration, let's see what's in there...

    m2tw/mods/my_mod

    default.cfg ;;; This file includes a number of settings for the mod. Most importantly, this is where you will set a trace log for the mod, which is crucial to have when troubleshooting problems later. To see how to do this, see, swagger's guide for more info.
    export_descr_buildings.txt ;;; (EDB) in my opinion the most important file for new modders to get familiar with; includes all game mechanics information about all buildings and building trees, and can teach one a lot about how coding works and how to write your own codes; also critical to know that the hidden_resources are all listed/defined at the top of this file --> hidden resources are used extensively in all mods to restrict construction and recruitment and add complexity and immersiveness to the game; for a guide to the EDB see DarkKnight's "Guide to Guilds"
    export_descr_unit.txt ;;; (EDU) same basic setup as EDB, but for units. It looks terrifyingly daunting, but there are a host of tutorials and tools for simplifying the process. See these guides from Mythic_Commodore, Stephan, and gracul

    m2tw/mods/my_mod/data/text ;;; where the descriptions for everything are located

    ;;; Some of these files should not be changed, as they include basic descriptions for in-game buttons, or standard in-game responses/information scrolls ;;;

    campaign_descriptions.txt ;;; pretty self-explanatory; just check what is their and use that as a guide
    export_ancillaries.txt ;;; where the names and descriptions of the ancillaries are to be located
    export_buildings.txt ;;; where the names and descriptions of buildings are to be located; make sure to change the necessary lines here if you alter any of the names of buildings or building trees in the EDB
    export_units.txt ;;; same as the above, but for units; same point as above if you make alterations to units
    export_vnvs.txt ;;; descriptions and bonuses/maluses of traits are defined here; changes to the EDCT will have to be reflected here
    historic_events.txt ;;; where any historic events needed for your mod are defined and given descriptions/titles. Events can be very important for campaign scripting purposes or requirements for constructing certain buildings/recruiting certain units
    imperial_campaign_regions_and_settlement_names.txt ;;; where you link the coded region and settlement names to what the in-game names should be
    missions.txt ;;; descriptions of all missions, rewards, penalties, who is giving the mission, etc. Basically everything that is defined in descr_missions.txt should be spelled out fully here, as you would want to see it in-game
    quotes.txt ;;; where the authors and quotes that can be implemented on loading screens are spelled out



    m2tw/mods/my_mod/data/world ;;; details about the strategy map, about the campaigns, and the campaign script
    .../data/world/maps
    ...world/maps/base ;;; basic elements of the strat map are defined here

    descr_disasters.txt ;;; where various natural disasters are found, with frequency rates, limitations, etc.
    descr_regions.txt ;;; important file --> definitions for each region are here, with province name, settlement name (and location), and very importantly, this is where the hidden_resources are defined for the region; be sure to delete map.rwm if you make any changes here --> the file is automatically generated on game bootup, so don't worry, but you have to delete it for changes to take effect


    ...world/maps/campaign
    ...world/maps/campaign/imperial_campaign ;;; core elements of the campaign are located here

    campaign_script.txt ;;; a terrifyingly daunting thing to explore for the first time, but incredibly important for a host of in-game things. There is too much to say about this to really get into it here. Rest assured, any complicated mechanics you want to include will require some scripting, scripts can be used for massive or mini changes within the game, they can be tied to all kinds of things like events, construction, conquest, you name it, and they can also be used very nicely for balancing purposes or changing what goes into different difficulty levels. For a tool and resource regarding scripts, see respectively Squid's script editor and Gigantus' supplementary info. But in general, if you are unsure about scripting, see what is already in the campaign script for another mod, and do a search in the Text editing and scripting forum. Also, the campaign script put together by QuintusSertorius for EBII is a masterclass on scripting!
    descr_events.txt ;;; remember those historic events you spelled out in historic_events.txt? Here you specify when they will happen, and if they have some local impact (plague, earthquake, volcanoe, some historic invasion, etc.) also where they will happen. Don't skimp on the events, they can be a great way to add structure and narrative to your mod
    descr_strat.txt ;;; the monster file defining the strategy map for your campaign. What's inside: list of playable/non-playable/end-unlockable factions, start and end date of campaign (and the timescale), some basic strat map definitions beneath these things, where all the strat map resources are located, definitions for the factions (start money, AI stance, starting settlements and armies), definitions of all settlements (population, buildings present), and armies (their makeup, experience levels, generals present and their traits, location)
    descr_win_conditions.txt ;;; self-explanatory








    Alright, I think that covers all the basic things. Obviously, I have left out a ton of things that can be changed (and would have to be changed at some point), but I just wanted to provide a quick overview of the .txt files that can modified somewhat easily, to give new modders or novice additions to modding teams a leg up. If any readers feel I have left out something crucial or have given a poor explanation of something, let me know in the comments, and I will update the post periodically.

    Also, I have been locating these files by panning through the modfolder for one of the mods I have installed that is stable, but I guess it may be possible for some of these things to be located elsewhere or differently named (though I think not). If someone notices that I have given a file an odd or uncommon name or location, let me know that as well.

    Hope this is helpful for the new people out there, and I hope this might encourage some hesitant modders to get more involved and join a team that is working on something in your area of interest.

    Thanks to the community, and the modding teams of Stainless Steel: Historical Improvement Project and Europa Barbarorum II for helping me figure out a lot of stuff. Especial thanks to QuinutsSertorius whose work and input has made me a far more creative modder.
    Last edited by Kilo11; April 29, 2020 at 01:59 AM.
    | Community Creative Writing
    | My Library
    | My Mapping Resources
    | My Nabataean AAR for EBII
    | My Ongoing Creative Writing

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: Roadmap to the .txt Basic Files

    Tip for text (content) search in the data folder: to avoid long searches copy the files into a separate folder, eg my_mod\data\search and then perform the search there.
    Otherwise the search will get extended into all sub folders of your mod - and that might be hundreds more files.










  3. #3

    Default Re: Roadmap to the .txt Basic Files

    I like it. Didn't read everything but we all spent hours and hours searching for this or that at start I think. And even when you know, you will still have long hours of doing this and doing that. But true, while you take some things granted after a while, maybe it will help people to take a look in the files and then you never know...

    Though modding isn't forced to be a team work or for others first. Anyways, I like it if I didn't say.

  4. #4
    Frunk's Avatar Form Follows Function
    Artifex took an arrow to the knee

    Join Date
    Jun 2009
    Location
    Gold Coast
    Posts
    6,504

    Default Re: Roadmap to the .txt Basic Files

    Nice work mate! +rep

  5. #5

    Default Re: Roadmap to the .txt Basic Files

    Nice guide--wish it existed when I was first learning to mod.

  6. #6

    Default Re: Roadmap to the .txt Basic Files

    Excellent guide, but I have a question about a certain .txt file. Where is the .txt file that contains information pertaining to player achievement events, such as richest faction. I've unpacked all the files, and have been searching for what seems like hours, but I can't find it. I'm playing SS6.4.

  7. #7
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: Roadmap to the .txt Basic Files

    Recording of player achievements have been introduced with later versions, I think Empire was the first one. As far as I know there that file doesn't form part of the game file setup but is a separate record in the game's root folder. It's more of a Steam bragging thing then a game matter afaik.










  8. #8

    Default Re: Roadmap to the .txt Basic Files

    Quote Originally Posted by Gigantus View Post
    Recording of player achievements have been introduced with later versions, I think Empire was the first one. As far as I know there that file doesn't form part of the game file setup but is a separate record in the game's root folder. It's more of a Steam bragging thing then a game matter afaik.
    Hmm, that's interesting. I didn't know the information scroll that pops up was part of Steam. I just wanted to edit the text on the scroll to make it say something more interesting, and to correct some grammatical errors. Oh well, I guess modding has its limits. Anyway, thanks for the reply.

  9. #9

    Default Re: Roadmap to the .txt Basic Files

    @Gig, I don't think bobster's question was about anything related to Steam. If I read the original correctly it's not about player achievements like in Steam or XboxLive or whatever. I think he's talking about the scrolls that pop up at turn start saying "Most Powerful Faction", or "Richest Faction", or "Largest Faction", etc.

    @bobster1, unfortunately I don't know where that would be located, or what things are tracking that info, as I'm a noob modder (which is why I made the guide in the first place, to help me locate things that I'd otherwise forget are important). My intuition would say that the trackers are in the campaign_script and the scroll texts are in one of the text files (maybe at the base game folder though, and not in a mod folder). However, my intuitions are based on a small data set of my own meager modding experiences, so take them with a grain of salt. Sorry I couldn't be more helpful.
    | Community Creative Writing
    | My Library
    | My Mapping Resources
    | My Nabataean AAR for EBII
    | My Ongoing Creative Writing

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: Roadmap to the .txt Basic Files

    I wasn't clear enough - recording of any achievements started with Empire which also happened to be the first version to be on Steam. In other words: there is no file in M2TW that has any recording whatsoever of player achievements.










  11. #11

    Default Re: Roadmap to the .txt Basic Files

    @Gigantus, I apologize for not being clear enough in my original post, (that's the downside of communication on the Internet) but @Kilo is right. I'm actually looking for the text file that controls the information scroll that pops up saying something like "Our faction is now the richest in the known world..." Anyway, I'll keep searching.

  12. #12
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: Roadmap to the .txt Basic Files

    Right, that's the descr_event_images files - this section is the set up:

    Code:
    faction_richest
        icon    diplomacy
        heading_items 3
        format
        {
            title        center verdana        black
            string         center verdana_med    black
            image     center    year_end_report
            spacer         8
            bodystring  left verdana_sml khaki left
        }

    What aspect do you wish to edit? Text and graphics (pic) are somewhere else.
    Last edited by Gigantus; October 16, 2018 at 08:22 PM.










  13. #13

    Default Re: Roadmap to the .txt Basic Files

    Yes, I'm trying to edit the text and graphics on the scroll just to make things interesting. For example, I changed the wording of the descriptions for agents in the strat.txt file which is linked to this post. Look at lines 35-37 in the file. I've corrected some grammatical errors, and made my own descriptions. When I saved this file and reloaded my campaign, my altered text appears on the agent description scroll when I right-click on an agent. Now, I'm trying to do the same thing with the "richest faction" scrolls as well. I hope that makes sense, and I would show screenshots for further clarity, but I don't know to upload images to this forum.
    Attached Files Attached Files

  14. #14
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: Roadmap to the .txt Basic Files

    There are a number of ways that will skin this cat.

    Text: is in text\event_titles and text\event_strings
    Picture: the default one (year_end_report.tga) is in the ui\southern_european\eventpics folder - you can change the name of the pic in the section I posted, blue marks the spot. You can also use different pictures with the same name in the other culture folders
    Graphic layout: that's a bit more complicated as it is the global layout for messages. You can find the default graphic in the ui\southern_european\interface folder. It's the element at the bottom left of the shared_00.tga file. As with the picture you can use a different layout in the other culture folders. Keep in mind that you cannot change the size of the graphic in the tga file. The graphic will also expand\contract as required which has to be kept in mind when designing a custom graphic.

    And now rep me for being awesome










  15. #15

    Default Re: Roadmap to the .txt Basic Files

    Gig, thanks a million for helping where I couldn't, and I for one will fulfill your shameless request for some rep. You always deserve it anyway!
    | Community Creative Writing
    | My Library
    | My Mapping Resources
    | My Nabataean AAR for EBII
    | My Ongoing Creative Writing

  16. #16

    Default Re: Roadmap to the .txt Basic Files

    Thanks @Gigantus, that's what I was looking for. It looks like I have to use your bin editor to convert the strings.bin into text files since unpacking the game didn't convert them like the others. That's interesting, and I'm wondering if it's because I'm using the Steam version of the game. Most of the other .bin files converted to .txt, including the "nasty four", but these are located in my SS6.3 mods\text folder. Anyway, I appreciate your help, so thanks again.

  17. #17
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

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

    Default Re: Roadmap to the .txt Basic Files

    Yup, you will need the converter as the files only exist in string.bin format when you unpack. The 'nasty' four do not rebuild in Steam if you change their TXT files and delete the STRING.BIN files - an inherent (but nor really troubling) issue with Stainless Steel if you change your options via their set up launcher.










Posting Permissions

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