Table of Contents

About

SecondLife third-party viewers such as Phoenix/Firestorm benefit from a movelock feature that can be activated via the key-combo Ctrl+Alt+P and prevents the avatar to move or be moved effectively locking the avatar in place.

Firestorm seems to accomplish the movelock by using its LSL bridge created automatically when the user logs in and then makes a script inside the LSL bride call a function named movelockMe. The function seems to trigger llMoveToTarget and set the the object that it is contained in, in this case, the avatar itself, to a vehicle type for the extra added effect of sliding back into place whenever the avatar is nudged.

Code

A reduced version of the Firestorm LSL bridge can be extracted:

movelockMe(integer lock)
{
    if (lock)
    {
        llMoveToTarget(llGetPos() - <0, 0, 0.1>, 0.05);
        llSetVehicleType(VEHICLE_TYPE_SLED);
        llSetVehicleFloatParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, 0.05);
        llSetVehicleFloatParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, 0.05);
    }
    else
    {
        llStopMoveToTarget();
        llSetVehicleType(VEHICLE_TYPE_NONE);
    }
}
 
integer LOCK_STATE = TRUE;
 
default
{
 
    state_entry()
    {
        movelockMe(LOCK_STATE);
    }
    touch_start(integer num)
    {
        if(llDetectedKey(0) != llGetCreator())
        {
            return;
        }
 
        LOCK_STATE = !LOCK_STATE;
 
        movelockMe(LOCK_STATE);
    }
}

and added to any primitive or object that Corrade is wearing to achieve the same effect.

The script will:

  • initially enable the move lock,
  • toggle the move lock state in case the creator of the primitive touches the object.

Alternatives

Perhaps the best alternative in case land rights are available is to create a poseball and then use Corrade commands to sit on the poseball - perhaps even trigger an animation such that Corrade runs some animation on a loop when it sits on the poseball.

A Corrade template is already available for this alternative and it might be a better option since it is easier to modify an in-world object than to have to access the contents of a primitive or object that is worn by Corrade.


secondlife/scripted_agents/corrade/projects/in_world/phantom_or_movelock.txt ยท Last modified: 2022/11/24 07:45 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.