Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Detecting when changing Flight Status

Ari Storaro
Registered User
Join date: 5 Jan 2007
Posts: 2
06-02-2008 18:04
I'm working on a jetpack attachment and I want a low-lag way to check whether or not the avatar changes from flying to not flying or vice versa. Now, I know how to check whether the avatar is flying versus not flying using llGetAgentInfo(). However, what I need is a way to call this function without having to resort to a timer that constantly checks the value. Ideally it would only be called when the state changes, but I know there isn't an event to handle that, at least as far as I can see. If anyone has an answer to this, or an idea, feel free to post here, or even better message me in world with your thoughts. Thanks in advance.

Ari Storaro
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
06-02-2008 18:11
I don't think there's much choice other than the timer, but you could maybe stop the timer on land_collision_start and start it again on land_collision_end. That's not perfect though because you CAN actually be in the flying state while touching the ground.
Ari Storaro
Registered User
Join date: 5 Jan 2007
Posts: 2
06-02-2008 18:19
I was thinking about using moving start and moving end to call it. But I'm wondering whether that would work if the avatar is running or walking and then engages in flight while still moving. But perhaps a combination of things could work...and still be less laggy than using a timer to check continuously.
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
06-02-2008 18:31
From: Ari Storaro
I was thinking about using moving start and moving end to call it. But I'm wondering whether that would work if the avatar is running or walking and then engages in flight while still moving. But perhaps a combination of things could work...and still be less laggy than using a timer to check continuously.

This experiment is going to drive you nuts, when you find all the situations where these events simply fail to trigger, so you might want to save yourself a little trouble now and get everything into neat little functions so that it's only a line or two to add an event test and move it back to the timer afterward :D
_____________________