Tuesday, August 7, 2007

Ring scripts, part one - introduction and explanation

This is the basis for the ring script I'm using. The one I use for my own items has a little more flexibility (yay!), but less efficiency (boo!). However, this is at least a) a starting point for people wanting to add the flexibility in perhaps more elegant ways than I have, because I code like an epileptic monkey with a large wrench that I beat things with regularly and often, and b) something that actually does work, and even without the extra bits I added is perfectly serviceable.

What this does in brief: it guesses the hand position it thinks you will have, in fairly often intervals. It uses the same basic functionality for this that Franimation Overriders use, and detects animations currently playing. Instead of overriding the current animation with a custom one, it assigns hand values to animations and adjusts the item you are wearing accordingly. It does not work as is with custom overrides or any other poses that override the hands. Part of the ugly hack in the version I use is to allow people to add their own UUIDs without delving into the code proper. Once the animations are detected, it then runs the proper function for that state, which includes position and rotation data for the item- or, indeed, whatever you desire it to do at a changed hand state.

Even built in animations do not always work properly because SL has some rather nasty hand position glitches, with priority for hands right now being an utter mess.

The code itself follows in the next few posts. Copy the entire body of the post into a script file, and drop that script file into your ring.

No comments: