PDA

View Full Version : Command line switches



Modding Forum
10-23-2006, 02:01
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:

[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:

[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:

[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:

[features]
editor = true

Faction Unlocking

These few lines will unlock all playable factions in your campaign:

[misc]
unlock_campaign = true


Running in a Window

To run the game in a window (same as the "-ne" switch in RTW), add:

[video]
windowed = true


Disabling the Videos

If you want to disable the movies for the game ("-nm" switch in RTW), use:

[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:

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:

[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.

Epistolary Richard
11-01-2006, 05:58
Added results from Brisbane visit.

wilddog
11-13-2006, 23:13
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.

alpaca
11-14-2006, 20:01
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:

wilddog
11-14-2006, 22:30
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.

wilddog
11-24-2006, 23:16
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

alpaca
11-25-2006, 12:38
Yes I also noticed this. It's a bit of a bummer tbh because every change you make has to be redone by hand.

mattep74
11-30-2006, 18:56
Disabling the Videos

If you want to disable the movies for the game ("-nm" switch in RTW), use:

[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:

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:)

alpaca
12-01-2006, 14:27
To disable videos you need to create your own configuration file.
With shortcut I mean windows shortcut (right-click, create shortcut)

ShellShock
12-08-2006, 20:27
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:

alpaca
12-08-2006, 21:13
Very nice, might not have thought of that, myself!

serenius4tsd
12-12-2006, 12:35
Anyone know what the -ai command line equivalant to M2TW is?

Kraxis
12-16-2006, 02:43
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.

grinningman
12-16-2006, 11:31
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

grinningman
12-16-2006, 12:54
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?

Kobal2fr
12-18-2006, 23:34
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 :)

FactionHeir
04-03-2007, 11:23
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.

edyzmedieval
04-10-2007, 11:21
Ok, now this probably hasn't happened to you guys, but it is for me.

My .cfg doesn't have [misc]. ~:eek: :help:

wilddog
04-15-2007, 14:22
I guess others probably realised this but with regard to the log commands the default is actually * warning


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).

SigniferOne
04-15-2007, 16:53
Nice point, wilddog. Edzymedieval, just create the [misc] :)

Atilius
10-29-2007, 07:38
[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.

RemusAvenged
12-14-2007, 02:51
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


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