"Ten percent of nuthin' is...let me do the math here...nuthin' into nuthin'...carry the nuthin'..." -Jayne
OK, lame to quote it but if you read my blog you know I'm a sci-fi geek (I refuse to say fanboy about myself though others have used the word pointedly and often.) so I had to get a quote from the show. This is the first time I've gone through step by step to show you how to modify a script from the lslwiki to get the result you want. And to be completely honest, it's a ton of experimentation. If you enjoy it you'll spend hours at it, if you hate it, you'll never touch it again, but knowing the concepts will help you understand part of the way SecondLife makes things interactive. Scripting is also one of the most lucrative jobs you can have in SecondLife. People charge alot more for it then generally any other profession.
The script in it's entirety can be found here. However you don't need to see the whole thing to see the part to mess with to create your own versions of fireflys and bling and little blinking annoying come here and see effects. The important part of the script to modify is right at the top.
There are several factors that let you turn those boring explosive things that come out of this script into fireflies. Let's start at the top....
Anything that has a // in front of it in an LSL script is a comment, it does nothing in the script itself and Secondlife compilers ignore it. But it tells you alot about what the line before it does if the scripter is kind and generous.
The first section is all about how the particles are going to behave in general. A 1 means that it will do something and a 0 means it wont. So the first thing to change in the script as it's written is that we want our fireflies to not change size. So we're going to set the integer interpSize to zero so that the code won't do that. We can also decide if we don't want them to pay attention to wind. After all they are motorized aren't they, who cares about wind?
The next part that makes your particles really unique is lower down under particle parameters.
Float age is the life your particle will have in seconds. Fireflies don't live a long time so I have this set to 3 seconds. The problem with saying lots of time is that particles are constantly moving, so it's hard to have long lived particles, and it increases lag. You'll find one of the ways to make your particles move farther is to increase their life. You will have to do that stuff I talked about up top and experiment.
The other really valuable part here, for beginning particle effects is the startColor and endColor. I like my fireflys whitish yellow and as they die fading a bit more golden. So you have to figure out what color you want, find the RGB value of it and put it in, then tweak it as you see what happens. So now you're asking how to find the RGB value of a color. That's a good question. The easiest way I've found to figure out RGB is to use another script, this one requires no modification at all. You build a box, put the script in, then change the color of the box to what you want and the box will tell you what the RGB value is, it uses the building tools in SecondLife, it's free and it works, all things I love. You can get that here.
So once you've done all that, you test it.... and test it... and test it.
Eventually you'll come up with a close approximation of Mal's ship. Wait.....
Scripting is a headache because of this thing. It's why if you know someone who loves it you should be very very nice to them. I know this dosen't read that well without code examples and I'm going to get blasted from the technical side for not being technical enough and the un-technical side saying "Huh?" But the real point of this article is the progression of people and how they got to be where they are, this is how I did it. I encourage you to find your own road....
Tuesday, January 29, 2008
Fireflies, Particles, Geek references and more....
Posted by Noelyci at 10:00 PM
Labels: Building Techniques, IDG, Outdoors
Add Post To: | Digg| Technorati| del.icio.us| Stumbleupon| Reddit| BlinkList| Furl| Spurl| Yahoo| Simpy|
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment