Difference between revisions of "Bit switches"

From TTWiki
Jump to navigationJump to search
(Reformat and update)
m (Reverted edits by Orudge (Talk) to last revision by Flamelord)
Line 1: Line 1:
In addition to all the [[ManualThePatches|patch switches]], the following switches control the operation of TTDPatch itself:
 
   
  +
'''''Switches with lots of settings'''''
{| class="wikitable"
 
|-
 
!Command line!!Configuration file!!Meaning
 
|-
 
| -a || all on || Turn on all patch switches, except those marked as "off by default".
 
|-
 
| -h || --- || Show a brief help summarizing all available options. Run "<tt>ttdpatch -h | more</tt>" if it scrolls by too fast.
 
|-
 
| -v || verbose on/off || Before running TTD, display a brief summary of what switches are active
 
|-
 
| -y || alwaysyes on/off || Do not wait for a keypress before starting TTDPatch if the TTD version is not recognized
 
|-
 
| -C &lt;file&gt; || include &lt;file&gt; || Read a different [[ConfigurationFile|configuration file]].
 
|-
 
| -W &lt;file&gt; || writecfg &lt;file&gt; || Write current configuration to this file. '''Note:''' Do not write to the file that contains this directive (i.e. in ttdpatch.cfg, do not put "writecfg ttdpatch.cfg"), because it will overwrite the file and discard all settings after the writecfg directive.
 
|-
 
| -Xn &lt;file&gt; || newgrfcfg &lt;file&gt; || Read the given file as new graphics configuration file, instead of <tt>newgrf(w).cfg</tt>.
 
|}
 
   
  +
=Bit Switches=
If the -C option is given, the specified configuration file will be read instead of the default <tt>ttdpatch.cfg</tt>. (This does not apply to the "include &lt;file&gt;" option, obviously.) You can use several configuration files by having multiple -C switches, they will be read in the order you supply them.
 
   
  +
Switches with bit settings allow you to choose various settings of that switch. An example is the `morebuildoptions' switch. &nbsp;It has the following options, labeled (a) to (f):
And finally, after you have set all your switches the way you like them, you can tell TTDPatch to write them to your own configuration file (or <tt>ttdpatch.cfg</tt> for that matter) by using the -W switch or writecfg config file directive. With this, TTDPatch will create a commented file that has all the switches set as they are when the -W is encountered on the command line.
 
   
  +
|||Bit|Value|name|Meaning
Just for completeness, there are also a number of [[DebugSwitches|debug switches]], but they are not meant to be useful for most people.
 
  +
[[Category:Usage]][[Category:TTDPatch]][[Category:TTDPatch Manual]]
 
  +
(a)|0|1|ctunnel|Tunnels may cross
  +
  +
(b)|1|2|oilrefinery|Oil rigs and refineries may be built everywhere, not only near edges of map
  +
  +
(c)|2|4|moreindustries|Allow multiple industries of the same type in one city
  +
  +
(d)|3|8|removeobjects|Removal of statues, lighthouses and transmitters
  +
  +
(e)|4|16|removeindustry|Removal of industries
  +
  +
(f)|5|32|closeindustries|Allow identical industries very close together
  +
  +
(g)|6|64|enhancedbuoys|Build buoys that accept and distribute cargo (like docks) with Ctrl
  +
  +
(h)|7|128|bulldozesignals|Automatically remove signals when removing track with the bulldozer tool||
  +
  +
To find out how you specify the value for the `morebuildoptions' switch, you have two choices (three since alpha 38):
  +
*Use the &quot;#101001&quot; notation. &nbsp;Each number represents a bit, 1 meaning it is turned on, 0 meaning it is turned off. &nbsp;Note that it starts from the ''highest'' bit. &nbsp;For morebuildoptions, it would be &quot;#fedcba&quot; for the six options (f) down to (a). &nbsp;For example, to turn on (a), (d) and (e), you would use -+morebuildoptions #011001+-. The leading 0 is optional.
  +
*Add all the values you want, and use that for the option. &nbsp;For example, for having morebuildoptions bits (a), (d) and (e), you add their values: 1+8+16=25. &nbsp;Therefore, you would use -+morebuildoptions 25+-.
  +
*As of TTDPatch 2.0.1 alpha 38, you also have a third option; the bit names. These work like on/off switches except that 1 and 0 may not be used. on/yes/y and off/no/n are all acceptable. For example, to turn on morebuildoptions bits (a), (d), and (e), you would use~pp~morebuildoptions.ctunnel on
  +
  +
morebuildoptions.removeobjects on
  +
  +
morebuildoptions.removeindustry on~/pp~
  +
  +
Note, some switches may have so-called &quot;reserved&quot; bits. These are bits that are unused at the moment. &nbsp;It is best to not set them, and leave them at zero (off) instead.

Revision as of 13:41, 13 June 2011

Switches with lots of settings

Bit Switches

Switches with bit settings allow you to choose various settings of that switch. An example is the `morebuildoptions' switch.  It has the following options, labeled (a) to (f):

|||Bit|Value|name|Meaning

(a)|0|1|ctunnel|Tunnels may cross

(b)|1|2|oilrefinery|Oil rigs and refineries may be built everywhere, not only near edges of map

(c)|2|4|moreindustries|Allow multiple industries of the same type in one city

(d)|3|8|removeobjects|Removal of statues, lighthouses and transmitters

(e)|4|16|removeindustry|Removal of industries

(f)|5|32|closeindustries|Allow identical industries very close together

(g)|6|64|enhancedbuoys|Build buoys that accept and distribute cargo (like docks) with Ctrl

(h)|7|128|bulldozesignals|Automatically remove signals when removing track with the bulldozer tool||

To find out how you specify the value for the `morebuildoptions' switch, you have two choices (three since alpha 38):

  • Use the "#101001" notation.  Each number represents a bit, 1 meaning it is turned on, 0 meaning it is turned off.  Note that it starts from the highest bit.  For morebuildoptions, it would be "#fedcba" for the six options (f) down to (a).  For example, to turn on (a), (d) and (e), you would use -+morebuildoptions #011001+-. The leading 0 is optional.
  • Add all the values you want, and use that for the option.  For example, for having morebuildoptions bits (a), (d) and (e), you add their values: 1+8+16=25.  Therefore, you would use -+morebuildoptions 25+-.
  • As of TTDPatch 2.0.1 alpha 38, you also have a third option; the bit names. These work like on/off switches except that 1 and 0 may not be used. on/yes/y and off/no/n are all acceptable. For example, to turn on morebuildoptions bits (a), (d), and (e), you would use~pp~morebuildoptions.ctunnel on

morebuildoptions.removeobjects on

morebuildoptions.removeindustry on~/pp~

Note, some switches may have so-called "reserved" bits. These are bits that are unused at the moment.  It is best to not set them, and leave them at zero (off) instead.