Wintermute Engine Forum

Wintermute Engine => Feature requests, suggestions => Topic started by: Marek on June 26, 2004, 03:55:12 PM

Title: "Idle time" tracking?
Post by: Marek on June 26, 2004, 03:55:12 PM
I'd love to have a function that returns the number of seconds the user hasn't a) interacted with anything or b) moved the mouse.

For example when the user hasn't done anything for X minutes, I could give him a new hint. This could also be used for things like idle animations, 'screensavers' or returning users to a menu screen when the game has been idle for a while (this would be really useful for my game for example, since I have to show it at an event where people will probably play for only 5 minutes or-so ... I could make it so that it automatically resets the game when no one is playing it).

Maybe there's a way to do it already, but a function for it sure would make it easier.
Title: Re: "Idle time" tracking?
Post by: Mnemonic on June 26, 2004, 04:52:21 PM
This can be achieved by periodically tracking actor's Ready state. If the actor stays "ready" we can assume the player haven't interacted with anything.

See this thread for an example script: http://forum.dead-code.org/index.php?topic=585.0

As for mouse movement, it could be done similarly; by remembering the original mouse position and periodically checking if it has changed or not.