Allow * to mean all poses, and -1 to mean all sitters (#34)
* Allow "*" as pose name to mean all poses. Suggested by Natsagan in the Unofficial AVsitter group. * Allow -1 to mean all sitters. Suggested by Natsagan in the Unofficial AVsitter group. * Add caveat on the use of -1 for all sitters.
This commit is contained in:
parent
dc8b6c8386
commit
0ed4903ada
1 changed files with 14 additions and 3 deletions
|
@ -17,7 +17,10 @@
|
||||||
// Inspiration and function (not code) from the Bright CISS system by Shan Bright & Innula Zenovka.
|
// Inspiration and function (not code) from the Bright CISS system by Shan Bright & Innula Zenovka.
|
||||||
|
|
||||||
// SITTER:
|
// SITTER:
|
||||||
// The AVsitter SITTER # the cuff settings are for.
|
// The AVsitter SITTER # the chain settings are for.
|
||||||
|
// -> You can use -1 to mean all sitters, but that will mean that the very same
|
||||||
|
// chain settings and pose list will be applied to all at the same time. If
|
||||||
|
// you don't want that, then you need to add one script per sitter.
|
||||||
|
|
||||||
integer SITTER = 0;
|
integer SITTER = 0;
|
||||||
|
|
||||||
|
@ -47,6 +50,7 @@ integer USES_PROPS = FALSE;
|
||||||
// for a list of LockGuard V2 Standard ID Tags and more information. The LockGuard package
|
// for a list of LockGuard V2 Standard ID Tags and more information. The LockGuard package
|
||||||
// (with full instructions for the protocol) can be obtained in-world from Lillani Lowell's
|
// (with full instructions for the protocol) can be obtained in-world from Lillani Lowell's
|
||||||
// inworld location.
|
// inworld location.
|
||||||
|
// - A pose name of "*" provides a default for all poses, should that be necessary.
|
||||||
|
|
||||||
list POSES = [
|
list POSES = [
|
||||||
"Pose1", "leftwrist,ring1,rightwrist,ring2,leftankle,ring3,rightankle,ring4",
|
"Pose1", "leftwrist,ring1,rightwrist,ring2,leftankle,ring3,rightankle,ring4",
|
||||||
|
@ -72,6 +76,7 @@ integer comm_handle;
|
||||||
key avatar;
|
key avatar;
|
||||||
list links;
|
list links;
|
||||||
list ring_prims;
|
list ring_prims;
|
||||||
|
integer all_poses = -2; // cache the position of the "*" if it exists, for performance
|
||||||
|
|
||||||
goChain(list new_links)
|
goChain(list new_links)
|
||||||
{
|
{
|
||||||
|
@ -128,7 +133,7 @@ default
|
||||||
{
|
{
|
||||||
list data = llParseStringKeepNulls(msg, ["|"], []);
|
list data = llParseStringKeepNulls(msg, ["|"], []);
|
||||||
integer SITTER_NUMBER = (integer)llList2String(data, 1);
|
integer SITTER_NUMBER = (integer)llList2String(data, 1);
|
||||||
if (SITTER_NUMBER == SITTER)
|
if (SITTER_NUMBER == SITTER || !~SITTER)
|
||||||
{
|
{
|
||||||
avatar = id;
|
avatar = id;
|
||||||
string EVENT = llList2String(data, 0);
|
string EVENT = llList2String(data, 0);
|
||||||
|
@ -157,7 +162,7 @@ default
|
||||||
{//animation played
|
{//animation played
|
||||||
list data = llParseString2List(msg, ["|"], []);
|
list data = llParseString2List(msg, ["|"], []);
|
||||||
string SITTER_NUMBER = llList2String(data, 0);
|
string SITTER_NUMBER = llList2String(data, 0);
|
||||||
if ((integer)SITTER_NUMBER == SITTER)
|
if ((integer)SITTER_NUMBER == SITTER || !~SITTER)
|
||||||
{
|
{
|
||||||
if (id != avatar)
|
if (id != avatar)
|
||||||
{
|
{
|
||||||
|
@ -169,6 +174,12 @@ default
|
||||||
list new_links;
|
list new_links;
|
||||||
|
|
||||||
integer pose_index = llListFindList(POSES, [POSE_NAME]);
|
integer pose_index = llListFindList(POSES, [POSE_NAME]);
|
||||||
|
if (!~pose_index)
|
||||||
|
{
|
||||||
|
if (all_poses == -2)
|
||||||
|
all_poses = llListFindList(POSES, (list)"*");
|
||||||
|
pose_index = all_poses;
|
||||||
|
}
|
||||||
if (~pose_index)
|
if (~pose_index)
|
||||||
{
|
{
|
||||||
new_links = llCSV2List(llList2String(POSES, pose_index + 1));
|
new_links = llCSV2List(llList2String(POSES, pose_index + 1));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue