Jump to content

avatar sit


Rayne McAndrews
 Share

You are about to reply to a thread that has been inactive for 2526 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

  • 4 years later...
22 minutes ago, Innula Zenovka said:

A script in the object can use the changed event to know if someone has sat down on it or stood up

That is quite correct.  To be clear, though, that will work only if the script is in the object that the avatar is sitting on.  It depends on testing
 

if (change & CHANGED_LINK){
    if (llAvatarOnSitTarget() ){
        //Avatar is sitting on this object
    }
}

The question that the OP asked in this thread was more general.

On 8/29/2012 at 0:14 PM, Rayne McAndrews said:

is there a way to determine via hud attached to avatar if the avatar sits on something?

This something could be anything scripted or non and may or may not be owned by the avatar itself.

When the question is "Is my avatar sitting on anything?", you have no choice to but to poll llGetAgentInfo, and that implies some sort of timer.

  • Like 2
Link to comment
Share on other sites

You can also satisfy both the questions of "Am I sitting on an object?" and "What object am I sitting on?" with OBJECT_ROOT for llGetObjectDetails():

default
{
    state_entry()
    {
        llSetText("",ZERO_VECTOR,1.0);
        llSetTimerEvent(1.0);
    }
    on_rez(integer i)
    {
        llResetScript();
    }
    timer()
    {
        key k = llList2Key(llGetObjectDetails(llGetOwner(),[OBJECT_ROOT]),0);
        llSetText("You are " + llList2String(["sitting on an object named, '" + llKey2Name(k) + "'","NOT sitting on an object."],k == llGetOwner()),<1.0,1.0,1.0>,1.0);
    }
}

 

  • Like 3
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2526 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...