I'm making a script that will rez the object inside to the position i chat to it.
Thing is i had done this successfully but then lost the script, now i cant seem to find what I am doing wrong here.
Heres the code:
warpPos( vector destpos )
{ //R&D by Keknehv Psaltery, 05/25/2006
//with a little poking by Strife, and a bit more
//some more munging by Talarus Luan
//Final cleanup by Keknehv Psaltery
//Changed jump value to 411 (4096 ceiling) by Jesse Barnett
// Compute the number of jumps necessary
integer jumps = (integer)(llVecDist(destpos, llGetPos()) / 10.0) + 1;
// Try and avoid stack/heap collisions
if (jumps > 411)
jumps = 411;
list rules = [ PRIM_POSITION, destpos ]; //The start for the rules list
integer count = 1;
while ( ( count = count << 1 ) < jumps)
rules = (rules=[]) + rules + rules; //should tighten memory use.
llSetPrimitiveParams( rules + llList2List( rules, (count - jumps) << 1, count) );
if ( llVecDist( llGetPos(), destpos ) > .001 ) //Failsafe
while ( --jumps )
llSetPos( destpos );
}
string object = "Object";
vector vec = <0,0,0>;
default
{
state_entry()
{
llListen(13, "",NULL_KEY, ""
;}
listen(integer channel, string name,key id, string message)
{
vec = warpPos( (vector)message );
llRezAtRoot(object, vec * llGetRot(), ZERO_VECTOR, llEuler2Rot(<0,0,0> * DEG_TO_RAD) * llGetRot(), 0);
}
}