Search:


Follow Us On:

Wyvern-Scripted Tail

See Also:

Wyvern Scripted Tails

RB Wyvern Scripted Tail RB Wyvern Animated Tail

Introduction

Starting with version 1.5, the Roarbeast Wyvern avatar included the option of tails that were driven by scripted motion rather than just animating rigged mesh. The benefit of this is that users who desire additional customization may do so within Second Life without having to resort to using 3D modeling tools.

Modding Features

The scripted tail's primary advantages include its scalable prims, customizable segment count, follower prim parenting, and most significantly the script controlled motion options. Each of these will be discussed in their own section below.

Visible Tail Segments

Disadvantages

The natural disadvantages of a scripted tail are that it cannot look as smooth as a rigged mesh tail, since it is made up of segments. Also, it consumes more resources than a rigged mesh tail since it has to do math and update the position of several objects every frame.

The constructed disadvantages of the scripted tail are that the link order is important: if you add or remove prims, you must verify that the link order is proper or it will misbehave. This is an optimization trick. Also, all prims must be the same length, which is determined by the root prim's size. If they are different lengths, they will be treated the same length.


Scalable Prims

The scripted tail can be increased or decreased in size. The object must be scaled as a whole, but this allows it to be put on larger or smaller avatars.

Everything about rescaling is automatic, and the script should adjust to the tail's new size in real time.

Note that there is a maximum size for a linkset and scaling the tail too high may result in some segments being unable to move outside of that range.


Customizable Segment Count

The tail can support up to 31 prims. This allows you to have a very long tail by adding prims, or a very short tail by removing them.

Technically you can add more than 31 prims as long as you are not using the parenting feature, but any attempts to use the parenting feature would result in the parented prims beyond position 31 in the linkset sticking to the root object.


Follower Prim Parenting

You may have noticed that the stock scripted tails have a fin or straight segment on the end which is longer than all of the other prims. These two prims are using the "parenting" feature. Since they do not match up in length with the other prims, they would be centered in the wrong spot normally. But they are actually following an invisible prim below them.

This parenting behavior can be used to add fins or spikes or other decorations without actually creating new segments, or pushing them off-center.

How To Parent

The name of the prim determines if it is a parent or not. The format of the prim's name is: 1;<relative position offset>;<rotation offset>

The number 1 is used as an identifier. The relative position offset is the position distance between the parent prim and the follower prim divided by the size of the rot prim. The rotation offset is the rotation of the follower divided by the parent's rotation.

With the prim as the root prim and the custom prim as a child prim, inserting the following script into the child prim should spit out the line of text to put into the custom prim's name:

 default {
   state_entry() {
     llSay(0, "1;"+
      (string)llGetLocalPos()+";"+
      (string)llGetLocalRot());
   }
 }

The link order determines to what segment it is parented. Any prim in the linkset subsequent to a segment and marked as a parent will follow that segment.

Since the layout of the prims doesn't mater, it may be best to unlink everything and lay it out in a way you can work with. Then link them by clicking backwards from the last prim in the linkset to the first prim in the linkset. The first prim is always the invisible root prim.

Note: Added prims will be subject to the livery system. If you do not want their colors and textures changed, put ":00" in the description.

Script Controlled Motion

Definition

There are 10 basic components to the scripted motion.

  • X Axis Data
    • X Spacing Interval
    • X Starting Offset
    • X Curve Distance
  • Y Axis Data
    • Y Spacing Interval
    • Y Starting Offset
    • Y Curve Distance
  • Z Axis Data
    • Z Spacing Interval
    • Z Starting Offset
    • Z Curve Distance
  • Rotation Multiplier

The spacing interval determines how far the tail moves in a single action. A larger value results in faster movement.

The starting offset is primarily useful for modifying synchronization or for having the tail stick in a position along an axis. That is, if you have the spacing interval set to zero (so the tail does not move), and the max distance set high, setting an offset will bend the tail on that axis but not continue to move it. Also, if you have two axes set for the same spacing intervals, they will sync up their motions. If you want them to sync up differently, setting an offset on one will change where they start on their looping motion.

The max distance value determines how far the tail will move. A higher value results in the tail moving to a further position.

The rotation multiplier determines how much additional curve the tail will take. A value of zero means the base of the tail will move, but no other segments will rotate. A value of 1 causes all segments to rotate the same value. Anything higher than one adds additional curvature to each additional segment of the tail causing it to quickly curl.

Single Commands

The tail will accept commands to change a single property. This only works for basic wag commands.

This is done by sending a command line follows:

/99876 scriptwagshort ID|VALUE

Note that the ID and Value are separated the pipe character.

The ID and value may be taken from the table below.

IDTO CHANGEMIN/MAX VALUESANE VALUE
1X Spacing Interval0.0 (stopped) - TWO_PI (full circle)0.0-1.0
2X Starting Offset0.0 (none) - TWO_PI (full circle)Any
3X Curve Distance0.0 (straight) - TWO_PI (full circle)0.0-0.5
4Y Spacing Interval0.0 (stopped) - TWO_PI (full circle)0.0-1.0
5Y Starting Offset0.0 (none) - TWO_PI (full circle)Any
6Y Curve Distance0.0 (straight) - TWO_PI (full circle)0.0-0.5
7Z Spacing Interval0.0 (stopped) - TWO_PI (full circle)0.0-1.0
8Z Starting Offset0.0 (none) - TWO_PI (full circle)Any
9Z Curve Distance0.0 (straight) - TWO_PI (full circle)0.0-0.5
10Rotation Multiplier0.0 (straight) - Infinity)0.0-2.0

Examples:

  • /99876 scriptwagshort 3|0.1 - Changes the X-axis curve distance value to 0.1.
  • /99876 scriptwagshort 10|0.4 - Changes the rotation multiplier to 0.4.

Full Command

The scripted tail accepts a full string command that sets all values at once. This allows you to change all settings for the tail on specific commands, such as a script trigger, or via gesture.

For a full command, three extra values are required before the tail data. These are:

  • Type of action (wagging is 1)
  • Seconds to take this action.
    • 0.0 is used to mean "forever."
    • Any value greater will stop after the given number of seconds.
  • Joint or prim number
    • The values start at 1.

A full command to make the tail stay still and centered looks like this:

/99876 scriptwag 1|0.0|1|0.0|0.0|0.0|0.0|0.0|0.0|0.0|0.0|0.0|0.0

Note that the IDs aren't needed, as all must be present, and the order is assumed to be the same as the IDs counting up.

Special Commands

Move to Destination

If the value 2 is sent with a full command you send a "move to destination" command. This is useful for docking the tail in a specific location, such as when you are sitting down. In this case, the starting offset becomes very useful, as you'll want to control the position exactly.

The time in seconds value is how long it will take to move the tail to that new position.

Pause/Wait

If the value 3 is sent, it's only necessary to second the seconds value for how long to wait before performing another action.

Multiple Wag Curves

After putting together a complete wag command, you can start over again by including another number, which is the prim number, followed by the X, Y, Z and multiplier values. This will cause the tail to curve according to the second command starting at that other prim.

Multiple Commands

It is possible to chain commands. Eg, set a destination, a wait, another destination, and a wait. This is particularly useful for complex gestures, emotes, or animations.

Edit - Upload - Edit Sidebar
Page last modified on July 26, 2016, at 10:24 PM