Wednesday, July 23, 2008

Get your lineSegment! Make drawings using S4SL!


You may have noticed at the end of the S4SL video, I show the bug creating a colorful stairway (shown on the right). Or maybe you've tried to use the "pen" blocks and can't get them to work. The secret is having a special object called lineSegment (more info on acquiring one is at the end of this post)

Basically, the pen blocks allow you to make your object leave a trail behind it as it moves. In this way you can make 3D drawings and sculptures using S4SL. Just drag the lineSegment object into the inventory of your object. Now if you put the "pen down" block in your script, any time after that when you use a "move" block, it will leave a trail.

Here's a simple example you can try out- when you say "square," it draws a square in a random color. Type "clear" to clean up the lines (the "clear" block does not work in alpha v0.1 due to a bug- instead you need to use "broadcast clear").



For the code for the stairs example shown above, you can look in the "pet bug" project that comes with S4SL.

Getting a lineSegment

It appears that our in-world locations for picking up a line segment are now gone, so I'm going to provide instructions for advanced users to create their own versions of it, and hopefully provide them to others. Basically, it is a small cube-shaped prim with some LSL in it. To make one:
  1. create a cube shaped prim, 0.1m on all sides
  2. color it white
  3. grab the LSL code for it from here
  4. create a new script and paste in that code
  5. test it using the methods described above
  6. set permissions so other users can take a copy
  7. leave it somewhere, and provide a SLURL here
Good luck! Also, since you read this far, here is a sneaky little tip. The special code in lineSegment enables the line segments that are left behind to be resized to the correct length and colored according to the code in the parent object programmed wih S4SL... if you don't care about the resizing and coloring, you can just put any object into the inventory of your S4SL-programmed creation, name it lineSegment, and it will get rezzed as it moves (just use the pen down block first). Just be careful not to clutter everything up with rezzing... Enjoy!

34 comments:

Fim Fischer said...

Thank you to Dagnir Korolev.

I just picked up the line and provide it here:

http://slurl.com/secondlife/Merx/245/98/23

Regards,

Fim Fischer

Yohane Rockett said...

Hello,

great tool! Ty for that :D

Anonymous said...

This is awesome .. your a saint !

Unknown said...

Are you still working on this?

ericrosenbaum said...

hi teresa- I am currently focusing on other projects, but I have a lot of ideas for this (and I've gotten lots of ideas and feedback on this blog!) and I hope to make an updated version. Most likely it won't happen until december or january, though.

Anonymous said...

Hello,

I am in teen second life, so of course I can not get to the area. I was wondering if there are any scripts needed or anything so i could possibly create the LineSegment.

Anonymous said...

Thanks for the e-mail eric.

(yes i know i replied kind of late)
lol

Anonymous said...

Hey everybody.
I have the LineSegment in Teen Second Life so if anybody needs it please send a messege to Skywalker Northolt!

ericrosenbaum said...

thanks skywalker!

Dominic said...

hello, just wondering if this project is still alive?

ericrosenbaum said...

hi dominic- I still keep an eye on it, but I don't have plans for the near future to release an updated version. I'd love to release the source code so others could work on it, but I don't have an easy way to do that right now, unfortunately. There are some developments on the horizon that may open up some new possibilities, though. The scratch team is considering making a new version of the scratch blocks to make it easier to create things like S4SL. Also, I have heard from some linden lab folks that they will soon(ish) have better ways to support 3rd party applications like S4SL through APIs... those two things could make some really cool things possible, but not right away.

Dominic said...

ooh exciting!

thanks for the reply

Unknown said...

Hi, I had downloaded Scratch to my PC and my PC crashed. I would like to download it to my new PC but I can no longer find the link to download. Would you please point me in the right direction?

Thanks in advance.

ericrosenbaum said...

hi Julie- here's the link: http://web.mit.edu/~eric_r/Public/S4SL/

Unknown said...

Thanks so much Eric! I really appreciate it.

Unknown said...

Eric, I should have been specific. I was looking for Scratch for Second Life. Thanks in advance.

ericrosenbaum said...

did you try the link I just posted? that's a link to the home page for scratch for second life.

Unknown said...

Yes, I have it now. I am a typical "dumb" user and didn't look at the page in it's entirety. Thanks again Eric.

Kip Yellowjacket said...

Fantastic tool! I've also placed it on the Second Life English (Virtlantis) SIM. You can find it here: http://slurl.com/secondlife/VIRTLANTIS/241/118/21

Zenitixx said...

why no news please ?

James Corbett said...

Hi Eric, I was totally thrilled to come across the project lately when our primary school students wanted to take their virtual world (based on Opensim) to the next level by adding interactivity to their in-world objects. I downloaded Scratch4SL and within a few minutes had scripted a revolving door. Something I could have taken weeks to learn how to do in LSL.

Can you tell give me an update on the status of the project? Or tell me if there are similar alternatives for visual programming in Second Life / Opensim?

Anonymous said...

what a great tool! has the project been put on hold or is it still up and running? Add some particle and Texture functions to this and SL residents across the Grid would sing your Praises from the mountain tops!

TheAlpha31 said...

First of all, Im Skywalker.

A while ago, December, Eric sent me this email when I asked him about a new version being released:

"A new version coming out, unfortunately it does not seem likely
anymore. My work has taken a different direction, so I am focused on
other things. There are some other projects doing similar things, to
make it easier for people to program in second life without knowing
LSL, and I hope that those become more useful to people (but I haven't
kept up on the latest news of those). Anyway sorry about that!

Eric"

Stefano said...

I couldn't find the block box to get the line, neither at http://slurl.com/secondlife/TechInvestLab/48/172/31 nor at http://slurl.com/secondlife/Merx/245/98/23... where is it??!

ericrosenbaum said...

Hi Stefano- sorry to hear the line segment is gone! that's too bad. I'll modify the blog post with instructions for creating your own...

Unknown said...

Yay~ First dabble with scripting has left me with a window that goes to 0% transparency... But not back up...

jon said...

need help somethink not right lol contact me my name in sl is Jon Reichmann thanks :) doing a great job with the scripts they helping alot

Anonymous said...

need help contact Jon Reichmann tomoz thanks good job

jon said...

need help my name is Jon Reichmann thanks

jon said...

need help my name is Jon Reichmann thanks

Anonymous said...

need linesegment... drop me a line inworld (im get capped) leave a Notecard....
Cyborg Renfold

good said...
This comment has been removed by a blog administrator.
baihua said...
This comment has been removed by a blog administrator.
wangqian said...
This comment has been removed by a blog administrator.