iliveisl

 

Simple Sit Script: deconstructed

3 comments

scriptingWithSubquark_002

Is that a torus? wow!

Ikea-wannabe chair designer Ener Hax was hoping to get Dream Walker to script some chairs but timing is everything (read: I should have gone to bed and not logged into the Level 2 Venue grid). =p

Sit scripts are basic scripts to use, but can be a pain to set up when placing in prims that have been cut, hollowed, rotated, spindled, or mutilated (showing my age and the old, old days of computer punch cards! and what is spindling anyway?)

Ener has been making a great collection of chairs for our new endeavor on our very own OpenSim grid hosted by Reaction Grid.

The goal is to create all the furniture needed for making “filming sets” for use in creating video for eLearning scenarios and video podcasts, and also furniture for use in corporate meetings and hotel events.  Including details that help raise environmental awareness for meetings in the real world are part of everything we are building (Ener points out the “we” part of this sentence). =D

Apart from my love of eLearning, I taught college Environmental Science for 7 years and we have Matt Courtland from The Natural Strategy consulting with us for “best green practices” in meetings and events (see one of his blog posts on the greening of hotels).

Now for the LSL sit script, hopefully it helps, especially with rotation.

//place this sit script in a prim (poseball) or the root prim of a linked set
//adapted by David Miller - 23 November 2009
//
string text = "sit";
//what you would like the float text to say
//
default
{
    state_entry()
    {
       vector rot=<270, 0, 0>*DEG_TO_RAD;
       //rotation in degrees of avatar on Sit
       //negative values may also be used
       rotation finalRotation=llEuler2Rot(rot);
       //convert rotation
       llSitTarget(<0.2,0.55,-0.3>, finalRotation);
       //x, y, and z position of avatar on Sit
       //negative values may also be used
       //do not use <0,0,0>
       llSetSitText(text);
       llSetText(text,<1.0,1.0,1.0>,0.6);
       //first 3 values are colour of text
       //single value is text alpha - 1 is opaque, 0 is transparent
    }
    changed(integer change)
    {
       if (change & CHANGED_LINK)
       {
          if (llAvatarOnSitTarget() != NULL_KEY)
          {
             llSetText("",<1.0,1.0,1.0>,0.0);
             //hide string text on Sit
             //llSetAlpha(0, ALL_SIDES);
             //if this was a poseball, uncommenting the line above would
             //hide it on Sit
             //to uncomment a line, remove the double forward slashes //
          }
          else
          {
             llSetText(text,<1.0,1.0,1.0>,0.6);
             //restore string text on Stand Up
             //llSetAlpha(1.0, ALL_SIDES);
             //if this was a poseball, uncommenting the line above would
             //show it on Stand Up
             //to uncomment a line, remove the double forward slashes //
          }
       }
    }
}
scriptingWithSubquark_008

Good thing Ener wears shorts!

Twitter Digg Reddit Stumbleupon Delicious Facebook Linkedin Plusone Tumblr Posterous Snailmail

written by subQuark

November 24th, 2009 at 12:29 am

3 comments to 'Simple Sit Script: deconstructed'

subscribe to comments with RSS or trackBack to 'Simple Sit Script: deconstructed'.

  1. OMG Ener thats sounds soo complecated.., I start to learn to build now but . wow its hard if you don’t know what to do..and there is not many ppl who like to help…grrrr.. anybody can give me some advice I would be grateful. :-))
    And hugsss to you Ener

    Anonymous

    24 Nov 09 at 6:27 am

  2. hey! well, it looks worse than it is, i just don’t have much patience for scripting so subbie gets to do something. i am such an OCD freak that i like to build everything but let him feel important with scripts! =p

    so as far as learning to build, i highly (i mean really do it) recommend taking free classes in-world

    just do Search > Events > Education

    there are classes everyday, the people tend to be really nice, and if you like them, you can make a donation

    i was intimidated about taking a class at first (ener <– skeered) but it was fun and i met nice people

    so look in that search, i think it’s NMC (?) that offers loads of classes. you’ll see when you search that there is a big group that holds many classes

    you can learn everything from making shoes to skyscrapers

    this was a great comment you left, so great that i am gonna take my comment to make a blog post! thanks! =)

    iliveisl

    24 Nov 09 at 8:41 am

  3. [...] add to that the fact that your sit position on a prim is not the same, so you can’t just toss out a ball and have someone sit on it when touched – you have to add a real sit script to it! (past post: Simple Sit Script: deconstructed) [...]

leave a reply - add your thoughts

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>