I have created a patch that will add vehicle (train, plane, ship and road vehicles), town and industry console commands.
It adds command "train" in console, with several subcommands for trains, similarly "road" for road vehicles, "plane" or "aircraft" for aircrafts and "ship" for ships. Also command "vehicle" that will do the command on all appropriate vehicles of any type. From v16, there are also "industry" and "town" commands available.
For full manual to all commands, see the wiki page:
* http://wiki.openttd.org/index.php/Vehic ... e_commands
* http://wiki.openttd.org/index.php/Indus ... e_commands
Fixed match for exclusivity of other companies
Fixed bad format string
File comment: Version 20 for r19627
cmd-train-console-v20-19627.patch [64.2 KiB]
Downloaded 759 times
File comment: Version 20 for 1.0.0
cmd-train-console-v20-1.0.0.patch [64.31 KiB]
Downloaded 421 times
File comment: Version 20 for 0.7.2
cmd-train-console-v20-0.7.2.patch [65.1 KiB]
Downloaded 361 times
Fixed few bugs in industry commandv18:
Added ability to perform town authority actions
Added expand/delete for towns (scenario editor only)
Added "and" function to match by multiple conditionsv17:
Many town and industry commands and matches added
Documentation added to wikiv16:
Added first few town and industry commands
Large internal reoragnizationv15:
fixed bug with depot and service:
using them on vehicle that was already going to depot/service cancelled the order instead
added 'undepot' and 'unservice' commands for cancelling depot and service commandsv14:
Fixed desync with skip to random orders (thanks to Aali)
added 'broken' match to match broken down vehicles
added match for breakdowns since last servicev13:
Vehicle cloning now accepts parameter (how many clones to make) . If not specified, only one clone is created (as in older versions)v12:
Added fix to allow compilation with MSVC suggested by chrisv11:
Added <> operator (not equal)
Added match for vehicles in depot
Added 'const' where appropriate
Fixed bug with some help entries not being shown
Code cleanup and beautifyingv10:
wagons will match real number of wagons
added wsell command (sell specified wagons from train)
number of required parameters is checked for commands which need them (service, wsell)v9:
Added wagon info for trains
Removed duplication, as it was causing desyncs and repair would require rewriting parts of pathfindersv8:
Added lexicographical match by group name ( <, >, = ...)
Added comments, small code cleanupv7:
Swapped order of command and identifier as it is more consistent with command parameters
subcommand skip accepts parameter (how many orders to skip, 'r' = skip to random order)
Added match by service interval
Added command to change service intervalv6:
match type can be specified also by unambiguous part ("sp=0" instead of "speed=0")
added command "vehicle" that will execute command on all vehicle types where possible
added match by profit (this, last and both years)
added command "count" that will output number of vehicles matching given criteria
Added commands "rail", "ship" and "aircraft" (with alias "plane") doing the same for other vehicle types.
Not all commands are available for all vehicle types (most are now only for trains, as they are not
finished for other types)
Added match by speed, maximum speed and train lengthv4:
Added commands: info, leave, skip, center
Possibility to specify only unique prefix of command (for example "train ser" instead of "train service")v3:
Duplication added, groups can be referenced now only by its unique prefix in addition to full name, command can also be sent to all crashed trains. Does not try to send unavailable commands to crashed trains (but open or duplicate still works).
There are many operations (selling, cloning, opening windows, centering view, sending to depot, skipping orders ...) that can be performed. For complete list, type the corresponding command (e.g. "train", "plane" ...) without parameters. Target of the commands can be specified by second parameter. It can be single vehicle, group of vehicles, all vehicles or subset of vehicles based on some criteria (speed, length of train ...)
These may be used to ease some tasks.
Some future expansion may include better filtering options by additional criteria - like applying command on trains of certain type (all maglevs, number range, etc ... ) or state (trains near cursor, trains going into certain station)
New commands could also be added (like "extend all 10 wagon trains to 14 wagons")
"train all sell" - this can be used to sell all trains currently stopped in depot. This may ease conversion between railtypes - you usually send all trains to depots, then convert entire network and launch new maglev trains. But after that you have to "hunt down" the old trains in all depots around the network and sell them. Not anymore. "train all sell" can do it for you :)
"train all ignore" - maybe this one should be renamed to "train all crash" as this is roughly what happens :)
"road all turn" ... - Massive bus jam? This may help...
Want to get rid of all unprofitable vehicles?
"vehicle profit<0 depot" ... wait a while for them to get to depots ... "vehicle profit<0 sell" ... they are GONE :)
Mass cloning may some people also find useful (send few trains to depot, then "train all clone_shared", "train all start")
"train service=150 interval 200" - this will raise service interval to 200 days for all trains that have it on 150.
Any oppinions, ideas or bug reports for the patch are welcome.