User talk:Jana Kamachi/tut wprimz

From Second Life Wiki
Jump to navigation Jump to search

Auto Follow Suggestion

This thing is amazing, it defeated every no-push orbiter I threw at it 95% of the time. I made a basic script to have it automatically set its position on me...

vector key2pos(key in_target)
{
    return llList2Vector(llGetObjectDetails(in_target, [OBJECT_POS]), 0);
}
warpPos( vector destpos) 
{
    integer jumps = (integer)(llVecDist(destpos, llGetPos()) / 10.0) + 1;
    if (jumps > 100 ) jumps = 100;
    list rules = [ PRIM_POSITION, destpos ];
    integer count = 1;
    while ( ( count = count << 1 ) < jumps) rules = (rules=[]) + rules + rules;
    llSetPrimitiveParams(rules + llList2List( rules, (count - jumps) << 1, count) );
}
default
{
    on_rez(integer start_param)
    {
        llResetScript();
    }
    state_entry()
    {
        llSetTimerEvent(1.0);
    }
    timer()
    {
        warpPos(key2pos(llGetOwner()));
    }
}

Madgeek Nixdorf 14:01, 2 December 2007 (PST)