[Opensim-dev] Script not working correctly in Opensim

Chris Collins chris at tipodean.com
Thu Oct 20 07:25:05 UTC 2011


I have the following script that is working within SL but does not always
work in OpenSim. Sometimes it works other times it does not. Can anyone see
anything that would be causing issues on Opensim

vector DEST = <130, 182, 36>;
vector SITPOS = <0,0,0.5>;
key gAv;

moveTo(vector origin, vector destination ) { // removed jumpdist
    float dist = llVecDist(origin, destination);
    integer passes = llCeil( llLog(dist/10.0) / llLog(2.0) );
    integer i;
    list params = [PRIM_POSITION, destination];
    for (i=0; i<passes; i++) {
        params = (params=[]) + params + params;
    }
    llSetPrimitiveParams(params);
}

teleport(key av) {
    if (av == NULL_KEY)
    {
        return;
    }

    vector origin = llGetPos();
    llSetAlpha (0.0, ALL_SIDES);
    moveTo(origin, DEST);
    // no need to sleep -- llSetPrimParams has 0.2s delay
    llUnSit(av);
    moveTo(DEST, origin);
    llSetAlpha (1.0, ALL_SIDES);
}

default
{
    state_entry()
    {
        llSetClickAction (CLICK_ACTION_SIT);
        llSitTarget(SITPOS,llEuler2Rot(<0,0,-90> * DEG_TO_RAD));
    }

    changed(integer changebits)
    {
        if (changebits & CHANGED_LINK)
        {
            gAv = llAvatarOnSitTarget();
            if (gAv != NULL_KEY)
            {
                teleport(gAv);
            }
        }
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20111020/e64ba839/attachment-0001.html>


More information about the Opensim-dev mailing list