This is a simple mod that allows players to remotely control trains.
Available controls
Lever
Door control
Display
Line and routing code
Toggle ARS (requires interlocking)
Reverse train (button)
Notes
The information in the formspec is not automatically updated. This is partly why certain elements on the train HUD are not yet available in the formspec.
Changing the lever switches the train to manual control. It overrides ATC without any warning, but it does not override LZB.
This mod is intended for users with at least some knowledge of advtrains.
Nice idea and nice work!
I have two ideas:
- Maybe, the RC should be bound to a wagon (e.g. right-click an engine to bind control) and control this wagon's train - will be useful for shunting, in case the engine gets a different ID when decoupling
- Add a button that opens the onboard computer (function is called show_bordcom) so you can do coupling
Lua is great! List of my mods
I like singing. I like dancing. I like ... niyummm...
- Maybe, the RC should be bound to a wagon (e.g. right-click an engine to bind control) and control this wagon's train - will be useful for shunting, in case the engine gets a different ID when decoupling
I still have to figure that part out. The main thing is that I want to separate wagon and train controls, and I still need to test that a bit (possibly by holding the ID of the first or n-th wagon in the formspec name rather than the train ID)
orwell wrote:
- Add a button that opens the onboard computer (function is called show_bordcom) so you can do coupling
I would actually design my own formspec. The reasons I don't want to use the bordcom formspecs are:
The boardcom formspec handler apparently checks to make sure that the player is in the driver stand of a particular wagon. (Also, I have not yet managed to get it to work with my formspec ...)
The coupling control is not displayed properly for long trains
I would use tabs to separate controls between individual wagons and the entire train, so I would use something that opens the "wagon properties" formspec instead.
Edit: I think I should actually use separate formspecs for trains and wagons to avoid some potential workarounds for tabs.
Revision 8
(Note: While I make sure that the master branch is stable enough, I make releases only when I have made enough changes IMO, and I don't tend to announce maintenance releases.)
Add input boxes for display, line, and routing code.
Change lever and door control to show levers (implemented with scrollbars)
Change ARS to a checkbox
Add wagon count in formspec
Attachments
Screenshot_20210619_114429.png (12.63 KiB) Viewed 771 times
Perhaps an exit button too? I've found that the formspec keeps opening if I try to close it, forcing a client shutdown to escape.
*Facepalm* I always quit the formspec with the escape key (at least in singleplayer) so I didn't think about adding an exit button (by the way, I think you can also quit a formspec by left-clicking twice in an area outside the FS). I will add it soon.
I haven't worked on it for a while because I was a bit busy with some things, but I will get back now.