• Winking Gwyn
  • Categories

  • Feeling generous today? Any money received will support the continued web hosting of this blog. Donate towards my web hosting bill!
  • Creative Commons License
  • Gwyneth Llewelyn is offline in Second Life.
  • Pages

  • Meta

  • Blog Rank: 32,605
02 Mar

Generic llSitTarget Positioning Script

Tired of taking ages to set script targets? Well, this one should make things easy for you: just put the vector for positioning and the rotation in angles, separated by commas, and the object will reset the SitTarget for you. Then just shout die on public chat, and the script will remove itself; SitTargets are an object property, and you don’t need to have a script inside the prim to keep the SitTarget working.

This is also part of my series of LSL training courses.

default
{
    state_entry()
    {
        list data = llCSV2List(llGetObjectDesc());
       
        llWhisper(0, "Angle is: " + llList2String(data, 0) + ","
                                  + llList2String(data, 1) + ","
                                  + llList2String(data, 2) + "; xyz is: "
                                  + llList2String(data, 3) + ","
                                  + llList2String(data, 4) + ","
                                  + llList2String(data, 5));
       
        rotation myRot = llEuler2Rot( < llList2Float(data, 0) * DEG_TO_RAD,
                                        llList2Float(data, 1) * DEG_TO_RAD,
                                        llList2Float(data, 2) * DEG_TO_RAD > );

        vector target;
        target.y = llList2Float(data, 3);
        target.x = llList2Float(data, 4);
        target.z = llList2Float(data, 5);
        llSitTarget(target, myRot);
        llListen(0, "", "", "die");
    }

    listen(integer c, string n, key k, string m)
    {
        if(m="die") llRemoveInventory(llGetScriptName());
    }
}
 

Leave a Reply

Login Method

OpenID

Anonymous

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This site is using OpenAvatar based on

© 2008 Gwyn’s Home | Entries (RSS) and Comments (RSS)

Powered by Wordpress, design by Web4 Sudoku, based on Pinkline by GPS Gazette