Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

LLsetpos but ... Match Rotation?

Dragger Lok
(loading ...)
Join date: 10 Sep 2006
Posts: 228
07-12-2008 05:32
Spent more time than I'm going to admit to- making a follower prim script, the one thing that I can't grasp is how to match the rotation of the prim being followed. A push in the right direction?

-----------------------
Prim to be Followed:
-----------------------

CODE

vector oldpos;

default
{
state_entry()
{
llSleep (0.25);
llSetTimerEvent ( 5 );
}
timer()
{
vector pos = llGetPos();

if ( oldpos != pos )
{
llRegionSay ( 10482, (string)pos );
oldpos = pos;
}
}
}


---------------------------
Follow That Prim Script:
---------------------------

CODE

default
{
state_entry()
{
llListen ( 10482, "", "", "" );
}

listen ( integer chan, string name, key id, string arg )
{
llSetPos ( (vector)arg );
}

}


(digging in the wiki now-)
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
07-12-2008 10:08
Try this:

CODE

// sending script
llRegionSay(CHANNEL, llList2CSV([ llGetPos(), llGetRot() ]));

///receiving script
list params = llCSV2List(message);
vector pos = (vector)llList2String(params, 0);
rotation rot = (rotation)llList2String(params, 1);