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");
}
}

