Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

pool floaties and prim water

Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
03-26-2007 07:33
Okay I have scripted myself into one of those "crumple it up, throw it at someone, grab the wad of paper, tear it up, set it on fire" kind of places. I feel like I've been banging my head against this problem forever.. and having deleted everything in frustration, I'm starting over fresh and asking for help.

I've got this pool I'm making. and it's cool. it's a cool pool as they say. But the water is prim water. (which means all the ususal specialty huds needed and such) ANyways.. don't really want to get into all that now.. though it is a truly cool system.

Anyways, I've been sitting here trying to make a pool floaty. my hope is that it would be physical, and free-moving in X and Y. bumpable, driftable, etc. That's pretty easy on a solid surface like grass.

I've played with setting zero gravity.. that works pretty well.. but it starts rotating on X and Y axises.. well that's easily solved with a llRotLookAt or something (I managed it, it worked great at keeping it upright.

ANYWAYS... here's the issue.

it's bumpable up and down. Someone swims up from under, and it floats into the sky.. someone jumps on it from above, and it sinks.

I've had a friend hammer on the problem in world.. and he's also at the "walking away and not discussing it with you any more" space.

My original thought was that it would wait for "touch"... then it could record it's z position. But I just can't figure out how to attract to the point on the z axis, without canceling out the x/y movement in the same command.
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-26-2007 15:22
I'm not sure I've fully understood this, but:

moving() and moving_end() should be your friend I think. Maybe a touch to force it back. Rez the prim, fix its height somehow, then, in moving and moving_end check position.

vector pos=llGetPos();
float height=pos.z;
pos.z=targetHeight //height you have set for "water level"
llMoveToTarget(pos..

Or something like that would be my first approach. I've not tried it, but can't see why not. Some variation around that sort of system should, at least approximately, let the water fix for z and move in x and y.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
03-27-2007 07:19
the problem is... that will result in moveto llGetPoz.x, llGetPos.y, DesiredPos.z... negating all horizontal movement. I need "natural drift" on the water's plane.. just not any up or down movement. (or recoverable up or down movement)
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura