Help with animation
3 posters
Page 1 of 1
Help with animation
I'd like to ask for some help with an animation. There is this bridge in the picture and on the bridge there is a train.
I'd like this train to slowly move towards the right, but only when it is within viewing distance from the driver's train. Once it has moved towards the right and the driver's train has passed it (or it gets out of viewing distance) it should disappear, so that if the driver returns to this point the train shouldn't be there again. Can anyone help me with this?
I'd like this train to slowly move towards the right, but only when it is within viewing distance from the driver's train. Once it has moved towards the right and the driver's train has passed it (or it gets out of viewing distance) it should disappear, so that if the driver returns to this point the train shouldn't be there again. Can anyone help me with this?
Re: Help with animation
It seems your problem is partly the same as the road traffic over bridges which I use in the Irish routes (which is based on NWM code, they did it first). And partly the same as the approach control I use for crossing gates and and their "distant" signals. Not sure how to write the combined formula though.
A "Animated Cookbook" would be very useful. All I've had to work with was the original OpenBVE "Demo Route" with examples of code.
A "Animated Cookbook" would be very useful. All I've had to work with was the original OpenBVE "Demo Route" with examples of code.
Re: Help with animation
I have done the same within my route, the only difference is the moving object on the bridge was a lorry. See this:
Hope this helps.
- Code:
[object]
Position = 0, 0, 0
states = Axor.csv
RotateYFunction = 1.571
TranslateXFunction= if[trackdistance[0]<450 & trackdistance[0]> -300, -(0.75)*trackdistance, 0]
This one would be going left, due to minus in front of 0.75. The rotation function is applied because of the way the original obect was created - if it wasn't there, the lorry would be "sidesaddling" . The "(0.75)" in this case influeneces the speed of the car movement. If you want your train on the bridge to move slowly, you will have to put a lower number instead.
Any questions - let me know. Hope this helps.
Similar topics
» Door animation
» Animation loop problem
» Animation formula brainpicking...
» Slam door animation?
» Animation code - assistance needed
» Animation loop problem
» Animation formula brainpicking...
» Slam door animation?
» Animation code - assistance needed
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum