OpenBVE
OpenBVE copied to clipboard
[Question] is there any way to make an animated function trigerred in route ?
Hello As title said.
I want to make a sort of the interior light is on when current car is in a tunnel, and off when passed the tunnel.
I already know how to write it if using pluginstates feature from bvec plugin, using simple on/off states.
The object is very simple long rectangle shape with a white glow transparent texture in it, so it feel like a bloom from bright object.
Various ways of doing this, but they'd all rely on having the brightness set correctly in the routefile.
You've got the brightness[carIndex] animated variable, which wants a simple else-if to change the state when the brightness is below your preferred value. Day / night textures also work for this, but they blend between the two states, which may not be quite as good.
Is there other method like simply show/hide the object when in certain lenght?
I have an object a simple 1 face actually, containing a video for warn about door about to be open in gif format.
The animated file may looks like this:
[Object]
States = dooropen.b3d
Statefunction = ????
In words let say my route is 500m in length from station A to station B, station A is the start station, station B at 400m. i place a trigger 100m before sta B and at stop position of sta B i also place a trigger, when train 100m remain from sta B show that object, but when train stop or passing stop position of sta B hide that object.
In my head there 2 may possible method
- Using some distance variable such as
distanceStation[stationIndex]
- Using
track.beacon
ortrack.transpoder
This may conflict if the train using safety system.
You need to combine the distance to both the next and previous statins I would think.
Something like the following (off the top of my head, not massively tested):
if[distanceNextStation <= 500 || distancePreviousStation <= 500 , 1, 0]
This will return 1 if the distance to either the next or the previous station is below 500m, or in other words when you're within a 500m circle of any station :)
You could also start getting clever with the distanceStation[stationIndex] variable to show different videos on a per-station basis, but that isn't really reccomended, as it then ties the train to a specific route.