Results 1 to 22 of 22

Thread: Command line switches

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default 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.
    Last edited by alpaca; 10-29-2007 at 18:12.

  2. #2

    Default Re: Command line switches

    Added results from Brisbane visit.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  3. #3

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

  4. #4
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default 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

  5. #5

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

  6. #6

    Default 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

  7. #7
    Member Member mattep74's Avatar
    Join Date
    Jan 2003
    Location
    Vasteras, sweden
    Posts
    26

    Default Re: Config File & .cfg Switching

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

  8. #8
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

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

  9. #9
    Spindly Killer Fish Member ShellShock's Avatar
    Join Date
    Aug 2004
    Location
    UK
    Posts
    189

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

    I hope this helps.
    He does sit in gold, his eye red as 'twould burn Rome.

  10. #10
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Command line switches

    Very nice, might not have thought of that, myself!

  11. #11
    Cydonian Member serenius4tsd's Avatar
    Join Date
    Sep 2006
    Location
    Out there in the wild...
    Posts
    58

    Default Re: Command line switches

    Anyone know what the -ai command line equivalant to M2TW is?

  12. #12
    Bibliophilic Member Atilius's Avatar
    Join Date
    Oct 2005
    Location
    America Medioccidentalis Superior
    Posts
    3,837

    Default Re: Config File & .cfg Switching

    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.
    The truth is the most valuable thing we have. Let us economize it. - Mark Twain



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO