Page 57 of 93

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Mon Sep 14, 2020 14:13
by nitro2012pl
Hello everyone,

I have question: How send the data from ATC Controller to digiline LCD?
I wrote e.g.:

digiline_send("0", string.format("SPEED: %s", atc_speed))

and I don't see any the data on LCD screen (channel: 0).

Thanks for help.

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Tue Sep 15, 2020 08:06
by Miniontoby
nitro2012pl wrote:
Mon Sep 14, 2020 14:13
Hello everyone,

I have question: How send the data from ATC Controller to digiline LCD?
I wrote e.g.:

digiline_send("0", string.format("SPEED: %s", atc_speed))

and I don't see any the data on LCD screen (channel: 0).

Thanks for help.
1: check the connection between the lcd and the atm controller (I think you need Lua controller but ok)
2: try: digiline_send("0", "SPEED: 123")
3: if that shows SPEED: 123 then you got the lcd linked.
4: digiline_send("0", string.format("SPEED: %s", atc_speed)) -> atc_speed, is that set??
5: Maybe I can join the server (if it is an server, else please send the world download as zip) and help

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Tue Sep 15, 2020 08:27
by Maverick2797
You need to use the Lua ATC track, the basic ATC track has no external IO (mesecon or digiline) aside from the rightclick formspec.
To use luaautomation components you need to first create an environment. See the readme.txt in the advtrains_luaautomation for more info. To do anything with LuaATC you need the "atlac" privilege, which is generally reserved for moderators and administrators on most public servers.

Assuming lcd channel = "0":

Code: Select all

if event.train then
    digiline_send("0","Speed: "..atc_apeed)
end

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Tue Sep 15, 2020 14:41
by nitro2012pl
Yes, it is working
Thank you very much ;)

I also I tried with wireless mesecons and it is working
I only copy & paste screenshot with connections.

;)

Image

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Fri Sep 25, 2020 17:59
by hlqkj
Working on a setup for a terminal station an idea come to my mind: would it be possible to have an ATC (or LUA) command to force players off a train?

The use case would be: a train arrives at a terminal station, enters an arrivals platform and stops at the station track to let passengers off. It then departs for a waiting/parking area where it'll wait for the next slot, before entering the departures platform.

I had situations in which players didn't get off the train and kept waiting while there was another one ahead of it departing, or other players who boarded the train at the arrival platform instead... Hence would be nice to have a way to force them off (could also be added as a checkbox to the station track I think).

What do you think of this?

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Sun Sep 27, 2020 20:57
by amelaye
Hi,
I got an issue, I downloaded the last version of advtrains, I'm under thelmast version of minetest for my server but I don't see TCB in my inventory, I don't understand :(
Thanks !
Edit : forgot to enable the feature, sorry :) problem resolved !

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Sat Oct 03, 2020 17:44
by orwell
hlqkj wrote:
Fri Sep 25, 2020 17:59
Working on a setup for a terminal station an idea come to my mind: would it be possible to have an ATC (or LUA) command to force players off a train?

The use case would be: a train arrives at a terminal station, enters an arrivals platform and stops at the station track to let passengers off. It then departs for a waiting/parking area where it'll wait for the next slot, before entering the departures platform.

I had situations in which players didn't get off the train and kept waiting while there was another one ahead of it departing, or other players who boarded the train at the arrival platform instead... Hence would be nice to have a way to force them off (could also be added as a checkbox to the station track I think).

What do you think of this?
Sounds like a good idea. I'll keep this on my list.

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Tue Oct 06, 2020 20:26
by hlqkj
Thanks for your feedback, I'm glad you liked it! :)

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Sun Oct 11, 2020 19:36
by T6C
I've watched a few YouTube videos and read through the atc_command.txt file, but I can't figure this out. I want to automate a train line to be like this example...
  1. Start from station A at full speed.
  2. Slow down to half-speed along a certain segment of track.
  3. Speed up to full speed again after slow segment.
  4. Stop at station B for 30 seconds, then start again at half-speed.
  5. Stop at station C for 30 seconds, then go slowly through a turnaround to go back.
I see three types of special track: the station stop track, the Lua automation track, and the point speed restriction track. I've figured out how to make a train stop at a station, name the station, and tell it how long to stay stopped. But, I can't figure out how to tell it what speed to start again after the departure time. It always leaves the station at full speed.

I tried using the point speed restriction track to slow the train down for a certain segment of track, but it slows it down only for that point. The train immediately speeds up again.

Finally, I can't figure out the Lua automation track at all. I tried putting in something like "B3" to tell the train to brake to speed 3, but I just got the error "Not an existing environment" when the train went over it.

Any help on how to set up some simple automation would be appreciated. I'm not looking for anything fancy like setting routes or switches. I'm just trying to get two trains to run along the tracks (it's a dual-track system the whole way) in opposite directions between the termini. The idea is that the trains will reach and depart opposite termini at the same time. The track itself is about 2000 blocks long, with turns and elevation changes to fit the terrain.

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Mon Oct 12, 2020 04:11
by Blockhead
T6C wrote:
Sun Oct 11, 2020 19:36
I've watched a few YouTube videos and read through the atc_command.txt file, but I can't figure this out. I want to automate a train line to be like this example...
  1. Start from station A at full speed.
  2. Slow down to half-speed along a certain segment of track.
  3. Speed up to full speed again after slow segment.
  4. Stop at station B for 30 seconds, then start again at half-speed.
  5. Stop at station C for 30 seconds, then go slowly through a turnaround to go back.
I see three types of special track: the station stop track, the Lua automation track, and the point speed restriction track. I've figured out how to make a train stop at a station, name the station, and tell it how long to stay stopped. But, I can't figure out how to tell it what speed to start again after the departure time. It always leaves the station at full speed.

I tried using the point speed restriction track to slow the train down for a certain segment of track, but it slows it down only for that point. The train immediately speeds up again.

Finally, I can't figure out the Lua automation track at all. I tried putting in something like "B3" to tell the train to brake to speed 3, but I just got the error "Not an existing environment" when the train went over it.

Any help on how to set up some simple automation would be appreciated. I'm not looking for anything fancy like setting routes or switches. I'm just trying to get two trains to run along the tracks (it's a dual-track system the whole way) in opposite directions between the termini. The idea is that the trains will reach and depart opposite termini at the same time. The track itself is about 2000 blocks long, with turns and elevation changes to fit the terrain.
Hi, let's break a few concepts down. First is the units of speed: although your driver's cab shows km/h, the internal units are m/s. The subway wagon has a max speed of 56 km/h which is actually 16 m/s (to convert, divide by 3.6). Whenever you set speed, like on a station/stop rail, point speed restriction rail or in ATC commands, it's in m/s.

The first thing you need is departure speed. In the Station/Stop rail, there is a field for departure speed. This is equivalent to the ATC command "S<x>" where x is the speed in that box; and of course it is in m/s. To start a train at half of it's top speed, take the top speed in m/s and divide it by two. For the subway wagon, 56 km/h = 16 m/s. 16 m/s / 2 = 8 m/s. So put 8 in the departure speed field.

The second thing you need can be phrased or implemented two ways: you want to train to accelerate to full service speed, or you want the train speed limit to become higher. The simplest way to achieve this is to use an ATC rail with an S command. Say our train is at a speed of 8 already and we want to go up to 16, then we give it the command "S16". What if we want the train to go all the way to its full speed, no matter what specific speed the train has? The special value "M" helps us there. "SM" will set the target speed to maximum. This is how we manage speed in terms of "set speed to this at this point" - by putting ATC rails down in the train's path.

So what about speed limits? Well, for this we have two types: The Point Speed Restriction rail, which you already familiar with. The train will pass through that rail at a maximum speed according to the restriction. The second way to manage this is the signs included with advtrains in the module advtrains_signals_ks. In your inventory they will be called the "Signal Sign". These signs can be placed and then assigned an influence point like many other components that are part of the interlocking system. Place the sign next to the track, then while holding the special key from minetest (default: E, my binding: F) right-click on the sign. This will open the formspec to assign an influence point (tip: this also works for all signals: red signals will stop a train, green will let it continue; but I digress, this is about speed right now). As per the in-game instructions, put the influence point facing the way the train will approach the sign. Now when the train hits that point, it will obey the speed in m/s posted on the sign. You can left-click with the trackworker on the speed sign to change the speed limit (there is also the special red S "stop for shunt" sign, you can ignore it, it has a special purpose), and right-click to rotate it in the same increments as the track - so if you have diagonal tracks, you can line it up nicely. The speed limit "E" means "end of speed limit".

So: put a speed limit of 8 sign where you want your subway wagons to go half speed, and put a speed limit "E" where the speed limit ends. If you have trains that go 72 km/h (=20 m/s), sadly we have the limitation that the speed limit signs only come in 8, 12, 16 and E varieties at the moment; yes I know, I would love to be able to enter any speed limit on them too.. request for improvement. Now at this point it's important to note if you have a signalling system: passing any green signal will remove any speed restriction! The Ks signals can show a yellow and impose a speed limit of 6 m/s (sorry this is a bit hard to describe, and anyway this is already a wall of text...)

You might ask what advantages having the speed limit would have over ATC commands. Well, trains physically cannot be made to disobey a speed limit that has been imposed, even when driven manually. You can only remove the speed restriction with a green signal or end speed restriction sign. This is good to enforce speed limits in areas where trains might hit people, because it forces train drivers to slow down.

I hope that addresses everything to do with speed. Now as for the turnaround: You have two options, a balloon loop or a single track terminus that the train enters and comes back out of. To make the single track terminus work, you will need to control the turnouts properly, or have them set up properly so that the train enters with the turnout set the wrong way and exits the other way after it reverses. I'm guessing you want to put your platform next to this terminus track. The station/stop rail can be used to make the train reverse after stopping. Below the departure speed field is a dropdown with options --- and Reverse. Choose the reverse option and the train will reverse when it leaves the station.

As for turnout control: you either manage it with interlocking or with LuaATC. For the interlocking approach, I recommend my video. For the LuaATC approach, I recommend you read the manual in advtrains/advtrains_luaautomation/README.txt. This post is already too long to cover basic LuaATC as well. I think I'm gonna go put some of this on the advtrains wiki now.

Train catalogue

Posted: Mon Oct 12, 2020 16:51
by Blockhead
Greetings all advtrains users! Today I started the train catalogue on the advtrains wiki. The aim is to document all available trains for advtrains, including screenshots and statistics on speed as well as features like sound. You are welcome to contribute. I will be adding those trains I know about over time, especially any posted in this thread. Help doing this would be appreciated, but also if you know of any other trains available, you can help out by adding those to the catalogue too.*

I'm also interested in adding other addons like signal sets. Let's help spread some knowledge about what great stuff is available for this mod!

*One caveat is wiki signup is currently disabled to prevent spam, ask orwell for a wiki account.

Contributors please note: To make images with transparent backgrounds I'm using the greenscreen mod with anti-aliasing disabled and keying out the green with the select by colour tool in GIMP. Please take screenshots of the front of each wagon. and please! use a 5.2.0 client or newer and enable shaders so we get the nice smooth shading! No flat entities pretty please, or I'm just going to have to redo the screenshot myself.

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Wed Oct 14, 2020 16:22
by nitro2012pl

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Sun Oct 18, 2020 06:51
by takao-san
hello advtrains !
I created a japan Tram.
(NO Animation. Yes Sound. Yes Lights)
https://github.com/takao-soramu/advtrai ... _jpntlr600
screenshot_20201018_024539.png
screenshot_20201018_024539.png (710.43 KiB) Viewed 1680 times
screenshot_20201018_024436.png
screenshot_20201018_024436.png (327.73 KiB) Viewed 1680 times
screenshot_20201018_025255.png
screenshot_20201018_025255.png (494.65 KiB) Viewed 1680 times
I have uploaded texture sample and PSD file, you can create original textures !

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Mon Oct 19, 2020 01:26
by T6C
Blockhead wrote:
Mon Oct 12, 2020 04:11
Hi, let's break a few concepts down...
I was just schooled by a blockhead. ;)

Apologies for the delay. My work schedule allows me Minetest time only a few hours each week (that was today).

Your explanation is exceptionally helpful! Of all the YouTube videos and various threads I've read about this mod, your post above was by far the most informative. Thank you! :) I now know how to use the speed signs, ATC controller (I'd been trying to use the LuaATC Rail by mistake), and station stops to add some realism to my train line.

Here's a new one I haven't seen before. I built a new bridge this afternoon, and it required me to modify the track placement slightly. No biggie; I've done it before. However, this time, the trains don't seem to notice that the track has moved, so I get situations like this (screenshot). Have you seen this before? If so, know of any way to fix this? Once it leaves the track like this, it stops (ATC tells it to, somehow), and it will never move again, so I have to destroy and re-place it. Every train tries to use the old track that isn't there anymore.

Image

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Mon Oct 19, 2020 03:51
by Blockhead
T6C wrote:
Mon Oct 19, 2020 01:26
However, this time, the trains don't seem to notice that the track has moved, so I get situations like this (screenshot). Have you seen this before? If so, know of any way to fix this?
Yep this has happened on the odd occasion. Once in multiplayer I had a floating train after the advtrains files were rolled back while the world was left forward. What happens in these events is the state of advtrains is out of sync with the state of the world. Advtrains has a file called the node database that keeps track of where all the tracks are; this is how trains are able to travel in unloaded areas. Unfortunately it's completely separate from the ordinary world data in your map file (e.g. map.sqlite).
T6C wrote:
Mon Oct 19, 2020 01:26
Once it leaves the track like this, it stops (ATC tells it to, somehow), and it will never move again, so I have to destroy and re-place it. Every train tries to use the old track that isn't there anymore.
Any train that is off-track will be stopped, I think. It's related to the feature '-!- Safety override' that you see as you approach the end of the rails to stop the train derailing. I'm guessing advtrains knows the train isn't on tracks because that area is loaded, and was probably loaded when you made the modifications.

Trains are trying to use the old track because your advtrains node database is out of sync with the world. Apart from the floating train, the other main clue to this is that trains are following the old alignment. I can only think of one logical explanation at the moment - did you use worldedit to move the bridge? Typically there's no way to remove the tracks out from under a train without moving the train. If you did use worldedit, the node database won't have been updated. There is a command for sticky situations like this: /at_sync_ndb. In English that's "advtrains, please synchronise the node database". It will go through everything in the nodedb and if that area is loaded it's going to find where rails used to be and aren't - 'ghosts' - and delete them; and it's also going to find where rails are and add those spots to the node database.

So how do you make advtrains stuff without worldedit? My personal two mod recommendations for this are digtron and tunnelmaker.

Also: Looking at your bridge it looks like it makes a sharp 90 degree turn after going down. Are you aware there are diagonal slope blocks? You can use the slope placer for 45 degree slopes, just place on the 2nd diagonal block away like so:

Code: Select all

XXXX
X\
X o <- here
X

Re: Advanced Trains, Digtron

Posted: Mon Oct 19, 2020 10:20
by Merak
Digtron is buggy. Work began on Digtron 2, but it was never released. A pity because Digtron was a fun idea.

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Mon Oct 19, 2020 16:55
by T6C
Blockhead wrote:
Mon Oct 19, 2020 03:51
Apart from the floating train, the other main clue to this is that trains are following the old alignment. I can only think of one logical explanation at the moment - did you use worldedit to move the bridge?
No, I place and remove all blocks and items in the game manually (I'm a glutton for punishment, LOL).
Blockhead wrote:
Mon Oct 19, 2020 03:51
Typically there's no way to remove the tracks out from under a train without moving the train.
That's what I do. Or I just make sure the train isn't on that section of track to begin with. ;)
Blockhead wrote:
Mon Oct 19, 2020 03:51
There is a command for sticky situations like this: /at_sync_ndb. In English that's "advtrains, please synchronise the node database".
I'll give that a shot the next time I get a chance to play.
Blockhead wrote:
Mon Oct 19, 2020 03:51
So how do you make advtrains stuff without worldedit?
I place everything manually, one node/item at-a-time.
Blockhead wrote:
Mon Oct 19, 2020 03:51
Are you aware there are diagonal slope blocks?
I didn't know that. I tried a few times earlier, but couldn't get it to work right, so all my slopes are on 90° angles. You're right that I would have preferred to make the turn more gradual on the bridge approach ramp.

If anyone's curious, here's the new bridge.
Spoiler
Image

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Tue Oct 20, 2020 07:06
by orwell
T6C wrote:
Mon Oct 19, 2020 16:55
Blockhead wrote:
Mon Oct 19, 2020 03:51
Apart from the floating train, the other main clue to this is that trains are following the old alignment. I can only think of one logical explanation at the moment - did you use worldedit to move the bridge?
No, I place and remove all blocks and items in the game manually (I'm a glutton for punishment, LOL).
Blockhead wrote:
Mon Oct 19, 2020 03:51
Typically there's no way to remove the tracks out from under a train without moving the train.
That's what I do. Or I just make sure the train isn't on that section of track to begin with. ;)
Blockhead wrote:
Mon Oct 19, 2020 03:51
There is a command for sticky situations like this: /at_sync_ndb. In English that's "advtrains, please synchronise the node database".
I'll give that a shot the next time I get a chance to play.
Blockhead wrote:
Mon Oct 19, 2020 03:51
So how do you make advtrains stuff without worldedit?
I place everything manually, one node/item at-a-time.
Blockhead wrote:
Mon Oct 19, 2020 03:51
Are you aware there are diagonal slope blocks?
I didn't know that. I tried a few times earlier, but couldn't get it to work right, so all my slopes are on 90° angles. You're right that I would have preferred to make the turn more gradual on the bridge approach ramp.

If anyone's curious, here's the new bridge.
Spoiler
Image
Blockhead's explanation is pretty complete. If you remove tracks using worldedit or dig the node under the rail, the node database still thinks that the rails are there. In most situations, this is not a problem, but in some special cases advtrains will find the old alignment. A common pitfall is when the track was initially straight and then you add a slope down.
The solution is to drive the train off the "ghost tracks" and execute the /at_sync_ndb command.
The opposite case, placing tracks with worldedit, should work, as advtrains falls back to checking the nodes in the world if the node database has no entry and then adds the track to the node database as soon as a train drives over the new tracks.

Re: [Mod] Advanced Trains [advtrains] [2.1.1]

Posted: Tue Oct 20, 2020 19:19
by T6C
orwell wrote:
Tue Oct 20, 2020 07:06
If you remove tracks using worldedit or dig the node under the rail, the node database still thinks that the rails are there.
That must have been it. If I don't remove a segment of track before I remove the block underneath it, the database won't update. Like I said in my previous post, I'll give Blockhead's command a try the next time I play, and I'll be careful to remove tracks before removing the supporting dirt going forward.

Re: [Mod] Advanced Trains [advtrains] [2.1.4]

Posted: Thu Oct 29, 2020 16:25
by orwell
Release 2.1.4
Advtrains 2.1.4 has been released. Important changes include:
  • LuaATC interface to split and join trains based on "freight codes" that can be set per wagon
  • Added diamond crossings, wyes and 3-way turnouts (Blockhead)
  • Fix node database saving on windows
... along with the usual row of bug fixes.

Re: [Mod] Advanced Trains [advtrains] [2.1.4]

Posted: Sat Nov 14, 2020 00:34
by Parnikkapore
Can you give me an example of how freight codes can be used?

Re: [Mod] Advanced Trains [advtrains] [2.1.4]

Posted: Sat Nov 14, 2020 01:04
by Maverick2797
Parnikkapore wrote:
Sat Nov 14, 2020 00:34
Can you give me an example of how freight codes can be used?
https://github.com/Maverick2797/Advtrai ... nting_Yard

Here's a small repo with some of the code used on the LinuxForks server for automatic shunting. Please note that I was in the process of converting as much as I could to environment functions rather than individual trackside programs when I semi-abandoned it. Best stop by LinuxForks for a demonstration if needed.

Re: [Mod] Advanced Trains [advtrains] [2.1.4]

Posted: Sun Nov 22, 2020 02:31
by T6C
I removed a turnaround, and added some new track to my current line. The trains are following the track just fine, but they're completely ignoring the speed limit signs on the new section of track. It's been a few weeks since I worked with track, so I'm sure I'm just forgetting something. I put the speed limit signs just to the right of the track. There aren't any nodes between the track and the sign. I ran the /at_sync_ndb command, but it said it didn't correct anything, and I was careful to remove tracks before the underlying nodes where necessary. The speed limit signs are facing the right way, and have the speed I want on them. What am I forgetting?

Re: [Mod] Advanced Trains [advtrains] [2.1.4]

Posted: Sun Nov 22, 2020 03:48
by Maverick2797
Have you added the influence point like you do for the signals? Advtrains doesn't care about the position relative to the track, only the IP. You could have a room somewhere with all the signals completely separate from the track and it would still work so long as the IP is set for each signal. (would make troubleshooting a PITA though)

Re: [Mod] Advanced Trains [advtrains] [2.1.4]

Posted: Sun Nov 22, 2020 04:41
by T6C
Maverick2797 wrote:
Sun Nov 22, 2020 03:48
Have you added the influence point like you do for the signals?
Ah, thank you. LOL I completely forgot to set the influence points! I knew I had forgotten something simple.