How to activate "Doors Opening" Signage when a train is approaching the station.
2 posters
Page 1 of 1
How to activate "Doors Opening" Signage when a train is approaching the station.
Hello, I am currently developing a train where signage would say "Doors Opening on the Right/Left" whenever arriving at a station. Is there a way to code this in, where the sign only activates when the train is approaching a station?
Inamak17- Posts : 9
Join date : 2020-04-01
Rakago likes this post
Re: How to activate "Doors Opening" Signage when a train is approaching the station.
Sure
You want to combine the following animated variables: distanceNextStation, leftDoorsTarget, and rightDoorsTarget.
Thus:
This will display state zero until the train is within 500m of the next station.
At this point, it will display state 1 if the left doors are to open, state 2 if the right doors are to open, or state 0 if neither are to open.
If you want to detect *both* doors opening, just requires another nested if:
You want to combine the following animated variables: distanceNextStation, leftDoorsTarget, and rightDoorsTarget.
Thus:
- Code:
States = Unlit.b3d, LeftDoorsOpen.b3d, RightdoorsOpen.b3d
StateFunction = if[distanceNextStation < 500 , if[leftDoorsTarget > 0, 1, if[rightDoorsTarget > 0, 2, 0]], 0]
This will display state zero until the train is within 500m of the next station.
At this point, it will display state 1 if the left doors are to open, state 2 if the right doors are to open, or state 0 if neither are to open.
If you want to detect *both* doors opening, just requires another nested if:
- Code:
States = Unlit.b3d, LeftDoorsOpen.b3d, RightdoorsOpen.b3d, BothDoorsOpen.b3d
StateFunction = if[distanceNextStation < 500 , if[leftDoorsTarget > 0 && rightDoorsTarget > 0, 3, if[leftDoorsTarget > 0, 1, if[rightDoorsTarget > 0, 2, 0]]], 0]
Northern Line and Rakago like this post
Similar topics
» How do I know when approaching a station?
» Even though the AI train hasn't stop completely, the AI train is open the doors.
» Train Sliding Doors
» Finding train in end station
» Localized train.txt (Different versions of train.txt depending on language)
» Even though the AI train hasn't stop completely, the AI train is open the doors.
» Train Sliding Doors
» Finding train in end station
» Localized train.txt (Different versions of train.txt depending on language)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum