Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Using Easy AO for Halloween Avatar

ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
10-18-2007 10:14
I made an avatar costume for halloween, I would like to use the "suitcase" animation to hide the avatar body rolled up inside of the avatar costume. I thought I understood how to do this using the Easy AO script that is available. I replaced all the animation names in the script below. I put the Easy AO script and "suitcase" animation in the avatar costume.

It works briefly when I wear the avatar costume, but the "suitcase" animation stops playing and my avatar reverts to the default SL animations as soon as I walk, fly or move. Resetting the script makes the suitcase animation active again, until the next time I move, then it turns off.

What have I done wrong in this script? The only change I made was putting "suitcase" in for all of the list anims.

CODE

// KDC's shortest Aniamtion overrider in SL
// Copyright (C) 2005 Kyrah Abattoir
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

//there we go...
float pulse = 0.03;//the time between each check, adjust it to your liking
//bigger == slower == low resources

//if a state isnt in the list its just ignored, you can add new overriding states here
list states = ["Standing","Walking","Hovering","Running","Sitting","Sitting on Ground",
"Flying","FlyingSlow","Falling Down","Standing Up","Hovering Up"];

//list of ther anims yo will use instead if the value == pass on, we let the anim play. One anim per state
list anims = ["suitcase","suitcase","suitcase","suitcase","suitcase","suitcase","suitcase","suitcase","suitcase","suitcase","suitcase"];

string anim_overrided= "";
string curr_anim= "";
vector pos;
float gravity = 9.8; // gravity constant

default
{
attach(key id)
{
if(id == NULL_KEY && curr_anim != "")//IF detached and an animation is running
llStopAnimation(curr_anim);//stop the anim
else
llResetScript();
}
state_entry()
{
llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);//we ask for permissions
}
run_time_permissions(integer perms)
{
llSetTimerEvent(pulse);//we set the main pulse
}
timer()
{
string anim_state = llGetAnimation(llGetPermissionsKey());
if(anim_state == "Turning Left" || anim_state == "Turning Right")
anim_state = "Standing";
integer anim_index = llListFindList(states,[anim_state]);
if((anim_index != -1) && (anim_overrided != anim_state))//IF we havent specified this anim must be ignored
{
anim_overrided = anim_state;
//llSetText("",<1,1,1>,1.0);//DEBUG displaying the state
if(llList2String(anims,anim_index) == "PASS_ON")
{
if(curr_anim != "")
llStopAnimation(curr_anim);
curr_anim = "";
}
else
{
string stop_anim = curr_anim;
curr_anim = llList2String(anims,anim_index);
if(stop_anim != "")
llStopAnimation(stop_anim);
if(curr_anim != stop_anim && curr_anim != "")//if its the same anim we already play no need to change it
llStartAnimation(curr_anim);
if(anim_state == "Walking")//another lil hack so the av turn itself 180 when walking backward
llStopAnimation("walk");//comment these 2 lines if you have a real backward animation
}
}
}
}

CODE
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
Johan Durant
Registered User
Join date: 7 Aug 2006
Posts: 1,657
10-18-2007 10:55
An AO is overkill if the idea is to simply have 1 static pose apply forever while the character is wearing the object. A much simpler script (adapted from above mostly by deleting extraneous stuff) could just play an animation when the object attaches, and stop the animation when the object detaches.
_____________________
(Aelin 184,194,22)

The Motion Merchant - an animation store specializing in two-person interactions
Crystal Falcon
Registered Silly User
Join date: 9 Aug 2006
Posts: 631
10-18-2007 12:20
Um, since you ask in the animation forum, is the animation looping? From what you describe, could it simply be playing and ending properly? ;) If so, it needs to be uploaded with looping checked on!
_____________________
TP to Crystal's Facets in world:
http://slurl.com/secondlife/Kress/120/5/146/

Shop my natural AO poses, clothing, tools with XStreet:
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
10-18-2007 14:49
From: Johan Durant
An AO is overkill if the idea is to simply have 1 static pose apply forever while the character is wearing the object. A much simpler script (adapted from above mostly by deleting extraneous stuff) could just play an animation when the object attaches, and stop the animation when the object detaches.


That makes sense, I'm not sure if I have the scripting knowledge to do that, but I will take a look at the Scripting wiki and see if I can figure it out. Any tips would be appreciated.


From: Crystal Falcon
Um, since you ask in the animation forum, is the animation looping? From what you describe, could it simply be playing and ending properly? If so, it needs to be uploaded with looping checked on!


Ummmm, when I play the animation manually in world, it remains in effect until I turn it off, even if I walk or fly around. It is a readily available free animation or perhaps static pose is a better description. I really have not done any work with animations before. I'm just a dumb architect :) I guess I may have to learn more about making animations then I expected to make this work.
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo
ArchTx Edo
Mystic/Artist/Architect
Join date: 13 Feb 2005
Posts: 1,993
10-19-2007 09:21
I found a script in the scripting forums that appears to do what I need. I'm going to go give it a try.


/54/f5/171591/1.html

UPDATE: I tested this script out and it works well.
_____________________

VRchitecture Model Homes at http://slurl.com/secondlife/Shona/60/220/30
http://www.slexchange.com/modules.php?name=Marketplace&MerchantID=2240
http://shop.onrez.com/Archtx_Edo