User Tools

Site Tools


Sidebar



Minetest Forum
Content Database
Git Repository
Bug Tracker
Website

usage:atlatc:start

Table of Contents

Lua ATC

The advtrains core provides the ATC rail as a basic facility to perform automatic train operation. The combination of the Interlocking System system and the Station/Stop Rail, it is sufficient for basic automatic railway lines. However, sometimes the need arises to perform advanced actions, such as controlling a passenger information monitor, handle complex train moves or develop a departure timing system. The advtrains_luaautomation module provides a very powerful tool to achieve such tasks, at the drawback that some programming skill is required.

What is it?

LuaATC is a Lua programming interface to advtrains, programmable using an in-game editor.

Using LuaATC rails, player-provided Lua code reacts to certain events, such as a train driving over the rail, and perform custom, freely-programmable actions, such as issuing ATC commands, sending digiline messages, and setting switches or signals. It can also time a so-called “interrupt” event after a certain time, e.g. for stopping a train and making it depart a few seconds later.

History

LuaATC was developed back in 2017, when the advtrains core was mainly working, in order to handle complex train automation tasks. At that time, the interlocking system did not exist yet. LuaATC was used to build custom interlocking-like operation setups, and, in fact, still can be used to do this. The Spawn Subway on Linuxworks Minetest Server is such an example of LuaATC-based interlocking. During its development, the main focus was on providing a working system as fast as possible, to be able to play around with it, and not considering security and extensibility.

Being so historic, the LuaATC system has included some poor design choices, namely:

  1. As all code is run in a very loose sandbox, DoS attacks on servers using LuaATC are easily possible. Therefore, operating LuaATC components requires a special privilege which should only be granted to trusted players on public servers.
  2. As handling different events is not strictly enforced, it is difficult to add new event types without breaking existing setups. (e.g. see approach callbacks)

Contents

usage/atlatc/start.txt · Last modified: 2020/10/13 09:35 by blockhead