Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

default events in avatar motion (walk)

Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
05-24-2008 04:13
Hi, Does an event fire when an avatar makes a default motion. I am specifically thinking of the respons to arrow-key press.
An avatar will make a walk-motion, displaying either the default animation or the one set in an AO on the avatar -But..
Does this 'do-a-walk-step' make an -event- that can be registrated?
If there is a set of 'events' that are registratable for user keyboard interaction, i would apreciate a link -I have -NO- idea what to search for.
Tyia
ab
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
05-24-2008 04:31
This is an area that will make your brain hurt :/

There is no event to say that such-and-such animation was triggered.

You can use llTakeControls() to detect navigation keys, but the responses can be a little lazy, especially on key releases. It's missing the fly control so you need to track that separately. And it won't really pick up if you hop onto a sit target.

moving_start and moving_end events look like they might do some good, but they miss when an avatar is turning in place, crouching in place, and don't even reliably detect when an avatar is actually moving or stopped.

Ok, so then there is llGetAgentinfo(), that looks promising, right? It's sort of okay, but misses some details. It can't tell you if an avatar is running downhill (just in walking mode, it does have a flag for always run mode), and won't tell you if an avatar is both crouching and walking.

Polling llGetAnimationList() can work, sort of, but the problem is that it does return a list of animations. If more than one you care about comes in, you're on your own to decide which one is more important in context, plus you have to grind through that list on every poll.

..and that's why the usual tactic is to poll llGetAnimation(). It doesn't include everything but covers the major states in a reasonable way. If you want to catch some of the others, a secondary poll of llGetAnimationList() or llGetAgentinfo() can work, to pick up the stragglers like the brush, talk and typing stuff.
_____________________
Abraxes Binder
Registered User
Join date: 23 May 2008
Posts: 205
05-25-2008 00:45
Viktoria, Thank you for this explanation :)
BR ab