Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Linden Water Collision?

Rebecca Naidoo
Registered User
Join date: 28 May 2008
Posts: 82
07-09-2008 05:37
How can I detect when my object hits linden water?
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
07-09-2008 06:09
float above_water = llWater( ZERO_VECTOR );
is the height above water at the prims position.
Read all about it: http://www.lslwiki.net/lslwiki/wakka.php?wakka=llWater
_____________________
From Studio Dora
Kaluura Boa
Polygon Project
Join date: 27 Mar 2007
Posts: 194
07-09-2008 06:34
timer()
{
integer water = llWater(ZERO_VECTOR);
if (llGround(ZERO_VECTOR) < water) // We're over water
{
vector my_pos = llGetPos();
if ( (my_pos.z - water) < 0.05 ) // Just over the surface
{
// Diving in!
}
else if ( (water - my_pos.z) < 0.05 ) // Just below the surface
{
// Emerging!
}
}

This (untested) timer event should theoretically tell you when the center of the prim becomes very close from the water surface. (It must be adapted to the size of your object.)

Anyways, that should be some food for your brain... ;-)
DR Dahlgren
Content Creator
Join date: 27 Aug 2006
Posts: 79
Minor fix
01-28-2009 22:01
integer water = llWater(ZERO_VECTOR);

should be a float

float water = llWater(ZERO_VECTOR);
_____________________
DR Dahlgren
Dahlgren Engineering and Design
Connecting Your Worlds
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-29-2009 00:21
As for true collision, you can't. You could approximate with the object's scale or bounding box, but there's no equivalent of the collision or land_collision events for water.

You could also fake it in a specific area by putting a volume detect box at water height, but that's a pretty limited option, of course.
Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
01-30-2009 03:12
Kinda weird...I asked this four months ago and it got answered then.
DR Dahlgren
Content Creator
Join date: 27 Aug 2006
Posts: 79
Sorry Nyx
01-30-2009 07:21
I forgot the forums were here only for you... Okay everyone, we can stop now, asked and answered... LOL
_____________________
DR Dahlgren
Dahlgren Engineering and Design
Connecting Your Worlds
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
01-30-2009 11:07
Oops! Necromancy, and I didn't even notice. Quick! Someone get out the holy water! ;)
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
01-30-2009 14:27
"And thou shalt raise the grenade over thy head, and count thee to 5. Not to 6 shalt thou count, nor unto 4 shalt thou count, unless thou countest immediately on to 5."



(Slight paraphrase...!)
DR Dahlgren
Content Creator
Join date: 27 Aug 2006
Posts: 79
really the number is 3, but what the heck...
01-31-2009 00:24
Once the number five, being the number of the counting, be reached, then lobbest thou the Holy Hand Grenade in the direction of thine foe, who, being naughty in my sight, shall snuff it."
_____________________
DR Dahlgren
Dahlgren Engineering and Design
Connecting Your Worlds
Dekka Raymaker
thinking very hard
Join date: 4 Feb 2007
Posts: 3,898
01-31-2009 03:01
From: DR Dahlgren
Once the number five, being the number of the counting, be reached, then lobbest thou the Holy Hand Grenade in the direction of thine foe, who, being naughty in my sight, shall snuff it."

so any examples of that script please! :)