Jump to content
KiondraeLoc

Automatic Sit on Prim

Recommended Posts

How can I get my avatar to immediately sit on a prim upon rez? I've looked at some of the sit functions and can't figure it out. Thanks.

Share this post


Link to post
Share on other sites
Posted (edited)

The only way for an avatar to automatically sit on anything is with an RLV command.

http://wiki.secondlife.com/wiki/LSL_Protocol/RestrainedLoveAPI

Quote

Force sit on an object : @sit:<UUID>=force (*)
Implemented in v1.10

Does not work if the user is prevented from sit-tping and further than 1.5 meters away, or when prevented from unsitting.

BEWARE: genuine RLV viewers (Cool VL Viewer v1.26.20.28 and newer excepted) require that the seat got a sit-target defined (llSitTarget() LSL function), else the force-sit fails with a "No suitable surface to sit on" error message from SL server. RLVa viewers will succeed to sit the avatar on a sit-target-less seat, on the condition that the distance between the avatar and the seat is less than 8m.

(*) Silently discarded if the user is prevented from doing so by the corresponding restriction. This is on purpose.

To clarify, especially if you've never used RLV, these commands are used with llOwnerSay so the viewer can take action.

string target_prim_uuid;
llOwnerSay("@sit:" + target_prim_uuid + "=force");

Also to add; You can get the UUID of the rezzed object in the object_rez event, eg:

default
{
    state_entry()
    {
        // llRezObject
    }

    object_rez(key id)
    {
        llOwnerSay("@sit:" + (string)id + "=force");
    }
}

 

Edited by Wulfie Reanimator

Share this post


Link to post
Share on other sites
1 hour ago, Wulfie Reanimator said:

Also to add; You can get the UUID of the rezzed object in the object_rez event, eg:


default
{
    state_entry()
    {
        // llRezObject
    }

    object_rez(key id)
    {
        llOwnerSay("@sit:" + (string)id + "=force");
    }
}

 

This is partially incorrect.

You usually want to put an llSleep(0.1); before the RLV command as doing it too quickly after the object is rezzed will cause it to fail.

object_rez(key id) { llSleep(0.1); llOwnerSay("@sit:"+(string)id+"=force"); }

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...