Projects » Keyframe motion car for trains/lifts/rollercoasters etc

Add this to an object, reset scripts, and then click to start adding points (ADD point).

At the end of the route , select save card. This will create a notecard

Then select RIDE to test it.

The notecard "RIDE" contains the information about the ride.

You can modify the  third column between the '|' to change the speed at which the ride will approach the specific point

You can optionally change the  fourth column to contain a number larger than zero. Then the ride will stop for that number of seconds at the specific point


Added by: OpenSimWorld
Last Update: 2 years ago
Project Category: Utilities
👍 9 like

Code

File name Added By Last Updated Actions
train.lsl OpenSimWorld 5 years ago View


Comments

Hi :) Wondering if anyone found a way of getting a vehicle using this script over a sim crossing?
like(0)
Would it be possible to add text for stop announcements?
like(0)
I love this script. Thank you!
like(0)
I found a work around for making pauses. It involves making each journey its own note card, then having a script at each stop that senses the arrival of the vehicle and waits for a period before saying the name of the next note card to load on the channel set in the vehicle script.

So you make the way points from the start to the first stop then save card. Then clear the points and continue making way points to the next stop, then save card. Do this for all the stops. You will then have a bunch of note cards that you can start with a chat command. You then just need a script that detects when the vehicle has arrived. This can be a sensor or a collision. Once the vehicle is detected, you set a delay before saying the name of the next note card to start on the chat channel you are using in the vehicle script.

I haven't fully tested this, but I have started the vehicle by making a prim say the name of the note card when I touch it, and I have made it generate multiple note cards too. So I'm confident this should work.

EDIT: just uploaded a simple script to help with pausing at waypoints
https://opensimworld.com/library?view=103
like(0)
You can change the fourth column in the notecard RIDE to create a stop. Enter the number of seconds to stop at each specific point (0 = no stopping)
like(0)
I thought that the last number was not working after reading the comments below. I will have to give it a try. Thanks!
Though I quite like separating out the stops into separate note cards as it makes adjusting a route at a later date a lot less bothersome. You can simply redo a single section without having to redo the entire route.
Thanks for the really handy script, I have had a lot of fun with it.
like(0)
This script is awesome! Many thanks for it. I wonder if it would be possible to stop the sound while the vehicle is making a stop. And how this could be done.
like(0)
We have got the script to work for a bus service round our var region - but how do we make the bus stop, wait for 10 seconds and carry on?
Column 4 is supposed to be the time but it doesnt work ie
| | 10 | 10 or | | 10 | 10 | - which is correct????????????????????

Thanks Karen xx
like(0)
Hi Karen,
Just an example ive used to one of my vehicles in my sim:
x,y,z | 8 | 0
x,y,z | 8 | 10

1o coordinate: speed is 8.. last number is 0, so no stop
2o coordinate: speed is 8. last number is 10, so it stops for 10 seconds.
Hope it has been clarified now :)
like(0)
EDIT: the script now does support a stop at each point. The last column in the notecard is the number of seconds to stop. 0 = no stopping
like(0)
Hi thanks for quick reply.. That does work but stops bus at veery way point. Have thoiught of a work around, See my reply to Jimmy below. Unless someone has a brighter idea :) Its a great script and we got an amazing ski lift working at our Ice Mountain Club using it
like(0)
Hi trying to get the script to pause.. Didnt quite understand Jimmys comment and treid playing around with 4th column suiggestion in note above.. Can anyone help.Sorry I a bit thick esxample of how I tried to write 3rd and 4 th column on note card below to get speed of 12 and stop of 15 (speed works)
| 12 | 15 |
also tried | 12 | 15
like(0)
Just an example ive used to one of my vehicles in my sim:
x,y,z | 8 | 0
x,y,z | 8 | 10

1o coordinate: speed is 8.. last number is 0, so no stop
2o coordinate: speed is 8. last number is 10, so it stops for 10 seconds.
Hope it has been clarified now :)
like(0)
Hi Jimmy many thanks for quick reply to Karen and me. And a big shout out for your amazing garden centre :). We were both using the syntax you clarified but it doesnt seem to work on zetaworlds. The suggestion from OSW above does work but that stops at every way point. I guess we will just have to slow the bus right down at every stop (have stop between two way points where speed =1 on each).. Then passengers cabn run for bus like we do in RL :)
like(0)
Hm.. weird.. Wondering why it doesnt work..So... to be sure if it script itself not working, come to my sim ALFHEIM , drop me an IM (send me a notecard as IMs normally got capped). and will send u one of my vehicles i have already script so u test on ur grid..
like(0)
Thx Jimmy..Left an IM and notecard for you on your beautiful region x Bobbi
like(0)
Hm.. didnt get anything. u sure u sent to my av from AMV Grid (i have alts in some other grids but i barely log in on these)
anyway, came to ur sim and send u the folder with scripts (modified versions) and the a car with coordinates to test.
like(0)
thx for the scripts and vehicle Jimmy hun .... The stop feature fine with yours. Brilliant.. (Did send to your avi on Altheirm.. Sometimes IMs dont travel well acoss grid avis. But thx so much ♥ Really appreciate you takung teh time to help
like(0)
How can I stop other people from accessing the script menu? I have put this excellent script in a rowing boat that just drifts around as a drifting ferry to different places in the sim. However people can stop it and leave it stopped .. how can I resolve this? Thank you great script.
like(0)
Under the touch event it needs to be set to owner only, like: { if( llGetOwner() == llDetectedKey(0)) {
like(0)
FEATURE REQUEST ::::::: This script would be awesome for powering rides like a ferris wheel IF there were a synchronization feature. Example: Make a wheel with 6 or more cars. The script will go in the wheel and each of the cars and each script will be on the same channel. The wheel and the cars will not be linked. When you rotate the wheel and move the cars, you only need to click one of them to "add point" and each of the scripted items will record that point. When all points are made you can save CARD... The problem is that the wheel will not synchronize with the cars because it only has a rotation for each keyframe on it's notecard. The cars have position and rotation in their keyframes. So, the cars sync nicely together but the center wheel goes through it's points too rapidly. There needs to be a way to compensate for the wheel rotation so that it matches the movement of the cars! Thanks for your consideration.
like(0)
Yeah making a smooth ferris wheel is very hard. The keyframes would have to synchronize perfectly and since they are all different root objects, they are never going to start in sync. also the movement would be a ton of points in a sinusoidal movement around the wheel which is hard.

The simplest ferris wheel is a TargetOmega wheel, where each seat is a single child mesh that rotates with TargetOmega with exactly the opposite direction as the wheel. It is hugely hit-or-miss and only occasionally works in the viewer.
like(0)
Hi Spax script works great but am wondering just how many points can be added is there a limit?
like(0)
This script is awesome! I built a lift on Menthe in Neverworld Grid to go up a rock face. I have two lifts next to each so i had to change the integer channel of one of them so they don't go up and down at the same time. One lift is in the ground level start and the other at the top level start. I love it! Thank you very much!!
like(1)
If u want to make it on loop after its touched, just replace "KFM_FORWARD" for "KFM_LOOP".
like(0)
Hi! How can I recall a vehicle with a script? I made a ski lift but when the ski car is at the top... I need a button to recall it when someone is at the bottom or how to get it to pause for like 60 seconds in between stops..
like(0)
This script has no recall function. It d interesting though. About pause its the last value after the slash (/).. by default, on notecard, its all set to 0 (zero). values are in seconds.
like(0)
It worked!!! Thank you!
like(0)
Video TUTORIAL on using this script here: https://youtu.be/5kQp-cO58YI
like(1)
Very good tutorial for THIS forever noob. :) How good will be determined when I get around to giving it a go, building something with it that is.
like(0)
Experimentation is key. A standard sized coaster of realistic dimensions will usually take me about 12 (or more) hours to set the waypoints using colored prims; then I must move the car (position + rotation) to each of those prims along the track and 'add point'. I do them in sections... I always say "It takes a lot of love and patience for the artist to get that beautiful ship inside the bottle". If you have the patience, you will go far.
like(1)
Hi spax. i was at ur sim Zion.. nice smooth movement for ur roller coaster. wow.. amazing.
like(0)