Noel Loordes Posted March 21, 2011 Share Posted March 21, 2011 Hello!The only way I know to detect leaving or entering mouselook is polling llGetAgentInfo. This sounds unnecessarily costly though for many usages.Especially I want to get a weapon to reload when leaving mouselook in order for my RP-weapons (flame thrower, flare) to behave the same as the official weapons supplied for SL Midgar. Having a timer event executed every few tenth of a second seems pretty laggy though. Link to comment Share on other sites More sharing options...
PeterCanessa Oh Posted March 21, 2011 Share Posted March 21, 2011 No, you're right, polling is the only way to do it. That's the trouble with most AOs too; they have to keep polling for what animation SL 'would' be playing if they didn't override it. In exactly the same way it would be nice if this was an event too, but it isn't. Link to comment Share on other sites More sharing options...
Cerise1488303085 Posted March 21, 2011 Share Posted March 21, 2011 Really, this is not much of an issue. You will read general comments in many places that timers or listeners or some other script features of the week are "bad", but checks like this use little script time. The usual example for "timers are bad" is animation overriders, but a real look at sim statistics shows that they use very little script time. Link to comment Share on other sites More sharing options...
Noel Loordes Posted March 21, 2011 Author Share Posted March 21, 2011 I assumed so, though... How long does this stay true? If I check once per second, the reloading would feel laggy, if I check every 0.001 seconds I'd expect it to cause lag, no matter how little script time every event takes. What range would be lag-safe for the timer? Link to comment Share on other sites More sharing options...
Lindens Kelly Linden Posted March 21, 2011 Lindens Share Posted March 21, 2011 The simulator only runs at 45 frames per second. It is going to be rare that a script runs more than 1 event per frame and even the theoretical max is 2 per frame. At this rate you are only going to process 1 timer event every 1 / 45 or 0.022s, or in a very empty sim maybe 1 every 0.011s. In other words, there isn't much point in a timer resolution any smaller than 0.02s and that is an ideal. In practice 0.1s (or about every 5 frames) is probably about the highest practical resolution you will get. I doubt you will notice much difference in feel between 0.02s and 0.1s timers. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now