Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

My SeaTurtle's Blink Kicks me Off! Vehicle/LinkMessage/ChangedState problem

Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
02-25-2007 18:40
(is this title too long or what?)

i am using cubey terra's magic carpet script to run this thing. and all worked fine, until i put a blink-synchronizing script into the turtle. this script sends a link message that the eyelids respond to, to blink in synch at random intervals.

the culprit isn't the link message, but apparently the blinking eyelids themselves. they are cut spheres that change the cut to open/close the lids. when these blink (or unblink), they send a changed state to the magic carpet code of 36. i've tried telling the magic carpet to ignore changes #36, but i still get booted off the turtle.
as a matter of fact, the change seems to boot me off before the changed call is finished, otherwise llGetAvatarSitOnTarget() shouldn't return NULL_KEY.

does anybody have ANY idea what's going on and/or (better yet) how to fix it???!

pertinent magic carpet code:
CODE

// DETECT AV SITTING/UNSITTING AND GIVE PERMISSIONS
changed(integer change)
{
llOwnerSay("change: changed link status="+(string)change);
agent = llAvatarOnSitTarget();
if(change & CHANGED_LINK)
{
if((agent == NULL_KEY) && (sit))
{
//
// Avatar gets off vehicle
//
llSetStatus(STATUS_PHYSICS, FALSE);
llStopAnimation("meditation");
llMessageLinked(LINK_SET, 0, "unseated", "");
llStopSound();
llReleaseControls();
sit = FALSE;
listenState(FALSE);
}
else if ((agent != NULL_KEY) && (!sit))
{
//
// Avatar gets on vehicle
//
pilot = llAvatarOnSitTarget();
sit = TRUE;
llRequestPermissions(pilot, PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION);
listenState(TRUE);
llWhisper(0,"O Master of Wind and Wave, "+llKey2Name(pilot)+", command me as you will. Should you need assistance, please speak the word HELP.");
llMessageLinked(LINK_SET, 0, "seated", "");
}


}
}



full magic carpet code, minus comments and vehicle controls:
CODE

vector SIT_POS = <-1.71324, 0.01836, -0.12756>;
rotation SIT_ROT = <-0.00000, -0.70711, -0.00000, 0.70711>;
integer sit = FALSE;
integer listenTrack;
integer brake = TRUE;
integer BEACON_INT = 1440; //# of mins between beacon messages
integer beaconMins; // current # of minutes elapsed since last beacon message

float X_THRUST = 20;
float Z_THRUST = 15;

float xMotor;
float zMotor;

key agent;
key pilot;


vector CAM_OFFSET = <-10.0, 0.0, 2.0>;
vector CAM_ANG = <0.0, 0.0, 2.0>;

listenState(integer on) // start/stop listen
{
if (listenTrack)
{
llListenRemove(listenTrack);
listenTrack = 0;
}
if (on) listenTrack = llListen(0, "", pilot, "");
}

help()
{
llWhisper(0,"Master of Wind and Wave, you may use these commands to fly me...");
llWhisper(0," Say ARISE to begin moving.");
llWhisper(0," Say STOP to stop moving.");
llWhisper(0," PgUp/PgDn or E/C = hover up/down");
llWhisper(0," Arrow keys or WASD = forward, back, left, right");
llWhisper(0," Say HELP to display help.");
}


default
{

state_entry()
{
llSetSitText("Ride");
llSitTarget(SIT_POS, SIT_ROT);
llSetCameraEyeOffset(CAM_OFFSET);
llSetCameraAtOffset(CAM_ANG);
llCollisionSound("",0.0);


//SET VEHICLE PARAMETERS
.....

}

on_rez(integer num)
{
llSetStatus(STATUS_PHYSICS, FALSE);
pilot = llGetOwner();
llSetTimerEvent(60); // beacon timer for 1 min intervals
}


listen(integer channel, string name, key id, string message)
{
message == llToLower(message);
if (message == "help")
{
help();
}

if (message == "stop")
{
brake = TRUE;
llWhisper(0,"We are stopped, O Master of Wind and Wave. You may say ARISE to resume flight.");
llSetStatus(STATUS_PHYSICS, FALSE);

}
else if (message == "arise")
{
brake = FALSE;
llWhisper(0,"I hear and obey, O Master of Wind and Wave. We now begin flight.");
llSetStatus(STATUS_PHYSICS, TRUE);
}
}


// DETECT AV SITTING/UNSITTING AND GIVE PERMISSIONS
changed(integer change)
{
llOwnerSay("change: changed link status="+(string)change);
agent = llAvatarOnSitTarget();
if(change & CHANGED_LINK)
{
if((agent == NULL_KEY) && (sit))
{
//
// Avatar gets off vehicle
//
llSetStatus(STATUS_PHYSICS, FALSE);
llStopAnimation("meditation");
llMessageLinked(LINK_SET, 0, "unseated", "");
llStopSound();
llReleaseControls();
sit = FALSE;
listenState(FALSE);
}
else if ((agent != NULL_KEY) && (!sit))
{
//
// Avatar gets on vehicle
//
pilot = llAvatarOnSitTarget();
sit = TRUE;
llRequestPermissions(pilot, PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION);
listenState(TRUE);
llWhisper(0,"O Master of Wind and Wave, "+llKey2Name(pilot)+", command me as you will. Should you need assistance, please speak the word HELP.");
llMessageLinked(LINK_SET, 0, "seated", "");
}


}
}





//CHECK PERMISSIONS AND TAKE CONTROLS
run_time_permissions(integer perm)
{
if (perm & (PERMISSION_TAKE_CONTROLS))
{

llTakeControls(CONTROL_UP | CONTROL_DOWN | CONTROL_FWD | CONTROL_BACK | CONTROL_RIGHT | CONTROL_LEFT | CONTROL_ROT_RIGHT | CONTROL_ROT_LEFT, TRUE, FALSE);

}
if (perm & PERMISSION_TRIGGER_ANIMATION)
{
// Admittedly, animations are bugged. I'll let you figure it out. :) -CT
llStartAnimation("meditation");
llStopAnimation("sit");

}

}
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
02-25-2007 21:56
I believe any call to llSetPrimitiveParams([PRIM_TYPE]) will unsit an avatar. The changed() event doesn't matter.

I can't seem to find that documented anywhere at the moment; I think it may have been in the comments of the old wiki page. But I know it's somewhere, and I had a similar issue with a project some time ago. You'll probably have to find a different method of making your eyes blink :(
Bloodsong Termagant
Manic Artist
Join date: 22 Jan 2007
Posts: 615
02-27-2007 19:37
why!?

why why why!!??! why must they torment me so!?

::bangs head on keyboard::
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
02-27-2007 21:30
I recently tripped over this myself. It's the same as changing any of the options on the right half of the edit window Object tab.
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
02-28-2007 09:11
my inderstanding is, you can change the size, position, and rotation of prims in a linkset, and the avatar will not unsit. But actually "reshape" the prim, and everyone gets kicked.

Short version.. make an animated texture to blink the eyes instead, or make full lids that rotate into place, and rotate back into the head to open again.
_____________________

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