[Mod] Advanced Trains [advtrains] [2.2.1]

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

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

by Blockhead » Post

Lol1234 wrote:
Wed Jan 27, 2021 04:16
Hi.

How can use dtrack_atc_st to drive to right with a train by the dtrack_sy_l?

Thanks
That is not possible. ATC only controls trains, not tracks. Your options to change a turnout are
  • The detector rail, which uses mesecons. Not recommended, does not work for trains in unloaded areas.
  • Interlocking - see my video.
  • LuaATC: an advanced topic, see the wiki pages. You want to create an environment with the commands, name the turnout with the passive component naming tool and then add LuaATC tracks with calls to setstate(<pos>, <state>)). States are: y-turnout: l, r ; normal turnout: cr, st.

Bug report: It is possible to assign two TCBs to the same spot.

Code: Select all

Configuring TCB: Please punch the rail you want to assign this TCB to.
Configuring TCB: TCB already exists at this position! It has now been re-assigned
Configuring TCB: Successfully configured TCB
Afterwards, both TCBs show the same info in their formspecs. If I create sections on either one, it shows in either formspec. Any claim of "re-assignment" is false. Unless this is not a bug, like maybe you could make signal boxes like this as well as trackside equipment? No, probably not, doesn't sound well-thought-out.

User avatar
mbb
Member
Posts: 253
Joined: Sat Jan 17, 2015 17:47
GitHub: mbblp
IRC: mBb
In-game: MBB
Location: in front of my pc
Contact:

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

by mbb » Post

uh, nice things happened here:)
If you want to contact me please send me a twitter pm https://twitter.com/mbbdev

W3RQ01
Member
Posts: 17
Joined: Sat Nov 28, 2020 06:33

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

by W3RQ01 » Post

mbb wrote:
Fri Feb 12, 2021 22:35
uh, nice things happened here:)
Wb mbb!
A question: where i can download the steam locomotive that i saw on page 3?

hlqkj
Member
Posts: 22
Joined: Wed Dec 11, 2019 20:10
GitHub: hlqkj
IRC: hlqkj
In-game: hlqkj

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

by hlqkj » Post

Hello, what's your thought and/or feasibility of having a simplified hud displayed to passengers too?

My first concern was for players boarding at terminal stations, where I have the trains standing for a few minutes: they need a way to see the departure count down in my opinion, as already seen by the driver. I tried to have something similar shown on an LCD near the platform, using LUA rails and interrupts, but its laggy and not so precise.

In addition, an hud displaying velocity during the journey wouldn't be too bad either! Perhaps an option could be to replicate the driver's hud but with all the ATC stuff stripped? What do you think?
Quando omni flunkus, moritati.

W3RQ01
Member
Posts: 17
Joined: Sat Nov 28, 2020 06:33

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

by W3RQ01 » Post

hlqkj wrote:
Sat Feb 20, 2021 23:03
Hello, what's your thought and/or feasibility of having a simplified hud displayed to passengers too?

My first concern was for players boarding at terminal stations, where I have the trains standing for a few minutes: they need a way to see the departure count down in my opinion, as already seen by the driver. I tried to have something similar shown on an LCD near the platform, using LUA rails and interrupts, but its laggy and not so precise.

In addition, an hud displaying velocity during the journey wouldn't be too bad either! Perhaps an option could be to replicate the driver's hud but with all the ATC stuff stripped? What do you think?
My advice is to talk at ywang, he made the trainhud.

hlqkj
Member
Posts: 22
Joined: Wed Dec 11, 2019 20:10
GitHub: hlqkj
IRC: hlqkj
In-game: hlqkj

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

by hlqkj » Post

Hello, we just upgraded advtrains --EDIT: we were on commit 48787fc1 (that is release-2.1.4 plus the 69/90 connection fix) and now pulled the latest available db9e4429-- on a server and having some issues, I'd like to ask some help to understand what is not working correctly before posting a bug report, if appropriate.

After the upgrade, all the "normal" signals (i mean simple red/green, non Ks: pole signals and wallmounted signals) doesn't seem to clear the train to full speed anymore on green. Is that the wanted behaviour? If so, this is a breaking thing because we relied on this feature to clear the trains speed limit after station sidings (we limit them to 6 before entering the siding).

Also, all the routes regarding those signals shows the wrong setting when I edit the route and click "Show Aspect" in the signal formspec. The signal shows "1| Halt" where it was (and correctly operates) as green. I notice that in the dropdown menu, the text now specifies that green doesn't clear the speed anymore.

It would be a - very - great mess (but still feasible) if we have to re-configure the signal aspects for all of our routes, but if it turns out that we have to replace all of our signals with Ks to have the speed cleared, we would have to consider to roll back and stuck on the old version, which I really don't want to.

A solution could be to add a 3rd option to the normal signal aspect drop down like - "3| Continue with no speed limit" and default to that during the migration from old data? Or I'm open to suggestions :)

Thanks for any help you could give...
Last edited by hlqkj on Wed Feb 24, 2021 14:04, edited 2 times in total.
Quando omni flunkus, moritati.

hlqkj
Member
Posts: 22
Joined: Wed Dec 11, 2019 20:10
GitHub: hlqkj
IRC: hlqkj
In-game: hlqkj

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

by hlqkj » Post

Looking better into the history, I noticed this: https://git.bananach.space/advtrains.gi ... b099f47f10 - Simplify Signal Aspect Table (H#132) [breaks compatibility with signal API]

Seems then that some breakage with backwards compatibility is intended, talking about the "green" aspect not altering the speed limit. However, all of those signals still shows the wrong setting in the route formspec... So I ask: will the next release include some code to address one or both of these issues? If so I would just checkout the current stable release-2.2.1 now and wait for the next one...
Quando omni flunkus, moritati.

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

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

by Blockhead » Post

hlqkj wrote:
Sat Feb 20, 2021 23:03
Hello, what's your thought and/or feasibility of having a simplified hud displayed to passengers too?
The station/stop rail could add extra functionality to update passengers on the departure time.

Another option that already works would be to use the railwaytime functionality, which is regrettably basically undocumented at this stage. For those who know Lua, functions defined in advtrains/advtrains_line_automation/railwaytime.lua are available under rwt.* in LuaATC. e.g. digiline_send("lcd", rwt.to_string(rwt.now()))
hlqkj wrote:
Wed Feb 24, 2021 13:57
...breakage with backwards compatibility...
The breakage with backwards compatibility is for signal mod authors really, not end users I think current setups should keep work as they used to. Here is a patch that addresses the change in behaviour with default signals (wallmounted, lampless and frestanding) no longer de-restricting speed.

Code: Select all

From 92980a2dfb07b266815f8c6bf6a5afa6a9b582b7 Mon Sep 17 00:00:00 2001
From: Blockhead
Date: Fri, 26 Feb 2021 20:34:02 +1100
Subject: [PATCH] Restore old behaviour: default signals allow max speed

---
 advtrains/signals.lua | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/advtrains/signals.lua b/advtrains/signals.lua
index 9df2f99..3a3efc4 100644
--- a/advtrains/signals.lua
+++ b/advtrains/signals.lua
@@ -21,7 +21,7 @@ return {
 end
 
 local suppasp = {
-		main = {0, false},
+		main = {0, -1},
 		dst = {false},
 		shunt = nil,
 		proceed_as_main = true,
@@ -32,6 +32,14 @@ local suppasp = {
 		}
 }
 
+local function gen_get_aspect(r)
+	return function(pos,node)
+		return (aspect(r=="on")
+			and {main=-1, proceed_as_main = true})
+			or {main=0}
+	end
+end
+
 for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red", als="green"}}) do
 
 	advtrains.trackplacer.register_tracktype("advtrains:retrosignal", "")
@@ -91,9 +99,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
 						advtrains.ndb.swap_node(pos, {name = "advtrains:retrosignal_off"..rotation, param2 = node.param2}, true)
 					end
 				end,
-				get_aspect = function(pos, node)
-					return aspect(r=="on")
-				end,
+				get_aspect = gen_get_aspect(r),
 				supported_aspects = suppasp,
 			},
 			can_dig = can_dig_func,
@@ -139,7 +145,9 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
 					advtrains.interlocking.show_ip_form(pos, pname)
 				elseif advtrains.check_turnout_signal_protection(pos, player:get_player_name()) then
 					advtrains.setstate(pos, f.als, node)
-					advtrains.interlocking.signal_on_aspect_changed(pos)
+					if advtrains.interlocking then
+						advtrains.interlocking.signal_on_aspect_changed(pos)
+					end
 				end
 			end,
 			-- new signal API
@@ -151,9 +159,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
 						advtrains.ndb.swap_node(pos, {name = "advtrains:signal_off"..rotation, param2 = node.param2}, true)
 					end
 				end,
-				get_aspect = function(pos, node)
-					return aspect(r=="on")
-				end,
+				get_aspect = gen_get_aspect(r),
 				supported_aspects = suppasp,
 				getstate = f.ls,
 				setstate = function(pos, node, newstate)
@@ -220,9 +226,7 @@ for r,f in pairs({on={as="off", ls="green", als="red"}, off={as="on", ls="red",
 						advtrains.ndb.swap_node(pos, {name = "advtrains:signal_wall_"..loc.."_off", param2 = node.param2}, true)
 					end
 				end,
-				get_aspect = function(pos, node)
-					return aspect(r=="on")
-				end,
+				get_aspect = gen_get_aspect(r),
 				supported_aspects = suppasp,
 				getstate = f.ls,
 				setstate = function(pos, node, newstate)
-- 
2.30.1.windows.1

Post Reply

Who is online

Users browsing this forum: twoelk and 6 guests