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:
I recommend editing unpack_all.bat to not unpack into your vanilla data directory, but into a subfolder. This way, you can always keep a clean copy of the files.
To do this, open up the batch file and edit it like this:
That will unpack the files into a directory called backup inside your MTW2 folder.
You should also copy the data/world/maps/base and data/world/maps/campaign/imperial_campaign folders to this directory
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:
First of all, create a new folder inside your MTW2 directory called "mymod" (you can replace mymod with anything you like, as long as you keep replacing it throughout the rest of this section).
3.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:
Code:
[features]
mod = mymod
[log]
to = logs/system.log.txt
level = * error
The first setting tells the game the mod folder in which it should look for files, the second enables error logging to a custom error log file which is highly recommended, but not exactly required.
3.2 Necessary files
Before proceeding, please create a data folder inside your "mymod" folder.
In order for your mod folder setup to work, you will have to copy data/world/maps/base and data/world/maps/campaign/imperial_campaign, as well as text/imperial_campaign_regions_and_settlement_names.txt to your "mymod" directory, leaving the directory structure intact (i.e. data/world/maps/base should go to mymod/data/world/maps/base, etc.)
3.3 Optional files
On top of this, you may want to copy the following:
- To enable sounds, data/sounds/events.dat and data/sounds/events.idx
- To enable loading screens, data/loading_screen
- To enable event videos, data/fmv
Of course, you should also copy any files you want to edit into the data directory of your mod folder.
3.4 Batch file creation
In order to be able to start your game using your mod folder, create a new text file inside your MTW2 directory called mymod.bat
Open it (right-click, edit) and write this into it:
Code:
medieval2.exe @mymod.cfg
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:
Code:
[io]
file_first = 1
[log]
to = logs/system.log.txt
level = * error
This will tell the game to use the files it finds in the data directory instead of those in the packs.
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:
Code:
medieval2.exe @mymod.cfg
Congratulations. If everything worked, you should now be able to run the game with your unpacked files by starting mymod.bat
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
Code:
{London} London
to
Code:
{London} The Moloch
If 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.
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:
Code:
[log]
to = logs/system.log.txt
level = * error
This tells the game to create an error log in the MTW2/logs folder called system.log.txt
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.
The progression for log levels is trace<info<warn<debug<err<fatal<always
Usually, the most useful one is level = * err or level = * error because it will show you the errors you make (like spelling mistakes and so on) without giving a lot of unnecessary info. However, if you're creating triggers or scripts and want to test them you should use level = game.script.* trace as it will yield all the info about the scripting side of the game, including triggers.
I don't think there are any debug messages in the retail exe so debug is the same level as err
The warn level can be useful sometimes if you want info about missing files and so on but you'll have to dig through a lot of stuff to find it.
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.
12-29-2006, 13:24
DukeofSerbia
.bin editor
Quote:
Originally Posted by alpaca
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.
Hello 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...)?
12-29-2006, 20:03
alpaca
Re: .bin editor
Quote:
Originally Posted by DukeofSerbia
Hello 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...)?
Well I didn't try his tool. If it works, then you can directly modify them.
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.
12-31-2006, 18:46
Valentine82
Re: HowTo: Set up MTW2 for modding
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.
:iloveyou: :crown: :egypt:
01-01-2007, 19:02
alpaca
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by Valentine82
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.
:iloveyou: :crown: :egypt:
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 ;)
01-02-2007, 06:55
FvkinFrustrated
Re: HowTo: Set up MTW2 for modding
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
01-02-2007, 07:02
FvkinFrustrated
Re: HowTo: Set up MTW2 for modding
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
01-02-2007, 14:13
alpaca
Re: HowTo: Set up MTW2 for modding
Mate, watch your language please. Rants against CA have no right of existence in this thread.
Especially not if you use swearwords.
Well I didn't try his tool. If it works, then you can directly modify them.
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.
My computer is on upgrade and when it backs I will check and post results here.
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? :help:
01-08-2007, 14:17
alpaca
Re: .bin editor and Python
Quote:
Originally Posted by DukeofSerbia
My computer is on upgrade and when it backs I will check and post results here.
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? :help:
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.
01-08-2007, 20:14
DukeofSerbia
Re: .bin editor and Python
Thank you alpaca. I will download Python 2.5 Windows AMD64 installer.
01-09-2007, 20:55
mmarekk11
Re: HowTo: Set up MTW2 for modding
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? :help:
01-09-2007, 22:03
alpaca
Re: HowTo: Set up MTW2 for modding
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 ;)
01-09-2007, 23:20
mmarekk11
Re: HowTo: Set up MTW2 for modding
Yeah it is ok now :2thumbsup: :beam: .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?
01-10-2007, 00:11
alpaca
Re: HowTo: Set up MTW2 for modding
No, you install it to your MTW2 folder and then copy the files you want to edit into it from your backup folder.
01-10-2007, 20:35
mmarekk11
Re: HowTo: Set up MTW2 for modding
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 this
Code:
{Palermo}Palermo
{Palermo_Province}Palermo Region
to this
Code:
{MAfiano}Mafiano
{Mafiano_Province}Mafiano Region
And the change didnt show.There still was Palermo.How to do that?
01-10-2007, 20:42
mmarekk11
Re: HowTo: Set up MTW2 for modding
Of course 1. MAfiano i rename to right Mafiano and still didnt change in game.
01-10-2007, 21:04
mmarekk11
Re: HowTo: Set up MTW2 for modding
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.
01-10-2007, 22:01
alpaca
Re: HowTo: Set up MTW2 for modding
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.
01-10-2007, 22:13
mmarekk11
Re: HowTo: Set up MTW2 for modding
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.
:help:
01-11-2007, 20:29
mmarekk11
Re: HowTo: Set up MTW2 for modding
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.
01-11-2007, 22:00
alpaca
Re: HowTo: Set up MTW2 for modding
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.
01-11-2007, 23:20
mmarekk11
Re: HowTo: Set up MTW2 for modding
Everythings ok now.I tried both ways and and with each i succesfully changed name of the city.
I am starting to understand modding :jumping: and week ago didnt have any idea how to mod.Well it is only begin.
Thank you alpaca.You are boss.You know everything. :beam:
01-12-2007, 12:57
gary
Re: HowTo: Set up MTW2 for modding
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
01-12-2007, 14:18
alpaca
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by gary
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.
01-12-2007, 14:20
gary
Re: HowTo: Set up MTW2 for modding
well, i think i would have to unpack them, the data that is, in order to copy and paste skins, i guess,
01-12-2007, 14:22
alpaca
Re: HowTo: Set up MTW2 for modding
Hmm ya that's true, I don't know my own tutorials...
Well, then ignore steps 1.1 and 1.2 ;)
01-12-2007, 21:11
DukeofSerbia
Question
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. :thumbsdown: But ordinary can. :2thumbsup:
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 files :inquisitive: which just slow down performances.
01-13-2007, 00:17
alpaca
Re: Question
Quote:
Originally Posted by DukeofSerbia
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. :thumbsdown: But ordinary can. :2thumbsup:
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 files :inquisitive: which just slow down performances.
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.
01-16-2007, 05:48
Psyco
Re: HowTo: Set up MTW2 for modding
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.
01-17-2007, 00:49
grinningman
Re: HowTo: Set up MTW2 for modding
Hey alpaca, you might want to mention that your mod folder installer doesn't delete or rename descr_geography_new.db and descr_geography_new.txt. I know you mention this when you talk about unpacking the files, but it's not clear that this is still required if you use your installer (and it took me a while to work out why my modded version kept crashing ~:) ).
Apart from that the installer is excellent - thanks heaps for putting it together!
01-17-2007, 18:17
alpaca
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by grinningman
Hey alpaca, you might want to mention that your mod folder installer doesn't delete or rename descr_geography_new.db and descr_geography_new.txt. I know you mention this when you talk about unpacking the files, but it's not clear that this is still required if you use your installer (and it took me a while to work out why my modded version kept crashing ~:) ).
Apart from that the installer is excellent - thanks heaps for putting it together!
Hum, maybe I'll just write "DELETE THIS" in bold ;)
I didn't say it's optional though, so why didn't you delete it?
02-06-2007, 20:48
dzzirt
Re: HowTo: Set up MTW2 for modding
Doh i might sound stupid, but ive got a problem whith using this guide.
So my steps were :
1. installed v 1.1 --> ran unpack_all.bat ---> deleted descr_geography_new.db and descr_geography_new.txt in m2tw/data
2. Converted text files using script (installed python ---> unpacked alpaca's MTW2 .strings.bin converter into m2tw/data/text directory and ran it
3. downloaded, ran the Mod folder installer , and selected mine MTW2 directory as the installation directory, chosen all of the componets (actually it was default setting) to install ---> installed.
4. Now there was the problem - tried to test.... :
- opened text/imperial_campaign_regions_and_settlement_names.txt and changed {London}London to {London}Supadupacity
- started game using mymod.bat (cant see extension, so its only mymod for me) ---> game loaded ---> started English campaing ---> London is still London there :(((
QUESTION: what did i wrong here ???
02-06-2007, 21:06
dzzirt
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by dzzirt
- opened text/imperial_campaign_regions_and_settlement_names.txt and changed {London}London to {London}Supadupacity
Edited this file both in mymod directory and in normal one - still doesnt work :(
02-06-2007, 21:36
dzzirt
Re: HowTo: Set up MTW2 for modding
Tried to create and edit mymod.cfg aswell - doesnt work, but it worked when i added
[io]
file_first = 1
[log]
to = logs/system.log.txt
level = * error
to the top of original medieval2.preference.csfg :/
think ive messed up with extension of mine mymod.cfg file (so it is actually mymod.cfg.txt now or smthing like that)
How to work with extensions in windows?? So i can find it out
02-09-2007, 14:28
zuli
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by dzzirt
How to work with extensions in windows?? So i can find it out
Right-click on the file and see Properties. There you see full name of the file and can edit it.
You might also want to set the extensions visible all the time:
In Explorer go to 'Tools > Folder options...'
On 'View'-tab uncheck 'Hide extensions for known file types'
I'm not sure if you need to click on 'Apply to all folders', but it wont hurt.
---
I'd have a question of the mod folders. I'm a bit confused, full day of reading these forums and all i got was a broken mod folder in the end :)
I followed all the way through Step 3 of this tutorial and got a working mod folder set up. I edited a starting leader of a campaign, traits and name, got it working just fine.
Now i would like to make new traits. So i need to tamper with the .string.bin files. But when i unpack the packs into my modfolder, edit the needed text files for my liking, and delete the original .string.bin's, the game wont start.
Trace logs show that the game crashes when loading 'filter.san' file, and atleast once got past that and crashed when loading 'preferenses\player.txt'. Which both seem like they have nothing to do with the crash, since i havent touched them at all.
Well, my traits prolly crash the thing, but thats another matter.
What i'd like to know is if this is the right way to do things?
Do tutorial Step 3 (setup the modfolder)
Unpack packs to modfolder
Unpack .string.bin's and edit them
Delete the originals
Game generates new bins and voila...
I wouldnt want to mess up the games own data folder with unpacking there, and i read somewhere that the game wont even generate new string.bins from text files in its own folders. So i tought the modfolder was the way to go.
Geez, this came out long. Anyways, any advice will be appreciated :)
02-15-2007, 13:08
lismore
Re: HowTo: Set up MTW2 for modding
Hi
I downloaded the patch and extracted.
Sorry if this is a silly question.........to change unit stats for the main camapiuagn would I go into:
medieval2totalwar/data/export_descr_unit.txt
Or does the path need to be different? I tried to edit one or two and nothing changed.
Thanks
02-20-2007, 14:23
VVLAJX
Re: HowTo: Set up MTW2 for modding
Hi i tryed to set up mtw2 I DO EVERYTHING FINE AND I TRYED TO RENAME LONDON INTO THE MOLOCH.:help: :help: :help: WHAT TO DO NOW:help: :help: PLEASE
02-23-2007, 01:27
Zain
Re: HowTo: Set up MTW2 for modding
I've got everything working, the mymod thing, everything's unpacked, I can edit everything now. BUT, the .bin to .txt converter is asking me a question I can't answer.
I downloaded the Python thing, and have the entire folder of the converter in data/text. Now, every time I select the convert_all.bat it asks me to select a program to run it from. I browsed around and selected every .exe in Python, but nothing's working. Anything to help?
-Zain
02-23-2007, 15:23
Mighty Oggy
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by Zain
I've got everything working, the mymod thing, everything's unpacked, I can edit everything now. BUT, the .bin to .txt converter is asking me a question I can't answer.
I downloaded the Python thing, and have the entire folder of the converter in data/text. Now, every time I select the convert_all.bat it asks me to select a program to run it from. I browsed around and selected every .exe in Python, but nothing's working. Anything to help?
-Zain
I'm having exactly the same problem.:wall:
02-23-2007, 17:32
Mighty Oggy
Re: HowTo: Set up MTW2 for modding
Strange, now it works!
Zain, keep trying. I had exactly the same and now it works (I didn't do anything)
02-24-2007, 23:25
adembroski
Re: HowTo: Set up MTW2 for modding
Since I am not an "advanced user", is keeping a clean copy of the contents of the data folder backed up an effective alternative to editing unpack_all.bat?
02-24-2007, 23:30
adembroski
Re: HowTo: Set up MTW2 for modding
Same issue as the others with london... followed instructions explicitly, twice. You've gotta be missing something here... it's not working. Further, I'm getting CTD everytime I try to start a battle in either the mod or the vanilla game.
02-25-2007, 17:24
Zain
Re: HowTo: Set up MTW2 for modding
I got everything working!
02-25-2007, 19:55
adembroski
Re: HowTo: Set up MTW2 for modding
So can I run the vanilla game using the io.file_first method??!
02-28-2007, 00:32
adembroski
Re: HowTo: Set up MTW2 for modding
Issue resolved for me...
to those having problems getting the London named changed, make sure your config file is named 'mymod.cfg' and not 'mymod.cfg.cfg'. If mymod.bat can't find mymod.cfg, it will grab the default preferences (even so far as to create it's own preferences file if one is not present). Then it's running the vanilla game and your modifications wont show up.
02-28-2007, 13:37
Zain
Re: HowTo: Set up MTW2 for modding
I have a question concerning converting the text files...
To have a change noticed in the Text folder, must I first delete the BIN file that coordinates with it? ex: text.txt and text.bin?
Thanks, this isn't a big deal, so take your time.
:coffeenews:
-Zain
02-28-2007, 15:15
Lusted
Re: HowTo: Set up MTW2 for modding
Yes you need to delete the .string.bin file, the game will then make a new one from your modified .txt file.
02-28-2007, 22:18
adembroski
Re: HowTo: Set up MTW2 for modding
As i have learned, you wanna ask questions in the questions forum... people don't really look for them here.
03-01-2007, 00:11
Zain
Re: HowTo: Set up MTW2 for modding
My target answerers are the people on this specific thread. Thanks for the advice though, but I know what I'm doing.
03-06-2007, 08:39
Suraknar
Re: HowTo: Set up MTW2 for modding
I been looking in to the approach between Mymod Folder and IO file first.
And, (correct me if my asumption if false), Mymod folder is a nice "overide" way of making and distributing certain mods, yet IO file first is more suited for Conversions and Larger mods.
Yes?
03-06-2007, 14:51
alpaca
Re: HowTo: Set up MTW2 for modding
No, if a mod folder worked with all files, it should be the preferred method of distributing any mod because it doesn't disturb the original data and you can have multiple mods installed at the same time, whereas file_first is "messy".
So, I hope that after the 2nd patch, I can finally forget about file_first and simply propose using a mod folder to everybody.
03-14-2007, 20:55
TotalWarVet
Re: HowTo: Set up MTW2 for modding
I used to architect/design/write software for a living, so forgive me for raising the following issue and being so verbose.
By the way, are you a unix/linux guy (use/ instead of MS \in your directory/path descriptions :beam: ).
I believe I've done as instructed in this tutorial, but game refuses to startup.
I have a full backup installation on a seperate drive which is the starting point for me. Copied the whole darn thing.
Game .exe and all files in f:\games\Medieval II Total WarMod\ directory and associated subtrees just as in original install. Game runs just fine when dblclick medieval2.exe (can call up/load save games etc.).
I've created a f:\games\Medieval II Total WarMod\mods folder and replaced mymod references in your tutorial with mods.
Ran the unpacker and then deleted the descr_geography_new.db and descr_geography_new.txt files as instructed.
So now I have two \data trees.
The original one f:\games\Medieval II Total WarMod\data and the one I'll be using for mods in f:\games\Medieval II Total WarMod\mods\data which contains all the unpacked text and strings.bin files as well as the data/world/maps/base and data/world/maps/campaign/imperial_campaign (sic).
Furthermore, I've copied the full fmv and world subtrees from the original \data.
So now I have a full set of files and directory subtrees in mods\data (including animations, banners,...,fmv,...,vegetation, world). I've taken the original strings.bin files that where generated by unpacker in \text subdirectory and subsequently converted by your strings.bin converter and moved them to \text\OrigStringsBin. The unconverted strings.bin files I left in \text.
Aside: By the way, it looks like M2SBE strings.bin file manipulation tool only works with the same files your tool does. Have an email in to author asking for clarification. :inquisitive:
At this point, I edited the imperial_campaign_regions_and_settlement_names.txt as directed and attempted to run the game, but alas no luck. I've dblchecked everything and all seems fine.
Here is the error log generated while trying to run game.
Could it be that I have too much stuff in mods\data? Should I move some of this somewhere else? Wanted full set of files in one place for easy modification.
:help:
03-15-2007, 13:29
alpaca
Re: HowTo: Set up MTW2 for modding
If you edited imperial_campaign_settlement_names.txt but didn't delete the .strings.bin file that might be the culprit.
And I'm not really a Linux guy (I use it at the uni but at home I mostly use my PC for playing or modding and you do that under Windows), but in Unix environments (as well as in programming) you have to actually enter pathnames a lot more often than you usually do under windows, so I got used to the forward slashes :sweatdrop:
03-15-2007, 21:41
TotalWarVet
Re: HowTo: Set up MTW2 for modding
"If you edited imperial_campaign_settlement_names.txt but didn't delete the .strings.bin file that might be the culprit."
As I stated in my earlier post I did move all .strings.bin files that were coverted by the strings.bin converter into a subdirectory of \text called
\text\OrigStringsBin.
I have a feeling that I may have more files than I need or maybe should have.
Here is a another representation of the directory tree and files. Maybe you can shed some light on this.
f:\Games\Medieval II Total WarMod\
1) contains medieval2.exe and all other game files in original install. I also have mods.bat, mods.cfg (analogous to mymod.bat/.cfg) added by me.
2) contains a full directory subtree as in game original install
(\data, \logs, \miles .... \tools) I also have \mods subdirectory added by me.
f:\Games\Medieval II Total WarMod\mods contains the following:
a subdirectory \data and some text files containing modding ideas (no name overlap). It also contains an empty \packs folder after I tried to run mod.bat.
f:\Games\Medieval II Total WarMod\mods\data contains the following:
subdirectories containing the unpacked files generated by the unpacker.
(\animations ... \world) plus the games original \fmv and \worlds subdirectories and their files and subtrees.
f:\Games\Medieval II Total WarMod\mods\data\text contains the following:
files generated by strings.bin converter (includes imperial_campaign_settlement_names.txt) plus those strings.bin files not converted. All the original unconverted versions of the converted files were placed in a subdirectory of text called OrigStringsBin
(f:\Games\Medieval II Total WarMod\mods\data\text\OrigStringsBin)
I must be missing something obvious as this can't be that hard. :wall:
TIA
:2thumbsup:
03-15-2007, 22:13
alpaca
Re: HowTo: Set up MTW2 for modding
Did you try using my modfolder installer? The minimal setup for a mod folder is:
data/text/imperial_campaign_regions_and_settlement_names.txt
data/world/maps/base
data/world/maps/campaign/imperial_campaign
You could also try it with that and then simply add to it what you mod (that's my usual approach).
03-24-2007, 15:51
adembroski
Re: HowTo: Set up MTW2 for modding
I just noticed this and might be the root of an issue someone above had...
The mod folder installer does not create the preferences file, only the folder, batch file, and shortcut. The part in the mod folder section should be edited to point this out, by taking the preferences file part out of the hidden section.
03-25-2007, 14:51
alpaca
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by adembroski
I just noticed this and might be the root of an issue someone above had...
The mod folder installer does not create the preferences file, only the folder, batch file, and shortcut. The part in the mod folder section should be edited to point this out, by taking the preferences file part out of the hidden section.
Hmm it should create the cfg file, too. You'll have to have a vanilla m2 config in the folder though, as it copies that. Otherwise you could check if a file called modfixer.bat is created and try to run that.
03-26-2007, 22:42
methoz
Re: HowTo: Set up MTW2 for modding
can i edit cost and stats ? and how to?
04-01-2007, 13:03
bearkiss
Re: HowTo: Set up MTW2 for modding
I also have the same question!
Please help in editing stats!
I've tried to rewrite the attack and hit points of some units in export_descr_unit, but nothing have changed yet.
04-01-2007, 14:20
alpaca
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by bearkiss
I also have the same question!
Please help in editing stats!
I've tried to rewrite the attack and hit points of some units in export_descr_unit, but nothing have changed yet.
Then your game is probably not set up right...
Try to get the mod folder/file_first to work properly before you start on editing other stuff.
04-02-2007, 20:23
Miloshus
Re: HowTo: Set up MTW2 for modding
Im realy confused when modding, but when Im triing to make MTW2 ready for modding, I often forget my name....
I have a problem,
-I have installed MTW2 1.1
-I have unpacked files
-I have changed files in data/text directory with python 2.5 to txt
-I have installed the mod folder, but the files mymod.cfg and mymod.bat arent created?!
What to do?:help: :help: :help: :help:
04-02-2007, 23:34
alpaca
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by Miloshus
Im realy confused when modding, but when Im triing to make MTW2 ready for modding, I often forget my name....
I have a problem,
-I have installed MTW2 1.1
-I have unpacked files
-I have changed files in data/text directory with python 2.5 to txt
-I have installed the mod folder, but the files mymod.cfg and mymod.bat arent created?!
What to do?:help: :help: :help: :help:
Right now the best way is probably to create them by hand (as described in the advanced info).
I'll wait for M2 v1.2 before doing any work on this because some stuff might change.
04-05-2007, 10:47
Crazed_Monkey
Re: HowTo: Set up MTW2 for modding
Hi,
I have clicked on the Unpacker and a Black DOS screen appears I answered the questions and then the screen disappeared and nothing happened.
Can you please tell me where I have gone wrong? :help:
Thank You
04-05-2007, 12:08
alpaca
Re: HowTo: Set up MTW2 for modding
Did you run the batch file unpack_all.bat?
04-06-2007, 12:05
Crazed_Monkey
Re: HowTo: Set up MTW2 for modding
Oh sorry i clicked on the wrong one !:oops:
Im currently doing it now thanks for pointing it out :smash:
04-06-2007, 17:12
paladinj
Re: HowTo: Set up MTW2 for modding
Hi great Tutorial!
I have tried following your tutorial and I have decided to edit the .strings.bin files directly,
where are the .strings.bin files? I have looked in the data folder but all i have is: animations,cursors,fmv,sounds,world:embarassed:
if I have your unpacker what steps don't I need to do?
I don't have medieval2.preference.cfg in my main folder I have medieval2.preference is it good for creating the mymod.cfg?
Thankyou I'm a NOOB
04-06-2007, 22:41
alpaca
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by paladinj
Hi great Tutorial!
I have tried following your tutorial and I have decided to edit the .strings.bin files directly,
where are the .strings.bin files? I have looked in the data folder but all i have is: animations,cursors,fmv,sounds,world:embarassed:
if I have your unpacker what steps don't I need to do?
I don't have medieval2.preference.cfg in my main folder I have medieval2.preference is it good for creating the mymod.cfg?
Thankyou I'm a NOOB
Thanks.
You'll have to unpack the files by running tools/unpacker/unpack_all.bat as described in step 1 - the string files will be in data/text then
You should enable "Show known file extensions" in windows, then you will notice that medieval2.preference is actually medieval2.preference.cfg
04-09-2007, 11:17
RickooClan
Re: HowTo: Set up MTW2 for modding
Hi, this is my first time to mod in MTW2, it seems so complicated compare with RTW which i just edit the descr file with notepad. :embarassed:
I follow the steps and created mymod.cfg and mymod.bat file, however if i double click on mymod.bat it just open the notepad file instead of running the medival 2.exe as instructed? Also, i cant find the "imperial_campaign_regions_and_settlement_names.txt" file after i use the converter in the text folder, all i can find is "imperial_campaign_regions_and_settlement_names.txt.strings"
Meanwhile i have installed the unofficial 1.2 patch on a clean MTW2, if it will work very differently compare with the instruction in this tutorial? :dizzy2:
04-09-2007, 20:38
alpaca
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by RickooClan
Hi, this is my first time to mod in MTW2, it seems so complicated compare with RTW which i just edit the descr file with notepad. :embarassed:
I follow the steps and created mymod.cfg and mymod.bat file, however if i double click on mymod.bat it just open the notepad file instead of running the medival 2.exe as instructed? Also, i cant find the "imperial_campaign_regions_and_settlement_names.txt" file after i use the converter in the text folder, all i can find is "imperial_campaign_regions_and_settlement_names.txt.strings"
Meanwhile i have installed the unofficial 1.2 patch on a clean MTW2, if it will work very differently compare with the instruction in this tutorial? :dizzy2:
Enable "show known file extensions" in "Tools"->"Folder Options" in the windows explorer.
And the steps described should work fine.
04-11-2007, 19:51
RickooClan
Re: HowTo: Set up MTW2 for modding
Thx a lot and the mymod.bat file works now, it pop up a dos screen and running the game (just like the 1.1 problem fixer i download here :yes: )
However, whenever i get into the selecting faction screen it CTD. I didnt really edit anything in the data folder, perhaps it is a 1.2 leaked patch issues?
04-11-2007, 21:20
SigniferOne
Re: HowTo: Set up MTW2 for modding
What did you copy into the new mod folder? All mod folders need to have certain sub-folders, even if empty: /packs, /data/world, maybe even /custom. Download one of the many M2TW mods, and see their directory structure. You'll find they have a few empty folders which are nevertheless necessary, and just imitate that. We've successfully ported Paeninsula Italica to the M2 modding structure, and it works without a flaw.
Note that to edit the map, you'll have to copy your world/maps/base folder, and this thing doesn't include any graphical tidbits like a radar map, faction maps or loading screens.
What you need in your mod folder is basically the map (world/maps/base and world/maps/imperial_campaign plus text/imperial_campaign_regions_and_settlement_names.txt) because the game won't read that from the packs.
04-12-2007, 10:34
RickooClan
Re: HowTo: Set up MTW2 for modding
Thx guys, my mod is working now after i use the mod folder option instead of iso option. No sure why was it happened.
One thing i want to ask if the mod compatable with save game? For example i create mymod and start a new game. Then i mod some data and if it will work on the saved game i just created or i have to start all over to put them in effect?
04-12-2007, 13:08
alpaca
Re: HowTo: Set up MTW2 for modding
A lot of changes aren't save-game compatible, while some are.
To be on the safe side, I wouldn't work with savegames.
04-18-2007, 20:52
Tanit
Re: HowTo: Set up MTW2 for modding
Hello, I am having the same problem as the swearing fellow had on the first page and I did the same thing you told him to do but the unpacker still just closes after I answer all the questions. And I am using the batch file.
04-24-2007, 22:51
oklahomasooners
Re: HowTo: Set up MTW2 for modding
it might just be my mind playing tricks on me but i'm pretty sure the unpacker exits near the end. i say this because each time i check to see if it workd i can't find geography file things that i'm supposed to delete.
04-25-2007, 19:03
alpaca
Re: HowTo: Set up MTW2 for modding
Maybe your disk is full :laugh4:
04-29-2007, 17:48
oklahomasooners
Re: HowTo: Set up MTW2 for modding
is me not being able to fully run the unpacker to do with vista?
04-29-2007, 18:08
alpaca
Re: HowTo: Set up MTW2 for modding
Quote:
Originally Posted by oklahomasooners
is me not being able to fully run the unpacker to do with vista?
Could be, people are reporting problems with Vista a lot... Maybe you have to set special rights for the file.