integer shoutchan = 0;
integer SHOUTCHANX;
string OBJECTtoFOLLOW = "wall2";
vector offsetsensor = ZERO_VECTOR;
rotation baserot = ZERO_ROTATION;
default
{
state_entry()
{
SHOUTCHANX = llListen(shoutchan, "","",""
;}
listen(integer SHOUTCHANX, string name, key id, string message)
{
if ( message == "fullON" ){
llSensorRemove();
llSay(0, "Follow Off"
;}
else if ( message == "fullOFF" ){
llSensorRepeat(OBJECTtoFOLLOW, "", ACTIVE | PASSIVE, 20.0, PI, 1.0);
llSay(0, "Following"
;}
}
sensor(integer det)
{
rotation rot = llDetectedRot(0);
if (offsetsensor == ZERO_VECTOR) // store offset once
{
baserot = llGetRot() / rot;
offsetsensor = (llGetPos() - llDetectedPos(0)) / rot;;
}
llSetPrimitiveParams([
PRIM_ROTATION, llDetectedRot(0) * baserot,
PRIM_POSITION, llDetectedPos(0) + (offsetsensor * rot) ]);
}
no_sensor()
{
offsetsensor = ZERO_VECTOR;
}
}
The channels and what not will be neccessary, this script will be merged into a larger script that listens to a dialogue menu. This is my last hurdle in completing my project and it's starting to give me a headache. lol Thanks for any help you can offer.