External Publication
Visit Post

Mod Releases • Re: [Mod] Advanced Trains [advtrains] [2.8.0]

Luanti Forums - Index page [Unofficial] February 13, 2026
Source

How about using hypertext instead of dropdowns? ... (Also, I wonder whether it is better to parse ATC commands into an AST and generate the description from that. Having ASTs would also make it possible to create a form closer to visual programmer.)

I don't understand this part.

I wrote multiple ideas in that post.

The first is about using hypertexts instead of using dropdowns (as seen in download/file.php?id=31334). The idea is that hypertext (along with increasing the height of the formspec) allows writing longer descriptions (potentially with multiple lines) for each example.

I'm not looking to change the tracks' functions, just to make the simpler ones more user-friendly. Ideally, using mine would make it easier for someone to go on to using the less friendly advanced parts of advtrains. Does hypertext work in that context?

Do I understand correctly that in this case you want to improve the ATC form by adding examples that users can choose to use in their ATC form? In this case yes (see explanation above).

The other (although more ambitious than simply changing the UI) idea was based on the having long/multiline descriptions for each example:

I wonder whether it is better to parse ATC commands into an AST and generate the description from that. Having ASTs would also make it possible to create a form closer to visual programmer.)

The (as said, not trivial) idea here is to refactor ATC internals so that there is a parser that parses ATC strings into abstract syntax trees (i.e. more structured data). It could then be possible to add an API that "describes" (or simply lists out the instructions in) an ATC string by working off the AST and generating a description for each ATC command. Such an API would allow describing arbitrary sequences of ATC commands beyond just examples). (This would also speak for the use of hypertext, as a description API could be designed by highlighting the parameters for each command in a manner similar to syntax highlighting.).

Side note: About five years ago I proposed a patch for "compiling" ATC commands. Part of the implementation was not too different from how I would write an ATC parser today, although the technical detail of producing Lua strings was bad in hindsight.

The follow-up of having ASTs would be to introduce a UI for visual programming. That would hopefully lower the bar for using ATC, but would (to an extent) be a small project of its own.

Code:

 {name = "Stop, Open Doors Left", cmd = "B0 D2 OL K D2 OC D2 S2"},

Another note here: I would suggest using B0 W OL ... here. That would avoid hardcoding the braking time based on the presumed speed of the train.

Thanks for the feedback. Do you have any other command strings you see beginners wanting to use?

Not that I can think of at the moment.

Statistics: Posted by yw05 — Fri Feb 13, 2026 23:51


Discussion in the ATmosphere

Loading comments...