Skip to content

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());
    }
}
 

Related Posts

Readers who viewed this page, also viewed:

blog comments powered by Disqus

Status Updates

My images

Second Anniversary of Locus AmoenusLocus Amoenus Anniversary CeremonyPolitics doesn't need to be taken so serious...Preview of current work at the Lisbon 1755 projectKaseido Quandry at the Representative MeetingWind-blown on the Sun Castle
Gwyneth Llewelyn is offline in Second Life.
Digg! Listed on BlogShares Site Meter EgoSurf for Gwyneth Llewelyn