Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

rocking boat script

Pratyeka Muromachi
Meditating Avatar
Join date: 14 Apr 2005
Posts: 642
07-03-2006 05:06
Is there a script out there that would make a non-physical boat gently rock with the waves? All I need is random rocking script, preferably adjustable, up-down and roll (jumping rock and roll? lol...)

I would need full perms on this script.
Thanks in advance.
_____________________
gone to Openlife Grid and OpenSim standalone, your very own sim on your PC, 45,000 prims, huge prims at will up to 100m, yes, run your own grid on your PC, FOR FREE!
Angela Salome
Registered User
Join date: 6 Oct 2005
Posts: 224
07-04-2006 02:12
From: Pratyeka Muromachi
Is there a script out there that would make a non-physical boat gently rock with the waves? All I need is random rocking script, preferably adjustable, up-down and roll (jumping rock and roll? lol...)

I would need full perms on this script.
Thanks in advance.


There's no way to do this currently with a non-physical object. If your object was physical, it would be easier to fake it.
Pratyeka Muromachi
Meditating Avatar
Join date: 14 Apr 2005
Posts: 642
07-04-2006 02:32
From: Angela Salome
There's no way to do this currently with a non-physical object. If your object was physical, it would be easier to fake it.


Doors are not physical and yet they move.
Before flex prims, Fate Gardens trees were scripted to move, simulating the bending under the wind, yet they were not physical.
_____________________
gone to Openlife Grid and OpenSim standalone, your very own sim on your PC, 45,000 prims, huge prims at will up to 100m, yes, run your own grid on your PC, FOR FREE!
Bitzer Balderdash
Dazed and Confused
Join date: 21 Dec 2005
Posts: 246
07-04-2006 02:52
there are two ways to "move" a non-physical object

Use llSetRot to rotate it, such as doors use, which causes sudden rapid violent jumps from one state to another - not in any way a gentle rocking motion

Or, use llTargetOmega - which gives the appearance of a smooth rotation, but is a client side effect, so would not be much use for a boat, since people in it wouldn't necessarily rock with it.

To achieve a smooth back and forth rocking motion is surprisingly tricky - if you search this forum for tail wagging scripts you will find some that use a combination of the above two calls to make something appear to rock, but they still have some.... interesting glictches from time to time.
Angela Salome
Registered User
Join date: 6 Oct 2005
Posts: 224
07-04-2006 04:36
From: Pratyeka Muromachi
Doors are not physical and yet they move.
Before flex prims, Fate Gardens trees were scripted to move, simulating the bending under the wind, yet they were not physical.


Doors use llSetPos or llSetRot to move, which is not a smooth rocking motion of a boat.
Flexi-prims bend, which is again, not the smooth rocking motion of a boat.
Pratyeka Muromachi
Meditating Avatar
Join date: 14 Apr 2005
Posts: 642
07-04-2006 06:33
I thank you both for clarifying this for me, I'm not proficient in scripting as you may have guessed.

But could the LLSetpos and LLsetrot be used in tiny steps in a delayed loop? For example, I want to rotate around the X axis 5 degrees, could I do it in 10 steps with .1 sec delay between each steps? that would give a 5 degree/sec speed.

The smoothness of the rocking motion does not need to be perfect. Imagine a marina with 20+ boats all rocking randomly over a 2-5 degree range of motion in 3 axis... even if each boat lack smoothness, the whole effect would be acheived.

I'm talking smal boats, 10-15 feet lenght about.
_____________________
gone to Openlife Grid and OpenSim standalone, your very own sim on your PC, 45,000 prims, huge prims at will up to 100m, yes, run your own grid on your PC, FOR FREE!
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-04-2006 11:20
The answer is yes, but it might be a lot of a pain to work out to look good.

Essentially you use Jesrad's technique for large non-physical vehicles - about 4 scripts working in sequence about 0.05s apart (the 0.2s delay then letting the first one trigger again).

It's obviously not completely smooth, but I've driven and observed such a vehicle and it's close enough for me.

Getting the time right etc. is relatively trivial (you can ask Jesrad for a copy of her scripts and lift it straight out pretty much) but getting the rots etc. right for a gentle rock has the potential to be a real PITA. Just how much do you want it? It's doable, but I suspect it's hours and hours of tweaking to get it looking right.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Pratyeka Muromachi
Meditating Avatar
Join date: 14 Apr 2005
Posts: 642
07-04-2006 12:21
Wow! I had no idea such a simple notion (rocking boat) would be so complicated to implement.

But I have seen working swings going back and forth... how is that achieved?

Thanks again for all the feedback.
_____________________
gone to Openlife Grid and OpenSim standalone, your very own sim on your PC, 45,000 prims, huge prims at will up to 100m, yes, run your own grid on your PC, FOR FREE!
paulie Femto
Into the dark
Join date: 13 Sep 2003
Posts: 1,098
ask Kanker Greenacre
07-04-2006 13:38
Kanker is the King of boating in SL. He might know.
_____________________
REUTERS on SL: "Thirty-five thousand people wearing their psyches on the outside and all the attendant unfettered freakishness that brings."
Pratyeka Muromachi
Meditating Avatar
Join date: 14 Apr 2005
Posts: 642
07-04-2006 13:59
Maybe I wasn't clear enough on one detail; the boats I want the rocking motion in are not going anywhere, they are tied in a marina. I just want the effect of rocking motion as if the boats are really floating on moving water...

Or does that make any difference?
_____________________
gone to Openlife Grid and OpenSim standalone, your very own sim on your PC, 45,000 prims, huge prims at will up to 100m, yes, run your own grid on your PC, FOR FREE!
paulie Femto
Into the dark
Join date: 13 Sep 2003
Posts: 1,098
it shouldnt make any diff
07-04-2006 17:24
I think the effect could be acheived by a combination of vertical attractor settings and applied rotational impulses. I'm not much of a vehicle scripter, unfortunately. But, I'll bet someone can help with it.

You might ask Cubey Terra (vehicle scripter extraordinaire) or the FairChangs (Garth and Pituca FairChang).

I'd love to see boats with a little "rock" to them. Thatd be sweet.
_____________________
REUTERS on SL: "Thirty-five thousand people wearing their psyches on the outside and all the attendant unfettered freakishness that brings."
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
07-04-2006 17:33
targetomega would work for this with some tweaking... the problem is each boat is going to be running about a half second timer. Might not be nice on the sim. Worth a try though.
_____________________
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-04-2006 23:08
I sell one such swing script. I use only one script for it, with the 0.2s delay for llSetRot(). It isn't totally smooth even if you're sitting on it, although when you are sitting on it, it's close enough. For people watching it's jerkier for some reason, I think there's a bit of a camera positioning lag that makes it work well enough.

My swing script works in eulers, and uses llSin() so that the movement is consistent for angular velocity and quite a few steps - it might be worth a look for you, and the script is full perms with a license that asks you not to sell it on modable (at least), so you can grab one and adapt it if you want to. Check my picks for locations.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Pratyeka Muromachi
Meditating Avatar
Join date: 14 Apr 2005
Posts: 642
07-05-2006 11:38
Thank you so much Eloise, you rock my boat;) .

I'll give it a go tonight and let you all know in this thread.
_____________________
gone to Openlife Grid and OpenSim standalone, your very own sim on your PC, 45,000 prims, huge prims at will up to 100m, yes, run your own grid on your PC, FOR FREE!
Pratyeka Muromachi
Meditating Avatar
Join date: 14 Apr 2005
Posts: 642
07-07-2006 11:36
I started playing around with Eloise's script and came close to the effect I want. thank you.

But there must be a way to reproduce a swinging movement without having the server calculate every position using what must be a CPU intensive "LLsinx" call ( I think that was). Anyway, would it be possible just to make a list of the positions and just read them trhough a loop? So that you save on calculation time and achieve a smoother motion?

Then if the above works, it would be just a matter of using a random time interval between the loops to achieve random motion.

You could also work with all three axis at the same time.

What do you think?
_____________________
gone to Openlife Grid and OpenSim standalone, your very own sim on your PC, 45,000 prims, huge prims at will up to 100m, yes, run your own grid on your PC, FOR FREE!
Bitzer Balderdash
Dazed and Confused
Join date: 21 Dec 2005
Posts: 246
07-08-2006 06:35
A computer can calulate thousands of sines and cosines per second, whereas, LSL specifically introduced a 0.2 second delay into your script when you use llSetPos, llSetRot, or llPrimitiveParamters, and it is that which is responsible for the somewhat jerky movement.

So yes, it could be done by precalculation, and the movement would be marginally smoother, but probably not percepibly so.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-08-2006 14:17
Calculating the sine is quite light in terms of the hit on the machine. Because you need it to work at funny angles (depending on how you moor your boat, site your swing etc.) you could recalculate the values and store them into a list and cycle through the stored number, but given how lists work in lsl I'm not sure that's actually gaining anything, which is why I didn't bother.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Pratyeka Muromachi
Meditating Avatar
Join date: 14 Apr 2005
Posts: 642
07-11-2006 19:04
Thank you all for your help. I think the 0.2sec delay that SL has built-in the system really kills any attempt at making this idea worthwhile. How do they expect this to become the next internet platform if the inner workings makes anything appear to be running on an old Atari 400...:(
Static sanpan it is, will just have to close eyes and imagine...
_____________________
gone to Openlife Grid and OpenSim standalone, your very own sim on your PC, 45,000 prims, huge prims at will up to 100m, yes, run your own grid on your PC, FOR FREE!
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
07-12-2006 02:41
That's why I suggested finding Jesrad's big mover script, whatever she called it (I'll dig it out and send you a copy in world if I can). She worked out a timing system for cycling through 4 llSetPos() scripts so they fire every 0.05s in rotation. It will make the maths harder for the swing script, at least a bit, but it might work quite nicely.

I've been on the vehicle and observing someone flying one, and the movement is as smooth as a physics enabled vehicle to my eye.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Pratyeka Muromachi
Meditating Avatar
Join date: 14 Apr 2005
Posts: 642
07-12-2006 06:45
From: Eloise Pasteur
That's why I suggested finding Jesrad's big mover script, whatever she called it (I'll dig it out and send you a copy in world if I can). She worked out a timing system for cycling through 4 llSetPos() scripts so they fire every 0.05s in rotation. It will make the maths harder for the swing script, at least a bit, but it might work quite nicely.

I've been on the vehicle and observing someone flying one, and the movement is as smooth as a physics enabled vehicle to my eye.


Sounds like an intricate piece of scripting, (*making a fresh pot of coffee*) cna't wait to take a look at it...
Thanks!
_____________________
gone to Openlife Grid and OpenSim standalone, your very own sim on your PC, 45,000 prims, huge prims at will up to 100m, yes, run your own grid on your PC, FOR FREE!
Jacek Antonelli
Registered User
Join date: 24 Apr 2006
Posts: 8
A feature proposal that would help
07-14-2006 15:45
Before I start, let me disclaim that I proposed the feature I am going to mention. I don't think that affects the merit of the proposal, but I don't want anyone to feel they were 'tricked', or that I was being 'sneaky' by advocating a feature I proposed myself.

I recently proposed a feature which would make it very easy to imitate the rocking motion of a boat (as well as a great number of other types of objects). To briefly summarize, it would be a scripting function similar to llTargetOmega, except that instead of spinning constantly in one direction, the object would smoothly oscillate back and forth. With this feature, you could get a smooth rocking motion with just a single function call!

You can read the details at the forum thread, which includes a link to its entry in the feature voting tool (it is proposal #1615). If this is important to you, please consider allocating a couple votes to it.