Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

alt lldie()

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
11-30-2007 20:06
ive been trying to figure this out for a wile now, im having trouble figureing how to tie llDie() into a alt string type of thing, when you go lets say 2500 m above the ground something dies or a input amount by the avatar this is what i got so far and im completly lost, probuly couse ive been sick last few days but im more lost then ever, this is what i have so far ><

CODE

default
{
state_entry()
{
llListen(0,"",llGetOwner(),"");
llSetTimerEvent(0.6);
}

timer()
{
vector pos = llGetPos();
pos = <0,0,pos.z-llGround(ZERO_VECTOR)>;
// not sure what to do now

// owner would go "hight die 500" object will die at 500m ect



any help would do
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-30-2007 23:05
you want it to move to 500m above ground level then die?

or you want it to die if it goes more than 500m above ground?

if it's the former, when it get's the command, move it up, then call lldie (warpPos would be good for this) no need for a timer.

if it's the latter you need to be checking pos in the timer constantly
if ((llGetPos()).z - llGround(ZERO_VECTOR) > 500){
llDie();
}
//-- not sure if that (llGetPos()).z hack will work, you may need an intermediate variable to store getPos

EDIT: I sometimes have dreams about code, most of the time the dream seems complex, but the code is simple.... other times, the dream seems simple, but the code comes out as something very strange.... like OP's post... get well soon
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-01-2007 05:49
hehe ya, i get the same thing constatly, think of a idea and bam code gets done quick that how i came up with my sharvendor server in the making ;)

EDIT: fixed
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-01-2007 08:17
i got another issue now, i got the alt all fixed and everything but now, i cant seam to make it trigger something, and ejection at the alt here is what i have

CODE


======main prim =========

default
{
state_entry()
{
llSetTimerEvent(0.6);
}
timer()
{
vector pos = llGetPos();
pos = <0,0,pos.z-llGround(ZERO_VECTOR)>;
{
if (pos.z - llGround(ZERO_VECTOR) > 3000)
{
llSetStatus(STATUS_PHYSICS,FALSE);
llWhisper(0,"ALT Reached EJECTING");
llMessageLinked(LINK_ALL_CHILDREN , 0, "eject", "");
llSleep(5);
llDie();
}
}
}
}

========seat ==========

key sitting;
vector offset = < 0.0, -0.3 , 0.4>;
vector deg = < 0 , 0 , 270 >;
string text = "Sit";

default
{
state_entry()
{
llSetSitText(text);
deg *= DEG_TO_RAD;
rotation quat = llEuler2Rot( deg ); //convert to quaternion
llSitTarget(offset, quat);
}
listen(integer chan, string name, key id, string msg)
{
if(msg == "eject")
{
llUnSit(sitting);
}
}
}
Bobbyb30 Zohari
SL Mentor Coach
Join date: 11 Nov 2006
Posts: 466
12-01-2007 08:24
From: Mrc Homewood
i got another issue now, i got the alt all fixed and everything but now, i cant seam to make it trigger something, and ejection at the alt here is what i have

CODE


======main prim =========

default
{
state_entry()
{
llSetTimerEvent(0.6);
}
timer()
{
vector pos = llGetPos();
pos = <0,0,pos.z-llGround(ZERO_VECTOR)>;
{
if (pos.z - llGround(ZERO_VECTOR) > 3000)
{
llSetStatus(STATUS_PHYSICS,FALSE);
llWhisper(0,"ALT Reached EJECTING");
llMessageLinked(LINK_ALL_CHILDREN , 0, "eject", "");
llSleep(5);
llDie();
}
}
}
}

========seat ==========

key sitting;
vector offset = < 0.0, -0.3 , 0.4>;
vector deg = < 0 , 0 , 270 >;
string text = "Sit";

default
{
state_entry()
{
llSetSitText(text);
deg *= DEG_TO_RAD;
rotation quat = llEuler2Rot( deg ); //convert to quaternion
llSitTarget(offset, quat);
}
listen(integer chan, string name, key id, string msg)
{
if(msg == "eject")
{
llUnSit(sitting);
}
}
}


Do you need the person to be ejected?(I don't fully understand what you wrote...)

try

CODE

change(integer changed)
{
if(change & CHANGED_LINK)
{
if(llGetAvatarOnSitTarget() !=NULL_KEY)
sitting = llGetAvatarOnSitTarget();


Something of that nature to pick up whose sitting.
_____________________
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-01-2007 08:26
Going to have to throw a changed/CHANGED_LINK in there to define the key "sitting"
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-01-2007 09:26
i tried a few diffrent ways and still havent been able to get it

CODE

changed(integer change)
{
if(change & CHANGED_LINK)
{
key sitting = llAvatarOnSitTarget();
}
}
listen(integer chan, string name, key id, string msg)
{
if(msg == "eject")
{
llUnSit(sitting);
}
}
}
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-01-2007 09:44
You are using a listen but the other script is sending a link message. You also can not put an event (listen) inside another event (changed). Events go inside states.

CODE

key sitting;
vector offset = < 0.0, -0.3 , 0.4>;
vector deg = < 0 , 0 , 270 >;
string text = "Sit";

default
{
state_entry()
{
llSetSitText(text);
deg *= DEG_TO_RAD;
rotation quat = llEuler2Rot( deg ); //convert to quaternion
llSitTarget(offset, quat);
}
link_message(integer sender_number, integer number, string message, key id)
{
if(message == "eject")
{
llUnSit(sitting);
}
}
changed(integer change)
{
if(change && CHANGED_LINK)
{
sitting = llAvatarOnSitTarget();
}
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-01-2007 10:07
hehe oops my bad xD

i dont seam to have a good script day today :P im doing stupid stuff like this constatly latly
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-01-2007 11:28
From: Mrc Homewood
hehe oops my bad xD

i dont seam to have a good script day today :P im doing stupid stuff like this constatly latly

90% of the mistakes you make when you are 1st starting are simple ones. It gets both better and worse as you learn and progress into longer, more complicated scripts that intersact with other scripts :) That is when the value of putting in debugs to see where the problem is occuring comes in handy. In you set of scripts you could have put in llOwnerSay's in a few strategic spots to see if the link message is being sent, if the listen event was recieving and the key of the sitting av was known. It still wouldn't have helped with some of the problmes but t would have narrowed it down.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-01-2007 11:42
hehe ya, got like 8million little projects going right now it gets kinda hard to debug every thing, got my back pack glider my jetpack and a few other planes and parachuter launchers to finish up on that i started