Animated signal: keep it red until the train arrives plus 45 seconds
Page 1 of 1
Animated signal: keep it red until the train arrives plus 45 seconds
I'd like to ask for a bit of help with .animated coding. I have a signal which is right after a passing station. I want to keep it red, because there is an oncoming train. However, I don't seem to be able to do that using normal signals (since it's a passing station, not a stopping one).
Therefore I decided to do this as an animated object. So here is what I have:
- signal.animated including:
- stationary signal pole
- red.b3d for the red light
- green.b3d for the green light
I'd like red.b3d to remain visible until my driveable train is within 200 metres of the signal plus 45 seconds. That is enough time for the oncoming AI train to enter the station. After this time I'd like red.b3d to disappear and green.b3d to appear instead.
Can anyone help me with code for this?
Therefore I decided to do this as an animated object. So here is what I have:
- signal.animated including:
- stationary signal pole
- red.b3d for the red light
- green.b3d for the green light
I'd like red.b3d to remain visible until my driveable train is within 200 metres of the signal plus 45 seconds. That is enough time for the oncoming AI train to enter the station. After this time I'd like red.b3d to disappear and green.b3d to appear instead.
Can anyone help me with code for this?
Re: Animated signal: keep it red until the train arrives plus 45 seconds
I've found the solution and I'll post it here in case anyone else searches for this.
The object should be loaded in the With Signal section as a signal and placed in the route using the .SigF command. The function we need is this:
The object should be loaded in the With Signal section as a signal and placed in the route using the .SigF command. The function we need is this:
- Code:
StateFunction = if[trackDistance>200 | section==0, 0, min[value + 0.5*delta/45, 1]]
Similar topics
» How to set a train with 3 animated bogie?
» Some much needed functions for train .animated files
» Objects in an animated container disappear in Routeviewer and OpenBVE after the insertion point of the .animated file
» 1.7.3.0 build crashing after 4-5 seconds of loading up.
» Even though the AI train hasn't stop completely, the AI train is open the doors.
» Some much needed functions for train .animated files
» Objects in an animated container disappear in Routeviewer and OpenBVE after the insertion point of the .animated file
» 1.7.3.0 build crashing after 4-5 seconds of loading up.
» Even though the AI train hasn't stop completely, the AI train is open the doors.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|