Jump to content

"on_mouselook"?


Noel Loordes
 Share

You are about to reply to a thread that has been inactive for 4783 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

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

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

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

  • Lindens

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.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4783 days.

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
 Share

×
×
  • Create New...