Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llGround / llWater Rezzer / Mover Help =)

Ody Naglo
Registered User
Join date: 1 Apr 2008
Posts: 31
02-10-2009 11:12
I been trying to get this so it rezzes the object on the ground and on water but also if there is an object like a prim-platform it stops also. Cant seem to get it to work with the prim part. Help Please =)



CODE


FindGroundOrWater()
{
float fHeight = llGround( ZERO_VECTOR);
float fWaterLevel = llWater( ZERO_VECTOR );
if( fHeight < fWaterLevel )
fHeight = fWaterLevel;
vector vTarget = llGetPos();

//llSetPos can only move 10m at a time.
integer iCounter = 1 + llAbs((integer)(vTarget.z - fHeight) / 10);
vTarget.z = fHeight;
do
llSetPos( vTarget +<0,0,1.85> );
while( --iCounter );
}
string partone;
string parttwo;

default
{
on_rez(integer total_number)
{
FindGroundOrWater();
}
state_entry()
{
llListen(-2665985,"","","");
}

listen(integer channel, string name, key id, string message)
{

partone = llGetSubString(message, 0, 35);
if(partone == llGetOwner())
{
parttwo = llGetSubString(message, 37, 40);
if(parttwo == "die")
{
llDie();
}
}
}
}

/
CODE
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
02-10-2009 11:38
Not sure how you'd find a prim near the water.. Maybe make your object physical and let it drop until it gets to the water height, land height or collides with something?

For moving on the code you have now, you can do this (which is not even compliled, let alone tested) instead..

vector vTarget = llGetPos();
vTarget.z = fHeight;

while (llVecDist (vTarget, llGetPos()) > 0.1)
{
llSetPos (vTarget);
}
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Ody Naglo
Registered User
Join date: 1 Apr 2008
Posts: 31
02-10-2009 15:01
I cant use physical becuase the object is 60 prims
Ody Naglo
Registered User
Join date: 1 Apr 2008
Posts: 31
02-10-2009 18:44
Or maybe a lil help with Rez hight that works off Avatars hight? I couldnt seem to figure this out so I went onto the llGround & water instead.