Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Default Animation hpAnimation2String()

Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
06-28-2005 19:01
I am building hpAnimation2String() as an open source function, since there is no llGetAnimationList -> string function.

I could use your help to finish this. Please add any animations that I've missed

syntax:

string hpAnimation2String(key anim);

input:
key of an animation

output:
If key is a default animation, the string of the name of that animation,
else, return "".

how:
I'm creating a simple list of default animations and keys, sorting them, then hard coding the translator. I'll search using binary search, to opimize it to a few comparisons instead of a few dozen.

preliminary list:
This is unsorted, and unformatted. Please respond in thread with more that you find.
This is just rough, since I am short on time tonight. I'll post the actual translation script later.

GetAnimationLIst2String: 0:Standing:2408fe9e-df1d-1d7d-f4ff-1384fa7b350f
GetAnimationLIst2String: 1:Turning Right:2d6daa51-3192-6794-8e2e-a15f8338ec30
GetAnimationLIst2String: 2:Turning Left:56e0ba0d-4a9f-7f27-6117-32f2ebbf6135
GetAnimationLIst2String: 3:Crouching:201f3fdf-cb1f-dbec-201f-7333e328ae7c
GetAnimationLIst2String: 4:CrouchWalking:47f5f6fb-22e5-ae44-f871-73aaaf4a6022
GetAnimationLIst2String: 5:PreJumping:7a4e87fe-de39-6fcb-6223-024b00893244
GetAnimationLIst2String: 6:Jumping:2305bd75-1ca9-b03b-1faa-b176b8a8c49e
GetAnimationLIst2String: 7:Hovering Up:62c5de58-cb33-5743-3d07-9e4cd4352864
GetAnimationLIst2String: 8:Hovering:4ae8016b-31b9-03bb-c401-b1ea941db41d
GetAnimationLIst2String: 9:Hovering Down:20f063ea-8306-2562-0b07-5c853b37b31e
GetAnimationLIst2String: 10:Landing:7a17b059-12b2-41b1-570a-186368b6aa6f
GetAnimationLIst2String: 11:Falling Down:666307d9-a860-572d-6fd4-c3ab8865c094
GetAnimationLIst2String: 12:Standing Up:3da1d753-028a-5446-24f3-9c9b856d9422
GetAnimationLIst2String: 13:Walking:349a3801-54f9-bf2c-3bd0-1ac89772af01
GetAnimationLIst2String: 14:Running:05ddbff8-aaa9-92a1-2b74-8fe77a29b445
GetAnimationLIst2String: 15:Sitting:1a5fe8ac-a804-8a5d-7cbd-56bd83184568
GetAnimationLIst2String: 16:Striding:1cb562b0-ba21-2202-efb3-30f82cdf9595

pre-script:
This code collects animations and keys. Please respond to this thread with your own that I've missed.
WARNING: DO NOT LEAVE THIS OUT REZZED WHEN NOT IN USE AS IT HAS A 0.1s TIMER!

CODE
list anims = [];
list keys = [];

list current;
string cur;
integer c;
integer d;

default
{
on_rez(integer p)
{
llOwnerSay("Animation Collector started. PLEASE DO NOT LEAVE THIS OUT REZZED - This script has a 0.1s timer!");
llSetTimerEvent(0.1);
}

timer()
{
current = [];
current = llGetAnimationList(llGetOwner());
cur = llGetAnimation(llGetOwner());
//llOwnerSay("DEBUG:"+cur+":"+llList2String(current,0));
for(c=0;c<llGetListLength(keys);++c)
{
if(cur == llList2String(anims,c))
{
return;
}
}
llOwnerSay("Anim found! "+cur+":"+llList2String(current,0));
anims += cur;
keys += llList2String(current,0);

}

touch(integer n)
{
if(llDetectedKey(0) == llGetOwner())
{
llOwnerSay("Outputting list of animations and keys:");
for(d=0;d<llGetListLength(keys);++d)
{
llOwnerSay( (string)d +":"+ llList2String(anims,d) +":"+ llList2String(keys,d));
}
}
}
}
_____________________
Hiro Pendragon
------------------
http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio

Visit my SL blog: http://secondtense.blogspot.com
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
07-04-2005 08:41
/54/95/52526/1.html
_____________________
i've got nothing. ;)
Champie Jack
Registered User
Join date: 6 Dec 2003
Posts: 1,156
07-08-2005 09:40
I was under the impression that animation keys are no longer used in scripts.

Is this correct? If so, what use is it to collect animation keys?
_____________________