- 0
LSL scripting problem, multiple collisions
You are about to reply to a thread that has been inactive for 3321 days.
Please take a moment to consider if this thread is worth bumping.
Please take a moment to consider if this thread is worth bumping.
Question
SapphicFancy
// sometimes, for no apparent reason, the ball will return twice
// since the ball return function is only called from the collision event
// i have to deduce that its some sort of multi-collision that is
// remembered and recalled
// ive tried resetscript, but that does not stop it
// ive tried resetting the " numberOfCollisions" to zero and that does not stop it
// BOWLING BALL by gwen
//
// with return or play capabilities
//
//
vector motionless; // where am i now, have i moved?
vector returnToZ = < 0, 0, 63 >; // going back up for another roll
vector returnToXY = < -49, -69, 0 >; // move across to starting point
vector tempHolding = <181, 202, 4002>; // so the person in the ball can see the pins fall
ballReturn() // this returns the ball to the start point
{
llSetStatus(STATUS_PHYSICS, FALSE); // must shut off physical for llSetKeyframedMotion
llSetRegionPos(tempHolding); // destination < 132,133, 4065 >
llSleep(10); // rest here a moment, just for the heck of it
llSetKeyframedMotion([ returnToZ, ZERO_ROTATION, 7.0 ],[ ]); // rise to start elevation
llSleep(7); // have to use this to keep all motions from misfiring
llSetKeyframedMotion([ returnToXY, ZERO_ROTATION, 7.0 ],[ ]); // move to start xy point
llSleep(7);
llSetKeyframedMotion([ ],[ ]); // stop the keyframedmotion
llSetStatus(STATUS_PHYSICS, TRUE); // return to physical status
}
// sometimes, for no apparent reason, the ball will return twice
// since this function is only called from the collision event
// i have to deduce that its some sort of multicollision that is
// remembered and recalled
default
{
state_entry()
{
llSitTarget( < 0.0, 0.0, -0.1 >, ZERO_ROTATION ); // so someone can sit in the ball while its knocking down the pins.
llCollisionFilter("MYRTLE COVE BOWLING SET","",TRUE); // only if i hit pins
motionless = llGetPos(); // where am i now?
llSetTimerEvent(1800); // if i'm still there 30 minutes from now ...
}
collision_start(integer numberOfCollisions) // hit some pins
{
llSetTimerEvent(0); // stop the death timer
llSleep(10); // wait for the colliding to have its full chance
ballReturn(); // return the ball close to the start poin
motionless = llGetPos(); // where am i now?
llSetTimerEvent(1800); // if i'm still there 30 minutes from now ...
}
timer() // if i'm not colliding with pins, but still being played with, i'm safe
{
if (motionless == llGetPos()) // have i not been used in 30 minutes?
{
llDie(); // keep the sim clean
}
llSetTimerEvent(1800); // if i'm still there 30 minutes from now ...
}
}
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now