Difference between revisions of "Configuration file"

From TTWiki
Jump to navigationJump to search
m (3 revisions)
(Reformat and update)
Line 1: Line 1:
 
The configuration file tells TTDPatch which of the patches you want to be enabled, and how. It is simply a list of the patches, followed by what you want it to do with this switch.
   
 
If no configuration file is specified at the command line, that is, if there is no -C option, TTDPatch will read the default <tt>ttdpatch.cfg</tt>. You can specify several configuration files, and they will be read in the order you give them, but if you want TTDPatch to read <tt>ttdpatch.cfg</tt> ''and'' your file, you have to specify ''both''.
'''''The file that tells TTDPatch what patches it should apply.'''''
 
 
=Configuration File=
 
 
The file that tells TTDPatch what patches it should apply.
 
 
The configuration file tells TTDPatch which of the patches you want to be enabled, and how. &nbsp;It is simply a list of the patches, followed by what you want it to do with this switch.
 
 
If no configuration file is specified at the command line, that is, if there is no -C option, TTDPatch will read the default -+ttdpatch.cfg+-. You can specify several configuration files, and they will be read in the order you give them, but if you want TTDPatch to read -+ttdpatch.cfg+- ''and'' your file, you have to specify ''both''.
 
   
 
To change the configuration, simply open the file in any text editor, like Notepad under Windows or Edit under DOS.
 
To change the configuration, simply open the file in any text editor, like Notepad under Windows or Edit under DOS.
   
The syntax of the configuration file is simple: all lines starting with a letter define the value of an option, all others are ignored. &nbsp;The line defining the option should have one of the following formats:<pre>-+servint 16000+-
+
The syntax of the configuration file is simple: all lines starting with a letter define the value of an option, all others are ignored. The line defining the option should have one of the following formats:<pre>servint 16000</tt>
   
-+servint = 16000+-</pre>
+
<tt>servint = 16000</pre>
   
 
You can add more spaces, or in the second case take them out.
 
You can add more spaces, or in the second case take them out.
Line 20: Line 13:
 
There are three kinds of switches: on/off switches, switches with a value, and switches with bit settings.
 
There are three kinds of switches: on/off switches, switches with a value, and switches with bit settings.
   
;On/off switches:For on/off switches (for example trainrefit), you can set them to any of -+on, yes, y, 1+- to turn them on, or -+off, no, n, 0+- to turn them off.
+
;On/off switches:For on/off switches (for example trainrefit), you can set them to any of <tt>on, yes, y, 1</tt> to turn them on, or <tt>off, no, n, 0</tt> to turn them off.
   
;Switches with values:Switches with values, for example servint, can be set to a value within the allowable range, or any of the above on/off values. &nbsp;If a switch should have a value but doesn't, the value is set to the default for that switch; if the given value is out of range, it is set to the nearest allowable value. &nbsp;You can turn a switch off by setting it to any of -+off, no, n+-, but not 0 (unless 0 is not in the range for this particular switch). &nbsp;For example, -+servint on+- sets the new service interval to the default value of 16000 days, -+servint 240+- sets it to 240 days, and -+servint off+- turns the servint feature off.
+
;Switches with values:Switches with values, for example servint, can be set to a value within the allowable range, or any of the above on/off values. If a switch should have a value but doesn't, the value is set to the default for that switch; if the given value is out of range, it is set to the nearest allowable value. You can turn a switch off by setting it to any of <tt>off, no, n</tt>, but not 0 (unless 0 is not in the range for this particular switch). For example, <tt>servint on</tt> sets the new service interval to the default value of 16000 days, <tt>servint 240</tt> sets it to 240 days, and <tt>servint off</tt> turns the servint feature off.
   
;BitSwitches:Finally, switches with bit settings allow you to choose various settings of that switch. Please see the BitSwitches page for a description of how these work.
+
;BitSwitches:Finally, switches with bit settings allow you to choose various settings of that switch. Please see the [[BitSwitches]] page for a description of how these work.
   
You can also have TTDPatch write a customised configuration file with the -W switch. &nbsp;This useful for example to create a configuration file in your language, if it is supported. &nbsp;To convert -+ttdpatch.cfg+-, simply run TTDPatch with<pre>-+ttdpatch -W ttdpatch.cfg+-</pre>
+
You can also have TTDPatch write a customised configuration file with the -W switch. This useful for example to create a configuration file in your language, if it is supported. To convert <tt>ttdpatch.cfg</tt>, simply run TTDPatch with<pre>ttdpatch -W ttdpatch.cfg</pre>
   
Alternatively, put<pre>-+writecfg ttdpatch.cfg+-</pre>
+
Alternatively, put<pre>writecfg ttdpatch.cfg</pre>
   
in your -+ttdpatch.cfg+-.
+
in your <tt>ttdpatch.cfg</tt>.
   
The result of this is that &nbsp;the configuration file will be in the selected language (see &nbsp;[[LanguageSelection|Language Selection]]), &nbsp;and you can read and edit it easily. &nbsp;It will also automatically add options that were missing or misspelt in the original file.
+
The result of this is that the configuration file will be in the selected language (see [[LanguageSelection|Language Selection]]), and you can read and edit it easily. It will also automatically add options that were missing or misspelt in the original file.
   
Since 1.8, the Windows version of TTDPatch converts all comments in the configuration file to the local Windows code page. &nbsp;If that code page does not support all characters used in the selected language, parts of the text may look wrong. &nbsp;To override this behavior, set the environment variable ACP (&quot;ANSI Code Page&quot;) to the number of the code page you want. &nbsp;If you specify a code page that is not supported by the Windows installation you're using, no conversion will take place and thus comments will be written in the native DOS code page of the selected language.
+
Since 1.8, the Windows version of TTDPatch converts all comments in the configuration file to the local Windows code page. If that code page does not support all characters used in the selected language, parts of the text may look wrong. To override this behavior, set the environment variable <tt>ACP</tt> ("ANSI Code Page") to the number of the code page you want. If you specify a code page that is not supported by the Windows installation you're using, no conversion will take place and thus comments will be written in the native DOS code page of the selected language.
   
For example, to rewrite -+ttdpatch.cfg+- as -+new.cfg+- in Russian using the Windows Cyryllic code page, run the following three commands in order, from the command line:<pre>-+SET LANG=russian+-
+
For example, to rewrite <tt>ttdpatch.cfg</tt> as <tt>new.cfg</tt> in Russian using the Windows Cyryllic code page, run the following three commands in order, from the command line:<pre>SET LANG=russian</tt>
   
-+SET ACP=1251+-
+
<tt>SET ACP=1251</tt>
   
-+ttdpatchw -W new.cfg+-</pre>
+
<tt>ttdpatchw -W new.cfg</pre>
   
 
(A simpler way to do it in Windows is to put these commands in a batch file and run it.)
 
(A simpler way to do it in Windows is to put these commands in a batch file and run it.)
   
 
The DOS version of TTDPatch does not perform any code page conversions.
 
The DOS version of TTDPatch does not perform any code page conversions.
  +
[[Category:Usage]][[Category:TTDPatch]][[Category:TTDPatch Manual]]

Revision as of 13:28, 13 June 2011

The configuration file tells TTDPatch which of the patches you want to be enabled, and how. It is simply a list of the patches, followed by what you want it to do with this switch.

If no configuration file is specified at the command line, that is, if there is no -C option, TTDPatch will read the default ttdpatch.cfg. You can specify several configuration files, and they will be read in the order you give them, but if you want TTDPatch to read ttdpatch.cfg and your file, you have to specify both.

To change the configuration, simply open the file in any text editor, like Notepad under Windows or Edit under DOS.

The syntax of the configuration file is simple: all lines starting with a letter define the value of an option, all others are ignored. The line defining the option should have one of the following formats:

servint 16000</tt>

<tt>servint = 16000

You can add more spaces, or in the second case take them out.

There are three kinds of switches: on/off switches, switches with a value, and switches with bit settings.

On/off switches
For on/off switches (for example trainrefit), you can set them to any of on, yes, y, 1 to turn them on, or off, no, n, 0 to turn them off.
Switches with values
Switches with values, for example servint, can be set to a value within the allowable range, or any of the above on/off values. If a switch should have a value but doesn't, the value is set to the default for that switch; if the given value is out of range, it is set to the nearest allowable value. You can turn a switch off by setting it to any of off, no, n, but not 0 (unless 0 is not in the range for this particular switch). For example, servint on sets the new service interval to the default value of 16000 days, servint 240 sets it to 240 days, and servint off turns the servint feature off.
BitSwitches
Finally, switches with bit settings allow you to choose various settings of that switch. Please see the BitSwitches page for a description of how these work.

You can also have TTDPatch write a customised configuration file with the -W switch. This useful for example to create a configuration file in your language, if it is supported. To convert ttdpatch.cfg, simply run TTDPatch with

ttdpatch -W ttdpatch.cfg

Alternatively, put

writecfg ttdpatch.cfg

in your ttdpatch.cfg.

The result of this is that the configuration file will be in the selected language (see Language Selection), and you can read and edit it easily. It will also automatically add options that were missing or misspelt in the original file.

Since 1.8, the Windows version of TTDPatch converts all comments in the configuration file to the local Windows code page. If that code page does not support all characters used in the selected language, parts of the text may look wrong. To override this behavior, set the environment variable ACP ("ANSI Code Page") to the number of the code page you want. If you specify a code page that is not supported by the Windows installation you're using, no conversion will take place and thus comments will be written in the native DOS code page of the selected language.

For example, to rewrite ttdpatch.cfg as new.cfg in Russian using the Windows Cyryllic code page, run the following three commands in order, from the command line:

SET LANG=russian</tt>

<tt>SET ACP=1251</tt>

<tt>ttdpatchw -W new.cfg

(A simpler way to do it in Windows is to put these commands in a batch file and run it.)

The DOS version of TTDPatch does not perform any code page conversions.