Hello alpaca.Originally Posted by alpaca
I found that somebody in TWC make .bin editor and it actually open .bin files like Notepad .txt. Is it possible to direct modify .bin files or I need to convert it in .txt (probably stupid question but...)?
You can quote or link to this tutorial at wish, but please don't mirror it. This is required to keep discussion about it all in one place.
Setting up MTW2 for modding
In this tutorial I want to walk you through the necessary or at least very useful steps to set up a working modding environment.
This can be done using one (or both) of two different ways:
- Creating mod folders
- Making the game recognize files you put in the data directory (using the io.file_first switch)
Both ways have their own advantages and disadvantages, but overall I feel that mod folders should be the first choice, unless you want to do something they don't support (more on that later), but I will nonetheless describe both methods.
1. Getting the files
Well, the first step of setting up your game will always be unpacking the data files, no matter if you want to use mod folders or io.file_first.
To do this, you have to have patch 1.1 installed. If you do, you should be able to find a directory called "tools" inside your MTW2 directory, and inside that, you will find a folder named "unpacker".
To unpack all the game's data files, simply run unpack_all.bat - this will take a while, so be warned. After the program's finished, open your data directory (inside your MTW2 directory) and delete or rename descr_geography_new.db and descr_geography_new.txt (this is important - if you don't do it, your game won't run)
Information for advanced users:
Spoiler Alert, click show to read:
1.1 Converting the text files
The next step after unpacking is due to the fact that the game stores the localised text in files with the extension .strings.bin - however in order to edit them, you want to have them in .txt format (UTF-16 if you know what that is). The game will then automatically generate the .strings.bin files from these txt files.
I wrote a useful python script that allows batch conversion of these files. You can find it here
Usage instructions can be found in the read-me file for the tool.
1.2 Alternative: Directly editing the .strings.bins
pmcorp wrote a nice tool that allows you to edit the .strings.bin files directly. I prefer converting them and editing them in my favourite text editor, but I guess some people prefer to directly edit the bin files.
Further, this tool allows you to edit the files my converter can't convert, so you should definitely get it at least for that end (click here).
Be aware that you will have to install the .net frameset before being able to use this (get it here or the 64-bit version here)
2. Mod folder vs. io.file_first
In the next step, you will have to decide whether you want to use a mod folder, or the io.file_first switch for your working environment. To easy your decision, I will state some of the advantages/disadvantages for both methods:
Mod folders:
pro:
- You can have multiple mods at once without them interfering with each other
- When changing mods you don't have to switch out any files
- Savegames, preferences, etc. can be kept separately for each mod
contra:
- Not all files are supported, this includes textures. For more information, visit this link
- Slightly harder to set up
io.file_first:
pro:
- Supports all editable files
- Slightly easier to set up
contra:
- When changing mods you have to switch out all modified files
- Savegames, preferences, etc. have to be switched out, too
- You will always overwrite your unpacked files
3. Setting up a mod folder
The easiest way to set up a new mod folder is probably using my mod folder installer
It will allow you to easily set up a mod folder with all the necessary files.
For manual instructions, click on show:
Spoiler Alert, click show to read:
Congratulations. If everything worked, you should now be able to run the game with your mod directory by starting mymod.bat
4. Setting up io.file_first
4.1 Creating a new config
To do this, copy your medieval2.preference.cfg file and name the copy "mymod.cfg"
Then open "mymod.cfg" with a text editor and add the following to the top:
This will tell the game to use the files it finds in the data directory instead of those in the packs.Code:[io] file_first = 1 [log] to = logs/system.log.txt level = * error
It will also enable error logging to a custom error log, which is highly recommended, but not strictly necessary.
In order to be able to start your game using this config, create a new text file inside your MTW2 directory called mymod.bat
Open it (right-click, edit) and write this into it:
Congratulations. If everything worked, you should now be able to run the game with your unpacked files by starting mymod.batCode:medieval2.exe @mymod.cfg
5. Testing
An easy test is editing a screen text file (for example text/imperial_campaign_regions_and_settlement_names.txt) and replacing one entry with something different. If your change shows up in the game, you're set up fine. I usually do something like changing
toCode:{London} LondonIf you then start the game as the English, London should (more or less) rightfully be called "The Moloch" - if it isn't, your modding environment is not set-up correctly.Code:{London} The Moloch
6. The error log
This doesn't really fit here, but as it is probably somewhat of a beginner tutorial, I want to make sure you understand how important the error log is.
Remember what you added into your config file:This tells the game to create an error log in the MTW2/logs folder called system.log.txtCode:[log] to = logs/system.log.txt level = * error
A lot of common errors will be shown in this log, so if something doesn't work, or the game crashed, it's a good idea to check this log file before doing anything else.
As you are a beginner, it will probably tell you what's wrong in at least 50% of the cases, and although its usefulness will decrease slightly once you're getting more experienced, it will still be a routine action to check this file every time you quit the game.
There's a few issues with this file, for example you can't guarantee when it writes the log unless you close the game. So it may be a good idea to only test one thing at a time and then close the game again in order to be able to catch as many problems as possible.
Last edited by alpaca; 05-11-2007 at 20:35.
Hello alpaca.Originally Posted by alpaca
I found that somebody in TWC make .bin editor and it actually open .bin files like Notepad .txt. Is it possible to direct modify .bin files or I need to convert it in .txt (probably stupid question but...)?
Watching
EURO 2008 & Mobile Suit Gundam 00
Waiting for: Wimbledon 2008.
Well I didn't try his tool. If it works, then you can directly modify them.Originally Posted by DukeofSerbia
However, converting them to .txt files has the advantage that you only need a tool once, whereas editing them directly forces you to use it all the time for every editing step.
Anyways, if you can confirm that this tool works I can add it to this tutorial, at least to edit the files my converter doesn't convert.
Thanks a ton man, I needed this, and so does everyone new to modding MTW 2. Everyone else seems to already know most of it from RTW or assume you already know all the basics.
![]()
![]()
![]()
Well the problem is rather that nobody wants to bother and has the time to write tutorials apparently. I don't have enough time, either ;)Originally Posted by Valentine82
I am sooo fvkin p1ssed off right now, i install m2tw, install the 1.1 patch, try and run the unpack_all batch file and get a fvkin error, (This application has failed to start because MSVCP71.dll was not found. Re-installing the application may fix this problem) so, i copied the unpack_all into my main m2tw install folder in which this MSVCP71.dll file is and run the unpacker...
the file doesnt give me an error and seems to be working... Do you agree to these terms and conditions (Y/N) so i type Y and enter, then it informs me that this program may damage my install of m2tw, read the read me and would you like to continue (Y/N) so i type Y and enter, next it informs me this will overwrite files in the target folder, are you sure you would like to continue (Y/N) i type Y and enter...then thats fvkin it, the program closes and thats it...NOTHING, FVK ALL, JACK SH1T, Im soooooo FVKIN P1SSED OFF, all I FVKIN WANNA DO IS MOD THE UNIT STATS, THATS IT, AND I HAVE TO GO ABOUT ALL THIS B.S TO DO THAT, unlike rtw the data files were alrdy unpacked and in txt format, y is it so hard to fvkin get this done, y couldnt they just make the tree structure and layout like rtw, like fvk, im sooooo fvkin p1ssed, im goin to fvkin burn this godamn game b4 the night ends...FVK, what the fvk am i doing wrong, i follow the tutorial word 4 word, and that dont work, like fvk, someone let me know what the fvk is wrong with what im doin......FVK
The Unpacker should be placed in the 'tools\unpacker' folder of your
Medieval II: Total War installation folder
- To unpack all files and place them in your 'data' directory run
the batch file 'unpack_all.bat'
NOTE: To use this batch file the Unpacker and the batch file must
be in the 'tools\unpacker' folder for Medieval II: Total War
- To create a text file with a list of all files within the packs
run the batch file 'list_contents.bat'. This will create a file
'pack_contents.txt' in the 'tools\unpacker' folder;
NOTE: To use this batch file the Unpacker and the batch file must
be in the 'tools\unpacker' folder for Medieval II: Total War
YA thats nice to know...but it gives me that error, MSVCP71.dll was not found..........when i run the unpacker from the tools folder....FVK
Mate, watch your language please. Rants against CA have no right of existence in this thread.
Especially not if you use swearwords.
Try editing your unpack_all.bat so that it says:
Then run it from your MTW2 main directory.Code:unpacker.exe --source=packs\*.pack --destination=. --verbosity=1
My computer is on upgrade and when it backs I will check and post results here.Originally Posted by alpaca
Anyway,
What about Python? I downloaded Python 2.5 Windows installer but I see Python 2.5 Windows AMD64 installer?
What is Python 2.5 Windows AMD64 installer? What is this? I ask that because I have AMD Athlon64 and have they some connections or not?![]()
Watching
EURO 2008 & Mobile Suit Gundam 00
Waiting for: Wimbledon 2008.
Well as it says, it's the installer for AMD 64bit CPUs, so if you have one of those, download the AMD64 version. It's probably not strictly necessary but probably has some more features and/or optimizations.Originally Posted by DukeofSerbia
Thank you alpaca. I will download Python 2.5 Windows AMD64 installer.
Watching
EURO 2008 & Mobile Suit Gundam 00
Waiting for: Wimbledon 2008.
I ve got the same problem like FvkinFrustrated.So i copied all files similar to msvcp71.dll from main install folder to Tools\Unpacker.I run unpack_all and it asked me the same questions like Fvkin wrote.But when i type Y for all it was working.BUT I COULDNT EDIT IT BECAUSE THERE WAS TOHSE FVKIN QUESTIONS.Well anyway it runs, but i want to edit it like you have recommended.
Would you know how to do that?![]()
You edit batch files by right-clicking them and press on edit... I wrote it's for advanced users for a reason because I wouldn't recommend changing it if you don't know what you're doing ;)
Yeah it is ok now![]()
.And i find a topic Mod folder installer and downloaded tool also.However i quiet didnt understand it. I have to install it to the BACKUP file wehre i unpacked M2TW?
No, you install it to your MTW2 folder and then copy the files you want to edit into it from your backup folder.
So i chose a way to creat a mod folder.I did all like u wrote and wanted to make some test.Code:5. Testing An easy test is editing a screen text file (for example text/imperial_campaign_regions_and_settlement_names.txt ) and replacing one entry with something different. If your change shows up in the game, you're set up fine.
[code]In the text file you wrote i changed thisto thisCode:{Palermo}Palermo {Palermo_Province}Palermo Region
And the change didnt show.There still was Palermo.How to do that?Code:{MAfiano}Mafiano {Mafiano_Province}Mafiano Region
Of course 1. MAfiano i rename to right Mafiano and still didnt change in game.
I renamed it in mymod/data/imperial_campaign_regions_and_settlement_names.txt and in backup/data/text/imperial_campaign_regions_and_settlement_names.txt .In which folder of this two do i have to rename it?
And can i edit my post on this forum?Because if i forget to write something i always must write a new post and cant edit previous.
Junior members can't edit their posts.
Anyways, try just to change the right hand part of the settlement names, this is the part that actually holds the screen name. The left hand part is the internal name, if you want to change that, you have to change a few more files (not exactly sure which).
You should also make sure to check the system.log.txt file in your MTW2/logs directory.
Yes I changed it. But i made one more mistake befere.Before i could start the campaign(already in game).But i didnt copy mymode.cfg to main M2TW folder but to mymode folder. Now i copied it to main and when in game click on GRAND CAMPAIGN it shows me: PLEASE SELECT AN ITEM FROM THE LIST.
![]()
And could i change and apply textures (when i chose way of MOD FOLDERS) if i write to mymod.cfg also [io]
file_first = true
If not,is it able to change and apply textures in way of creating MOD FOLDERS?
And pls answer my previous question too.But i could do a mistake somewhere too so i check it one more time.
You need the world/maps/base and world/maps/campaigns/imperial_campaign folders from the data folder.
And if you want to use file_first you need to put the files into your mtw2/data dir, they won't be used from the mod folder.
Everythings ok now.I tried both ways and and with each i succesfully changed name of the city.
I am starting to understand moddingand week ago didnt have any idea how to mod.Well it is only begin.
Thank you alpaca.You are boss.You know everything.![]()
Hi there, i am just starting up and what i would like to do is to in the future install different skins,ect.
I understand step on, though i did this last night i did not deleat these files
descr_geography_new.db and descr_geography_new.txt
when i loaded up the game to play custom battle, just befor it started it crashed. i dont really want to do any modding i am not that confidant But i would like to install other peoples work/skins and othe stuff. I am playing LTC at the mo.
What i am asking is, step 1.2 seems confusing,do i need to go through step1.2 in order to install skins and stuff?
Thank you Great forum
Well if you only want to use mods by other people, you probably don't have to follow section 1. at all.Originally Posted by gary
well, i think i would have to unpack them, the data that is, in order to copy and paste skins, i guess,
Hmm ya that's true, I don't know my own tutorials...
Well, then ignore steps 1.1 and 1.2 ;)
alpaca
I finally got my computer from upgrade and installed M2 TW, unpacked and used Python 2.5 Windows AMD64 installer. It can't be installed even I have AMD Athlon64.But ordinary can.
![]()
I have one, maybe stupid question:
Can I erase all those files which I unpacked as I don't need them? I see many RTW-BI fileswhich just slow down performances.
Watching
EURO 2008 & Mobile Suit Gundam 00
Waiting for: Wimbledon 2008.
You shouldn't delete any files. If you want to mod them, you'll have to have at least those that you want to mod (and maybe a few more). You can move them to a backup directory and only copy those to your modding folder/data folder that you actually want to work on, though.Originally Posted by DukeofSerbia
Wow do I feel dumb. Reading through some random threads, I learned that after extracting the patch, you actually have to install it.
I apologize for this waste of space.
Last edited by Psyco; 01-16-2007 at 06:38.
Anyone who has no fear of death himself can succeed in inflicting it.
The Prince,
Machiavelli
Bookmarks