[Mod] Advanced Trains [advtrains] [2.4.3]

User avatar
56independent_actual
Member
Posts: 452
Joined: Sun May 23, 2021 16:10
IRC: independent56
In-game: 56independent
Location: Girona Province
Contact:

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

by 56independent_actual » Post

yw05 wrote:
Sun Dec 19, 2021 13:40
Eh, v = \frac{\Delta s}{\Delta t}

Also, that formula calculates the average speed (or the speed of the movement at constant velocity), so \Delta t = \frac{\Delta s}{v} does not give the result you want for a (in this case) decelerating train.
I know that i am assuming a train moving at a constant pace, and not decelerating, but i think thats fine in comparison for the extra calculations
The interrupt apparently the comes from a track a bit away from the station.

As an unrelated note, I had setups where the brake was applied using an ATC track. The distance was manually calculated, and I suppose this is also the case for this line.
I've written some untested code for the use of the public. Hopefully, you all can find use for this.

Code: Select all

-- Note: this code assumes a constant speed, which helps avoid complexity. The times will be shorter then the real time.

distance = 0 -- Whatever your distance is
stopping_lines = {} -- Give a list of lines that stop  (empty for none)
channel = "" -- Final channel for the message

prefix = "seconds"

-- DETECTION AND ACTING
if event.type == "train" then    
    if #(stopping_lines) != 0 then
        for _, get_line() in pairs(stopping_lines) do
            if fruit == atc_line then
            
                -- CALCULATION
                time = atc_speed/distance -- Use our delicate formula to get time, in seconds. Of course, on approach, we will be slowing down.
                if time > 59 then
                    time = time/60
                    prefix = "minutes"
                end
                
                -- OUTPUT
                message = get_line() .. "\n" .. "In " .. time .. "\n" .. distance .. " metres away"
                digiline_send(channel, message)
            end
        end
    end
end
Last edited by 56independent_actual on Sun Dec 19, 2021 14:09, edited 1 time in total.
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).

Maverick2797
Member
Posts: 128
Joined: Sun Aug 05, 2018 12:37
In-game: Maverick2797
Location: Poking about here and there...

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

by Maverick2797 » Post

56independent_actual wrote:
Sun Dec 19, 2021 13:53

Code: Select all

for _, get_line() in pairs(stopping_lines) do
This assumes the result of get_line() returns a value, which it doesn't if a train's Line field is empty.
The number you have called is not available during a solar eclipse. This message will self destruct in ten seconds in protest... [BEEP]

User avatar
56independent_actual
Member
Posts: 452
Joined: Sun May 23, 2021 16:10
IRC: independent56
In-game: 56independent
Location: Girona Province
Contact:

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

by 56independent_actual » Post

Maverick2797 wrote:
Sun Dec 19, 2021 13:58
56independent_actual wrote:
Sun Dec 19, 2021 13:53

Code: Select all

for _, get_line() in pairs(stopping_lines) do
This assumes the result of get_line() returns a value, which it doesn't if a train's Line field is empty.
I have fixed that and published the code on my wiki, so people can use that page to find the code.
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

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

by yw05 » Post

56independent_actual wrote:
Sun Dec 19, 2021 13:53
yw05 wrote:
Sun Dec 19, 2021 13:40
Eh, v = \frac{\Delta s}{\Delta t}

Also, that formula calculates the average speed (or the speed of the movement at constant velocity), so \Delta t = \frac{\Delta s}{v} does not give the result you want for a (in this case) decelerating train.
I know that i am assuming a train moving at a constant pace, and not decelerating, but i think thats fine in comparison for the extra calculations
In reality, you are more likely to calculate the distance based on the braking time, not vice versa.

For record, the formula to calculate the distance of acceleration is:
\Delta s = v_0 \cdot \Delta t + \frac{1}{2} \cdot a \cdot (\Delta t)^2 = \frac{\Delta v (2v_0 + \Delta v)}{2a}

(There is also a variant for cases where you know the target velocity, but figuring that out is left as an exercise to the reader)

If my calculations are correct, assuming constants speed can result in the distance being off by:

v_0 \cdot \Delta t - \left( v_0 \cdot \Delta t + \frac{1}{2} \cdot a \cdot (\Delta t)^2 \right) = \frac{-(\Delta v)^2}{2a}

In other words: the error grows quadratically with the difference in velocity.
The interrupt apparently the comes from a track a bit away from the station.

As an unrelated note, I had setups where the brake was applied using an ATC track. The distance was manually calculated, and I suppose this is also the case for this line.
I've written some untested code for the use of the public. Hopefully, you all can find use for this.

Code: Select all

-- Note: this code assumes a constant speed, which helps avoid complexity. The times will be shorter then the real time.

distance = 0 -- Whatever your distance is
stopping_lines = {} -- Give a list of lines that stop  (empty for none)
channel = "" -- Final channel for the message

prefix = "seconds"

-- DETECTION AND ACTING
if event.type == "train" then    
    if #(stopping_lines) != 0 then
        for _, get_line() in pairs(stopping_lines) do
            if fruit == atc_line then    
                -- CALCULATION
                time = atc_speed/distance -- Use our delicate formula to get time, in seconds. Of course, on approach, we will be slowing down.
                if time > 59 then
                    time = time/60
                    prefix = "minutes"
                end
                
                -- OUTPUT
                message = get_line() .. "\n" .. "In " .. time .. "\n" .. distance .. " metres away"
                digiline_send(channel, message)
            end
        end
    end
end
  • ~=, not !=
  • for _, get_line() in pairs(stopping_lines) is not valid.
  • if fruit == atc_line???
  • Have you heard of string.format?

User avatar
56independent_actual
Member
Posts: 452
Joined: Sun May 23, 2021 16:10
IRC: independent56
In-game: 56independent
Location: Girona Province
Contact:

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

by 56independent_actual » Post

yw05 wrote:
Sun Dec 19, 2021 14:40
  • ~=, not !=
  • for _, get_line() in pairs(stopping_lines) is not valid.
  • if fruit == atc_line???
  • Have you heard of string.format?
The code has been fixed and been put in the wiki. I have removed major parts of it because nothing works. I don't need help, i can do it myself.
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Advtrains: More helpful signal diagrams

by Blockhead » Post

Here are another two helpful diagrams.

Diagram 1: A visual explanation to contrast how End route HERE and End Route at end of NEXT section work.

Diagram 2: How to section and signalise a circular railway (clockwise according to my convention for drawing signals). Each route is coloured green/blue. As you can see, they extend for a single section each. The railway has maximum of 3 trains or it will deadlock.
Attachments
FinishRouteOptions.png
FinishRouteOptions.png (27.13 KiB) Viewed 4118 times
LoopRoutes.png
LoopRoutes.png (8.13 KiB) Viewed 4118 times
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

Re: Advtrains: More helpful signal diagrams

by yw05 » Post

Blockhead wrote:
Mon Dec 27, 2021 03:45
Diagram 1: A visual explanation to contrast how End route HERE and End Route at end of NEXT section work.
That would be a nice addition to the manual I am working on. (Edit: Done)
Spoiler
2021-12-27-18-59-14.png
2021-12-27-18-59-14.png (116.86 KiB) Viewed 4096 times
Diagram 2: How to section and signalise a circular railway (clockwise according to my convention for drawing signals). Each route is coloured green/blue. As you can see, they extend for a single section each. The railway has maximum of 3 trains or it will deadlock.
I suppose loops are the easiest setups to explain deadlocks with. (Edit: yes, I know there can be other types of deadlock in certain edge cases.)
Spoiler
2021-12-27-18-59-39.png
2021-12-27-18-59-39.png (102.58 KiB) Viewed 4096 times

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

Re: Remote train control

by orwell » Post

severak wrote:
Thu Dec 16, 2021 10:04
Hi. Many thanks for Advtrains. It really hooked me into Minetest again.

I started toying with train and track remote control and figured out how to create train remote control with Lua ATC rain, microcontroller, digiterms and some lua code (see here - https://gist.github.com/severak/235c28c ... bf532be23f). It works surprisingly well until it hits something (including other trains - thus unusable for shunting). If it hits something trains get stuck and it's unresponsible with no way to fix it with remote control.

Then I decided to convert it into proper "train remote control" mod.

Thus these questions apparead:

- is there any internal API for controlling the trains?
- is this somewhat stable?
- is this documented or do I need to reverse engineer it from advtrains code? (which file then?)
- how to detect stuck train?
- it's possible to unstuck it in some scenarios? (for example when stuck by another train in front of it)

Any answer or hint would be aprecciated.
Hi Sevarak,
sorry, it took me a while to look into the forums (the usual christmas-time stuff, presents here, visits there).
advtrains doesn't really have an API for the internal workings. I tried to add code comments where applicable to document what the code does, but there is no real set of functions you can call. Perhaps the best method is to stick to one of the existing control methods:
- like the user control when sitting in the train: have a look at trainhud.lua, the key variable here is 'train.ctrl_user' where you can set certain "lever values" (see here what they mean)
- sending ATC commands, there you can use the advtrains.atc.train_set_command() function

For checking whether a train is stuck, there are actually 4 ways a train can get stuck:
- Off-Track: when one end of the train is not on a track, speed is limited to 0 resp. 1 m/s
- Train-to-Environment (counterpart here: a cuboid around the wagon position is checked for each loaded wagon whether there is a walkable node (or a full-cube node with "forgiving collision") at that position. This happens only in loaded areas (that are emerged by the minetest server). To unstuck this the blocking node needs to be removed
- Train-To-Train not on same track: This is probably the problematic collision you run into. Fact is, this system is only in effect when the train is moving, and it only checks a cube right at the front tip of the train, not on the whole length. This means you should always be able to "unstuck" such a train by coupling a shunter engine to one of the stuck trains and driving it out. I admit that this system is not ideal though, maybe we should remove it altogether (although that means that trains cannot collide on crossings anymore :/)
- Train-To-Train on same track (NEW!): The new system for collisions of trains on the same track, and for coupling. I made this recently, before this the other train-to-train collision mechanic was the only one used and it was also used for coupling. With this system trains do not really get "stuck", they just stop at the train end and you can drive either train away. Once trains overlap this system has no effect anymore and the old train-to-train collision kicks in.

If you want to detect whether a train is stuck, that's not really doable right now unless you extend the "train_step_b()" function to export that information. But I happily accept a patch to make that possible.

I hope this helps.
Regards, orwell
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

Josselin2
Member
Posts: 102
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

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

by Josselin2 » Post

Codesound wrote:
Sun Nov 21, 2021 10:03
I completely rewritten the mini guide... I hope it's better than the first one.... thank you all for the help...
I've tried building this three times now, and always with the same result: at part 55, Signal 2 does not have a "Finiish route at the end of the next section" button (but Signal 3 does).

Image

gpcf
Member
Posts: 382
Joined: Fri May 27, 2016 10:48
GitHub: gpcf
In-game: gabriel

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

by gpcf » Post

That's because your section contains a switch. you can only advance to the next section if there are only two tcbs in the section.

Josselin2
Member
Posts: 102
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

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

by Josselin2 » Post

gpcf wrote:
Thu Jan 13, 2022 12:51
That's because your section contains a switch. you can only advance to the next section if there are only two tcbs in the section.
What is a switch? The diverging track marked in this screenshot?

I clicked the New route button in the signal next to TCB 6 (part 49). I left-clicked the switch, which produces a green arrow and a blue padlock (part 53). Then I left-clicked TCB 5 (part 55). The Finish route at end of next section button in the formspec is missing.

If there is not supposed to be a switch between these TCBs, then the tutorial is wrong.

Image

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

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

by yw05 » Post

Josselin2 wrote:
Fri Jan 14, 2022 12:01
I clicked the New route button in the signal next to TCB 6 (part 49). I left-clicked the switch, which produces a green arrow and a blue padlock (part 53). Then I left-clicked TCB 5 (part 55). The Finish route at end of next section button in the formspec is missing.

If there is not supposed to be a switch between these TCBs, then the tutorial is wrong.

Image
It looks like both sides of TCB 5 (and most other TCBs) belong to the same track section. That should not be the case.

You should dissolve the track section in question and recreate those.

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

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

by Blockhead » Post

yw05 wrote:
Fri Jan 14, 2022 14:16
Josselin2 wrote:
Fri Jan 14, 2022 12:01
I clicked the New route button in the signal next to TCB 6 (part 49). I left-clicked the switch, which produces a green arrow and a blue padlock (part 53). Then I left-clicked TCB 5 (part 55). The Finish route at end of next section button in the formspec is missing.

If there is not supposed to be a switch between these TCBs, then the tutorial is wrong.

Image
It looks like both sides of TCB 5 (and most other TCBs) belong to the same track section. That should not be the case.

You should dissolve the track section in question and recreate those.
As a rule, you should always assign all TCBS to their positions before creating any sections. That is likely what has created this mess where they are all in the same section.

I retain the opinion that the written tutorial isn't as useful as some other ways of learning. You should try following along with my video. Or given your forum location being "Tunneler's Abyss", you are probably a regular. I know they have trains: ask on that server if they can teach you. I think Hume2 is the train expert on that server.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Josselin2
Member
Posts: 102
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

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

by Josselin2 » Post

Blockhead wrote:
Fri Jan 14, 2022 15:17
As a rule, you should always assign all TCBS to their positions before creating any sections. That is likely what has created this mess where they are all in the same section.
Yes, that seems to be correct. The tutorial says this:
  • Assign TCB 1 to the track
  • Right-click the TCB, and click both "Create interlocked track sections" buttons
  • Repeat both steps for TCBs 2-6
But that does not work, whereas your suggestion does work:
  • Assign TCB 1 to the track
  • Repeat this step for TCBs 2-6
  • Right-click TCB 1, and click both "Create interlocked track sections" buttons
  • Repeat this step for TCBs 2-6
Blockhead wrote:
Fri Jan 14, 2022 15:17
Or given your forum location being "Tunneler's Abyss", you are probably a regular. I know they have trains: ask on that server if they can teach you. I think Hume2 is the train expert on that server.
Good advice in general. But this is not a "my trains don't work" question, this is a "the tutorial is wrong and we should try to fix it" question.

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

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

by orwell » Post

This is something @Codesound should look into.
Anyways, I am starting to rework the route programming system, to avoid such situations in the future.
http://git.bananach.space/advtrains.git ... rog_rework
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

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

by yw05 » Post

I added this to the manual. The wording does need some improvements though. (Edit: I have corrected irrelevent -> irrelevant)
2022-01-15-13-54-45.png
2022-01-15-13-54-45.png (37.77 KiB) Viewed 3795 times

@orwell: would it perhaps be better to put the TrackIterator interface into a separate file?

User avatar
Codesound
Member
Posts: 365
Joined: Thu Jun 09, 2016 14:56

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

by Codesound » Post

Josselin2 wrote:
Thu Jan 13, 2022 09:50
Codesound wrote:
Sun Nov 21, 2021 10:03
I completely rewritten the mini guide... I hope it's better than the first one.... thank you all for the help...
I've tried building this three times now, and always with the same result: at part 55, Signal 2 does not have a "Finiish route at the end of the next section" button (but Signal 3 does).

Image
Hi,

sorry if I only answer now, but it's months where I work hundreds of miles from home and don't really have time to answer. If you are using the first/second version of the guide, yes, I confirm that it is wrong.

@Blockhead and @yw05 they helped me understand where I was wrong, and then how to correct it: steps 11->19
this is the last version of the tutorial.... I hope that help you....
Codesound wrote:
Wed Nov 24, 2021 20:40
Hi,

the Rev.3 of the tutorial is here.... hope you like it...
Blockhead wrote:
Mon Nov 22, 2021 12:44
- Terminology: You said Rule but to be consistent with advtrains the term should be Route. When I hear "Rule" I think ARS Rule like on signals and station/stop tracks

do you allow me for this tutorial this term? ;-) with the next I will use the term "instructors" (...)

https://www.0090.it/cc/index.php/s/7nLcimzbHR6MtKb

thanks for all....

bye

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

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

by orwell » Post

yw05 wrote:
Sat Jan 15, 2022 12:59
I added this to the manual. The wording does need some improvements though. (Edit: I have corrected irrelevent -> irrelevant)
2022-01-15-13-54-45.png


@orwell: would it perhaps be better to put the TrackIterator interface into a separate file?
Maybe, yes. I figured it wouldn't be worth it for just one function, but maybe we can put all track-querying functions that are currently in helpers.lua into a new file.

Regarding this paragraph: This issue, that both sides of a TCB belong to the same TS, is not only unnecessary, but outright dangerous. Currently there is a 'leave' callback on TCBs and it always frees the section behind, regardless of whether the next section is the same, the section will be marked as free. This is one of the items that I want to address with my rework branch.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

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

by yw05 » Post

orwell wrote:
Tue Jan 18, 2022 17:55
@orwell: would it perhaps be better to put the TrackIterator interface into a separate file?
Maybe, yes. I figured it wouldn't be worth it for just one function, but maybe we can put all track-querying functions that are currently in helpers.lua into a new file.
I'm not sure about that. The main reason I suggested that was that it would probably be easier to write unit tests if similar functions were put together in one file (at least this was the case for me when I wrote the speed restriction thing).
Regarding this paragraph: This issue, that both sides of a TCB belong to the same TS, is not only unnecessary, but outright dangerous. Currently there is a 'leave' callback on TCBs and it always frees the section behind, regardless of whether the next section is the same, the section will be marked as free. This is one of the items that I want to address with my rework branch.
I used to have a few TCBs with both sides on the same TS and wonder why it didn't work. That explains it. Thanks.

Should I add this to the manual or wait for you to address the issue?

Josselin2
Member
Posts: 102
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

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

by Josselin2 » Post

Codesound wrote:
Tue Jan 18, 2022 14:16
If you are using the first/second version of the guide, yes, I confirm that it is wrong.
I was definitely using Rev3 of the guide.

User avatar
orwell
Member
Posts: 958
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
IRC: orwell96_mt
In-game: orwell
Location: Raxacoricofallapatorius

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

by orwell » Post

yw05 wrote:
Tue Jan 18, 2022 18:01
Regarding this paragraph: This issue, that both sides of a TCB belong to the same TS, is not only unnecessary, but outright dangerous. Currently there is a 'leave' callback on TCBs and it always frees the section behind, regardless of whether the next section is the same, the section will be marked as free. This is one of the items that I want to address with my rework branch.
I used to have a few TCBs with both sides on the same TS and wonder why it didn't work. That explains it. Thanks.

Should I add this to the manual or wait for you to address the issue?
It should be in the manual for now. Once I have fixed it we can remove it again.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

doxygen_spammer
Member
Posts: 70
Joined: Wed Dec 16, 2020 16:52
GitHub: doxygen-spammer

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

by doxygen_spammer » Post

What is the current state with the eye_offset bug workaround? I see you opened https://github.com/minetest/minetest/issues/5013 and mentioned the dummy_entities branch, but at that time you wrote that it doesn’t work well. Have you checked it again?

I need a workaround for the Minitram Konstal 105 (viewtopic.php?f=9&t=27732), otherwise it is quite unusable...

User avatar
56independent_actual
Member
Posts: 452
Joined: Sun May 23, 2021 16:10
IRC: independent56
In-game: 56independent
Location: Girona Province
Contact:

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

by 56independent_actual » Post

Can i have a quick guide on how to use:
  • * Wagon road numbers
    * Freight codes
    * Routing codes and how to format them
Do freight codes span the train or just the wagon?

Can these be used for shunting, through splitting and recombining wagons?

How do i string routing codes? Say we were on the north wales mainline. If i had a train heading west at Llandudno junction, would routing codes ensure it went west and not south?

I have been able to make a route using signals and designated lines.
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).

yw05
Member
Posts: 366
Joined: Tue May 07, 2019 12:59
GitHub: y5nw
IRC: y5nw
In-game: ywang
Location: Germany

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

by yw05 » Post

My answer here is not totally accurate as I only use certain features mentioned here.
56independent_actual wrote:
Fri Feb 04, 2022 20:18
Can i have a quick guide on how to use:
  • Wagon road numbers
I have never used this, but I have heard that this is some sort of wagon identifier.
  • Freight codes
As far as the LuaATC documentation goes, this is a set of codes that can be set for individual wagons. Freight codes are separated by exclamation marks.
  • Routing codes and how to format them
Routing codes are for the entire train. There is no strict requirement to format them (in the sense that it is not allowed to format them in a particular way), but ARS matches routing codes separated by spaces.

In addition, line numbers (which does not actually have to be a number) are also for the entire train, but these can not be combined. A train can have multiple routing codes but only one line number. I am not sure about how the line/RC is kept when the train is split, though.

From my limited understanding of freight codes:
  • If you want to route a train in a particular direction, you should consider setting the line number or the routing code.
  • If you (for example) operate a postal service and want to group incoming wagons in a way that the wagons with the same destination are shunted onto the same train, you should consider using the freight code.

User avatar
56independent_actual
Member
Posts: 452
Joined: Sun May 23, 2021 16:10
IRC: independent56
In-game: 56independent
Location: Girona Province
Contact:

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

by 56independent_actual » Post

yw05 wrote:
Fri Feb 04, 2022 20:47
My answer here is not totally accurate as I only use certain features mentioned here.
  • Routing codes and how to format them
Routing codes are for the entire train. There is no strict requirement to format them (in the sense that it is not allowed to format them in a particular way), but ARS matches routing codes separated by spaces.

In addition, line numbers (which does not actually have to be a number) are also for the entire train, but these can not be combined. A train can have multiple routing codes but only one line number. I am not sure about how the line/RC is kept when the train is split, though.
So say the routing code to go to Bangor was "LJW BGRT" (BGRT meaning taking a hypothetical ballon track at Bangor). If i set the route at Llandudno which went west to "RC LJW" and the one that went south at Llandudno was "RC LJE", would the train be directed to the correct track? If not, could you provide the correct configuration?
From my limited understanding of freight codes:
  • If you want to route a train in a particular direction, you should consider setting the line number or the routing code.
  • If you (for example) operate a postal service and want to group incoming wagons in a way that the wagons with the same destination are shunted onto the same train, you should consider using the freight code.
Can Luacontrollers parse Freight codes and split the train at the correct posistion, so i can send different parts of the train to different parts of the world, so one player gets their bannas and the other their diamonds?
Warnig: Al my laguage ekscept English is bad, includig Hungarian (magyàränoлиски), Spanish (esпagnyoл), and Russian (рÿсскïанöл).

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 27 guests