llSitTarget

From Second Life Wiki
Revision as of 09:08, 28 April 2007 by Strife Onizuka (talk | contribs)
Jump to navigation Jump to search

Summary

Function: llSitTarget( vector offset, rotation rot );
0.0 Forced Delay
10.0 Energy

Set the sit location for this object (if offset == <0.0, 0.0, 0.0> clear it)

• vector offset
• rotation rot

Examples

default
{
    state_entry()
    {
        llSitTarget(<0.0, 0.0, 1.0>, ZERO_ROTATION); //The vector's components must not all be set to 0 for effect to take place.
    }
}

Useful Snippets

UpdateSitTarget(vector pos, rotation rot)
{
    key a = llAvatarOnSitTarget();
    if(a)
        llSetLinkPrimitiveParams(GetAgentLinkNumber(a), [PRIM_POSITION, llGetLocalPos() + (pos * llGetLocalRot()),
                                                         PRIM_ROTATION, rot *llGetLocalRot()]);
    llSitTarget(pos, rot);
}//Written by Strife Onizuka

integer GetAgentLinkNumber(key c)
{
    integer a = -~llGetNumberOfPrims();
    key b;
    if(a > 2)
        while(llGetAgentSize(b = llGetLinkKey(a = ~-a)))
            if(b == c)
                return a;
    return 0;
}//Written by Strife Onizuka

See Also

Events

•  changed

Functions

•  llSetSitText
•  llAvatarOnSitTarget
•  llUnSit

Deep Notes

Signature

function void llSitTarget( vector offset, rotation rot );