Friday, July 30, 2010

Wrestling With Scripts

Chey, Busy Scripting

Written 30 July, 2010

Wrestling With Scripts

I've been holed up for the past few weeks on a secret project that has involved a LOT of scripting. As usual, I'm in uncharted territory, working out of my depth, trying to figure out what the hell I'm doing.

Rotations give me conniptions, of course, but apparently they give EVERYBODY headaches.

Soo, here's what I've learned in a couple of weeks:

How to do linked messages. Linked messages are a way for scripts to communicate with one another in a linked set of prims. They're more efficient than listens. I knew how before, but I wasn't quite sure about the different ways the commands could be structured. Now I know I can have a script send a message to the prim it's in, to the root prim, to all child prims, or to all prims in the set.

How to calculate altitude. I made a working digital altimeter, good to +/- 9999 meters. I decided not to go with the fifth digit, because who will be going so high, or so low?

I'm working on an analog altimeter now. I just spent HOURS in GIMP and Quark XPress making an altimeter face, and it looks pretty good. Because rotations make me want to tear my hair out, I'm cannibalizing a free clock script that turns the minute and hour hands by linkmessage. I took out the clockworks, leaving in the function that turns the hand, and am working on telling it how far to turn the hands. I was experimenting earlier, and nothing was working. Then I realized that a clock face has twelve positions-- an altimeter has just ten. So probably some of my machinations worked; they just didn't look right on the clock face. Now I have the proper face up and am looking for the correct rotations by trial and error.

I learned how to set permissions on a vehicle-- the hard way. I learned how to use scripts to reset other scripts or set them to running or not running. I learned how to monitor sim crossings. I learned how to determine when one or more avatars are sitting on a linkset. I put into application changes in prim size with llSetPrimitiveParams(). I learned how to divide the face of a single prim into dozens of clickable buttons. And I learned how to teleport a vehicle along with a sitting avatar with warpPos.

My head is spinning, but I now have a craft that is almost ready for its debut.

Chey Pitches a Fit at Code That Won't Compile

No comments: