User Tools

Site Tools


usage:atlatc:api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
usage:atlatc:api [2021-05-26 22:03]
56independent added an function wich didnt exist.
usage:atlatc:api [2022-08-07 20:21]
62.138.2.14 ↷ Links adapted because of a move operation
Line 80: Line 80:
 //since version 2.3.0// //since version 2.3.0//
  
-Like ''interrupt()'', but does not add an interrupt and returns false when an interrupt (of any type) is already present for this component. Returns true when interrupt was successfully added.+Like ''interrupt()'', but returns false when an interrupt (of any type) is already present for this component and does not add an interrupt. Returns true when interrupt was successfully added.
  
 ===interrupt_pos(pos, message) === ===interrupt_pos(pos, message) ===
Line 110: Line 110:
 When ''advtrains_line_automation'' is enabled, all Railway time functions are exposed as rwt.* and can safely be used in LuaATC code. When ''advtrains_line_automation'' is enabled, all Railway time functions are exposed as rwt.* and can safely be used in LuaATC code.
  
-For the available functions, see [[dev:lines:rwt]].+For the available functions, see [[dev:api:railway_time_api]].
  
 <code> <code>
Line 153: Line 153:
 === digiline_send(channel, message) === === digiline_send(channel, message) ===
  
-Sends a [[usage:mods:digilines|digiline]] message on the specified ''channel''.+Sends a [[https://content.minetest.net/packages/Jeija/digilines/|digiline]] message on the specified ''channel''.
  
 This function is not available in init code. This function is not available in init code.
Line 240: Line 240:
 Sets the line property of the train, as a string. Sets the line property of the train, as a string.
  
-On [[usage:trains:subway_train|subway trains]] bundled with Advtrains, the line is automatically displayed on the outside of the trains, if the first character is a number between 0 and 9 (where 0 is displayed as "Line 10").+On [[usage:trains:basic_trains:advtrains_subway|subway trains]], in the Basic Trains modpack, the line is automatically displayed on the outside of the trains, if the first character is a number between 0 and 9 (where 0 is displayed as "Line 10").
  
 If there is no train, same behavior as [[#get_line()]] applies. If there is no train, same behavior as [[#get_line()]] applies.
Line 255: Line 255:
  
 === train_length() ===  === train_length() === 
-Returns the length of the Train in carragesexample ''if train_length() < 5 then set_line("short") end'' +Returns the number of wagons in a train.
  
 === set_shunt() === === set_shunt() ===
Line 282: Line 282:
   * This function is available only when the [[wiki:todo|approach callback mechanism]] is enabled.   * This function is available only when the [[wiki:todo|approach callback mechanism]] is enabled.
   * This function is only accessible during ''approach'' events   * This function is only accessible during ''approach'' events
 +
 +=== set_autocouple() ===
 +
 +Enables Autocouple mode. When the train hits another standing train, it couples to it and continues with its current ATC target speed in the same direction.
 +
 +In contrast to the ''Cpl'' ATC command, the autocouple property does not reset after coupling. It needs to be explicitly disabled using ''unset_autocouple()''. Note that the ATC ''Cpl'' command and the LuaATC autocouple flag are independent and can be used at the same time.
 +
 +//since version 2.4.0://
 +
 +The train that is initiating the coupling (that is, the train that is driving and whose mode is set to autocouple) is guaranteed to retain its Train ID.
 +
 +=== unset_autocouple() ===
 +
 +Disables the Autocouple mode.
  
 ==== Fields ==== ==== Fields ====
usage/atlatc/api.txt · Last modified: 2023-07-05 17:48 by maverick2797