Config File & .cfg Switching
The config file
The medieval2.preference.cfg file that you can find in your M2TW directory has a lot of settings that can be used to enhance modding or customize your game.
The primary uses for it in modding are presumably as a mod switcher (together with a .bat file, explained later), to enable the battle editor, and to set error tracking, but there are some further options that you can enable.
Please note: The following code snippets should be inserted into your .cfg file. If two snippets belong to the same section (sections headers are the words in square brackets), the second section header can (and should) be omitted.
This file should not actually be modified, because according to wilddog the game will overwrite it again. To create a permanent custom configuration, follow the instructions mentioned below under ".cfg Switching".
Bug Tracking
To enable the error logging functions of MTW2, add:
Code:
[log]
to = logs/system.log.txt
level = * error
The following gives a lot of info that won't be very useful for the average modder, but if the error logging doesn't help you, try it:
Code:
[log]
to = logs/system.log.txt
level = * trace
You can further use both level statements in the same file in which case the last setting will be used. As an example, providing:
Code:
[log]
to = logs/system.log.txt
level = * trace
level = * error
Will do the same as if you only supplied level = * error.
Battle Editor
To enable the battle editor, simply add these two lines:
Code:
[features]
editor = true
Faction Unlocking
These few lines will unlock all playable factions in your campaign:
Code:
[misc]
unlock_campaign = true
Running in a Window
To run the game in a window (same as the "-ne" switch in RTW), add:
Code:
[video]
windowed = true
Disabling the Videos
If you want to disable the movies for the game ("-nm" switch in RTW), use:
Code:
[video]
movies = false
.cfg Switching
The .cfg switching mechanism allows you to use different game configuration.
To start the game using a different config file, you have to create a new batch file (create a new text file and rename the file extension to .bat) in your MTW2 directory, that looks like this:
Code:
medieval2.exe @mod.cfg
Then create a copy of your medieval2.preference.cfg, rename it to mod.cfg (you can use any name here, just remember to also change it in the .bat file) and make your changes. Then create a shortcut to your newly-created .bat file and enjoy the game.
Mod Switching
This method can be used as a very efficient mod switching mechanism:
Proceed as above, but before saving your .cfg file, add the following:
Code:
[features]
mod = mymodfolder
The mymodfolder is a placeholder for your personal mod folder, so say you have a mod called "Fishpants", then create a subfolder inside your MTW2 directory called "Fishpants", then add "mod = Fishpants" to your configuration file.
A mod directory will require the data/world/maps/base and data/world/maps/campaign/imperial_campaign folders to work and data/sounds/events.idx and data/sounds/events.dat in order to include sounds.
It should supercede any packed files, but that may actually only be the case after the unpacking tool has been released by CA.
Re: Command line switches
Added results from Brisbane visit.
Re: Command line switches
ER
A couple of comments as I've used that set up for testing - and its great
1) If you don't use your own bat file and CFG and instead just amend the medieval2.preference.cfg file - it lasts for one go and then the game will overwrite the medieval2.preference.cfg file and effectively wipe out any extra lines you added.
2) Regarding the use of
[log]
to = logs/system.log.txt
level = * trace
and
level = * error
If you put both in it will use the last one eg
[log]
to = logs/system.log.txt
level = * trace
level = * error
works with just error on.
Just in case like me you get over tired and just can't quite remember what the other command was.
Re: Command line switches
Changed the first post to a more tutorial-like layout and added wilddogs finds.
Keep up the good work wilddog, as soon as I get the game I'll support you with research :whip:
Re: Command line switches
Alpaca
No problem. The trace command is superb - once you know you've got an error otherwise it really creates a lot of text. You can still search through it though for the 'error' and it will find it so just a much more detailed set of information of exactly what has happened.
eg tells you you have wrong file sizes on maps so points you to correcting the descr_terrain.txt file if you forgot to change or identifies the TGA that you forgot to resize.
Suspect it really comes into its own with script debugging or possibly traits.
Re: Command line switches
I guess one other little thing. If you do then change the options within the game ...they don't affect your *.cfg file referenced from the *.bat file. I believe they go only back to the original .cfg
Re: Command line switches
Yes I also noticed this. It's a bit of a bummer tbh because every change you make has to be redone by hand.
Re: Config File & .cfg Switching
Quote:
Disabling the Videos
If you want to disable the movies for the game ("-nm" switch in RTW), use:
Code:
[video]
movies = false
.cfg Switching
The .cfg switching mechanism allows you to use different game configuration.
To start the game using a different config file, you have to create a new batch file (create a new text file and rename the file extension to .bat) in your MTW2 directory, that looks like this:
Code:
medieval2.exe @mod.cfg
Then create a copy of your medieval2.preference.cfg, rename it to mod.cfg (you can use any name here, just remember to also change it in the .bat file) and make your changes. Then create a shortcut to your newly-created .bat file and enjoy the game.
please help.
One. How do i disable the movies so that they stay disabled? Do i cut everything under video away or?
And create a shortcut to you newly-created .bat. How do you mean? A shortcut in the file or what?
I am a rookie when it comes to codes and the most i have done is changing how much silver is worth in Sid Meiers colonization:)
Re: Command line switches
To disable videos you need to create your own configuration file.
With shortcut I mean windows shortcut (right-click, create shortcut)
Re: Command line switches
I would just like to add that a bat file is not necessary for running a mod via the "mymod" switch. Instead you can just to create a shortcut directly to the medieval2.exe, and add the mod switch to the shortcut arguments.
To see what I mean you can try it manually. Copy and paste the existing "Medieval II Total War" shortcut that was created when you installed the game. Right click the new shortcut and select Properties from the pop-up. On the Shortcut tab, go to the Target field. This should be something like
"C:\Program Files\Sega\Medieval II Total War\medieval2.exe"
Change it to
"C:\Program Files\Sega\Medieval II Total War\medieval2.exe" "@MyMod.cfg"
where MyMod.cfg is the name of your mod cfg file. This shortcut will now run the mod.
Perhaps some mod authors are considering using the bat file method as this can be programmed more easily in their mod installer compared to creating a short cut. But then the user has to run the bat file to play the mod - there is no shortcut icon to the bat file. Ah ah - why not create a shortcut to the bat file as part of the mod installation? But if you are going to do that you might as well create a shortcut direct to medieval2.exe. :wall:
I hope this helps. :dizzy2:
Re: Command line switches
Very nice, might not have thought of that, myself!
Re: Command line switches
Anyone know what the -ai command line equivalant to M2TW is?
Re: Command line switches
Which one of the video 'options' relate to generals and their deaths? I don't really want to see it anymore, but I don't want to disable the other movies in case everything is disabled.
Re: Command line switches
Quote:
Originally Posted by Kraxis
Which one of the video 'options' relate to generals and their deaths? I don't really want to see it anymore, but I don't want to disable the other movies in case everything is disabled.
event_cutscenes = 0
Re: Command line switches
Quote:
A mod directory will require the data/world/maps/campaign/base and data/world/maps/campaign/imperial_campaign folders to work and data/sounds/events.idx and data/sounds/events.dat in order to include sounds.
If I include these files and folders the mod works, but there are no splash screens when the loading bar is showing. How do I get the splash screens to appear in a mod?
Re: Command line switches
Quote:
Originally Posted by grinningman
If I include these files and folders the mod works, but there are no splash screens when the loading bar is showing. How do I get the splash screens to appear in a mod?
Same here. No splash screens, and no fmvs either. Copying the loadingscreen folder to the mod folder works, but the fmv folder is 1.7 Go... Not sure it'll be practical to copy it in every single mod :)
Re: Command line switches
What I did to force the config file to keep my videos off was to make it read only. Only downside is that if you want to change your config in game (which you tend to not do once you found your own optimum) you'll have to make it writable again, but thats really minor.
Saves some trouble with having to run a specific cfg file though.
Re: Command line switches
Ok, now this probably hasn't happened to you guys, but it is for me.
My .cfg doesn't have [misc]. ~:eek: :help:
Re: Command line switches
I guess others probably realised this but with regard to the log commands the default is actually * warning
Quote:
Regarding the use of
[log]
to = logs/system.log.txt
level = * trace
and
level = * error
If you put both in it will use the last one eg
[log]
to = logs/system.log.txt
level = * trace
level = * error
If you add the level = * warning or have no level command then you get the errors + warning commands (although warnings are misleading as you get a lot of them anyway).
Re: Command line switches
Nice point, wilddog. Edzymedieval, just create the [misc] :)
Re: Config File & .cfg Switching
Quote:
Code:
[features]
mod = mymodfolder
The mymodfolder is a placeholder ... A mod directory will require the
data/world/maps/campaign/base ...
Just a typo I'm sure, but that should be data/world/maps/base or bad things happen; base is in the maps folder, not the campaign folder.
Re: Command line switches
Quote:
Originally Posted by kraxis
Which one of the video 'options' relate to generals and their deaths? I don't really want to see it anymore, but I don't want to disable the other movies in case everything is disabled.
Quote:
Originally Posted by grinningman
event_cutscenes = 0
I've been having problems with these cut scenes causing the program to quit when I kill the enemy general. Where does this line need to be added?
I've tried adding
[video]
movies = false
to the cfg but that must control something else.
Thanks