User Tools

Site Tools


usage:atlatc:events

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
Next revision Both sides next revision
usage:atlatc:events [2020-01-28 10:18]
orwell
usage:atlatc:events [2020-04-27 16:38]
orwell add has_entered note
Line 33: Line 33:
  
 ===== Event Types ===== ===== Event Types =====
 +
 +==== init ====
 +The ''event'' table of the [[usage:atlatc:environment#Initialization Code]] is always ''{type="init", init=true}''.
  
 ==== int ==== ==== int ====
Line 55: Line 58:
 </code> </code>
 Fired when a node called ''[[usage:atlatc:api#interrupt_pos_pos_message|interrupt_pos]]'' on this node's position. ''<message>'' is the message passed to the function. Fired when a node called ''[[usage:atlatc:api#interrupt_pos_pos_message|interrupt_pos]]'' on this node's position. ''<message>'' is the message passed to the function.
 +
 +==== schedule ====
 +<code lua>
 +event = {
 +    type = "schedule",
 +    schedule = true,
 +    msg = <message>,
 +}
 +</code>
 +Fired when an interrupt set by the ''[[usage:atlatc:api#schedule_rwtime_msg|schedule()]]'' (or ''schedule_in()'') function runs out. ''<message>'' is the message passed to the function.
  
 ==== digiline ==== ==== digiline ====
Line 66: Line 79:
 </code> </code>
 Fired when the component receives a [[usage:mods:digiline|Digiline]] message. Fired when the component receives a [[usage:mods:digiline|Digiline]] message.
 +
 +==== punch ====
 +**Applicable for:** LuaATC Operation Panel
 +<code lua>
 +event = {
 +    type = "punch",
 +    punch = true,
 +}
 +</code>
 +Fired when a player punches the operation panel.
 +
 +Note: Nodes other than the operation panel don't emit the ''punch'' event.
  
 ==== train ==== ==== train ====
Line 86: Line 111:
     approach = true,     approach = true,
     id = <train_id>,     id = <train_id>,
 +    has_entered = <boolean>, (latest development version only)
 } }
 </code> </code>
Line 92: Line 118:
   * **This function is available only in the ''[[http://git.bananach.space/advtrains.git/tree/?h=luaatc-extensions|luaatc-extensions]]'' branch of Advtrains.**   * **This function is available only in the ''[[http://git.bananach.space/advtrains.git/tree/?h=luaatc-extensions|luaatc-extensions]]'' branch of Advtrains.**
   * **This function is available only when the [[#approach_callback_mechanism|approach callback mechanism]] is enabled.**   * **This function is available only when the [[#approach_callback_mechanism|approach callback mechanism]] is enabled.**
 +
 +`has_entered` is set to true when the tip of the train is already standing on the node, i.e. the "train" event has already fired.
  
 === Approach callback mechanism === === Approach callback mechanism ===
usage/atlatc/events.txt · Last modified: 2023-10-29 16:30 by orwell