This shows you the differences between two versions of the page.
— | secondlife:scripted_agents:corrade:projects:in_world:phantom_or_movelock [2022/11/24 07:45] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== About ====== | ||
+ | |||
+ | SecondLife third-party viewers such as Phoenix/ | ||
+ | |||
+ | 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 '' | ||
+ | |||
+ | ====== Code ====== | ||
+ | |||
+ | A reduced version of the Firestorm LSL bridge can be extracted: | ||
+ | <code lsl2> | ||
+ | movelockMe(integer lock) | ||
+ | { | ||
+ | if (lock) | ||
+ | { | ||
+ | llMoveToTarget(llGetPos() - <0, 0, 0.1>, 0.05); | ||
+ | llSetVehicleType(VEHICLE_TYPE_SLED); | ||
+ | llSetVehicleFloatParam(VEHICLE_LINEAR_FRICTION_TIMESCALE, | ||
+ | llSetVehicleFloatParam(VEHICLE_ANGULAR_FRICTION_TIMESCALE, | ||
+ | } | ||
+ | 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. | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | |||