Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Animation Override enhancement help - is it possible to have more than 5 stands?

Aestival Cohen
half pint half drunk up
Join date: 2 Sep 2004
Posts: 311
03-25-2005 09:47
Or one sit? I asked about this in the products wanted section but I figured folks here would be able to tell me if I'm dreaming.

I got bold with a script the other day and actually made something work so I was thinking of trying to cobble this into Francis' script but it looks pretty daunting... wanted to know if it was hopeless before i set out to make a mess! ^_^;;
_____________________
=^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^=
Luverly FLICKR photos!
=^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^= =^.^=
Kali Dougall
Purple and Spikey
Join date: 5 Feb 2005
Posts: 98
03-25-2005 10:19
I haven't done much with animation overrides because of the lag issue, but there's no reason multiple sits/stands shouldn't be possible. I'll pick sit as an example.

CODE

integer sitting = FALSE;

list sitting_anims = ["my_sit1", "my_sit2"];
string current_anim;

integer is_sitting() {
return llGetAnimation(llGetOwner()) == "Sitting";
}

default {
state_entry() {
llSetTimerEvent(0.1);
}

timer() {
if (!sitting && is_sitting()) {
sitting = TRUE;
llStopAnimation("sit");
current_anim = llList2String(llListRandomize(sitting_anims, 1), 0);
llStartAnimation(current_anim);
} else if (sitting && !is_sitting()) {
sitting = FALSE;
llStopAnimation(current_anim);
}
}
}

Untested and probably unsuitable as a final version, but it should give you the basic idea. Also be aware that checking your current animation as fast as the server will possibly allow causes some drop in sim FPS. I set this interval to a tenth of a second, which should be frequent enough.
Francis Chang
Registered User
Join date: 23 Mar 2005
Posts: 2
03-25-2005 19:58
Aestival, it's GPL, you should definately have a go at modifying it. There's no technical reason why it's impossible. The only reason it's limited to 5 is because of backwards compatability. It's been a long while since I looked at that code, but I betcha it'd require less than 5 lines of change.

Adding multiple sits might be another 10 lines.

Many people have asked me for something like this, and I've said that it would only require a little bit of script hacking. I think that lotsa folks would welcome your modification.

Kali, there have been some performance analysis done on my Franimation Overrider script. Like yours, it also works by polling for animation changes. There was a thread a while ago where I reported my results. Long story short, no measurable performance decrease.