Panic Metre Based On Mouse Movement?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
crimsonnight
- Veteran
- Posts: 298
- Joined: Fri Apr 20, 2012 4:44 am
- Contact:
Panic Metre Based On Mouse Movement?
Hi all,
I'm currently working on a short horror VN and had a few ideas that I was wondering would be possible to implement or not.
The main idea I have is to incorporate something like a 'panic metre'. The way I see it working, is as an (invisible) metre that fills the more you move the mouse - so the idea is that you stay calm and keep your hand still during tense scenes. It would have to be detected in the background and not effect gameplay. As the metre fills, I could intensify (raise the volume) on certain SFX and well as intensify (increase the opacity) of certain filters. What do you think, would something like this be possible?
The other idea I had, was using a gradually dimming lamp (brightness (black PNG that gradually increases in opacity?) - when the screen gets too dim, you have to shake the mouse to awaken the lamp and restore full brightness/visibility. Again, would something like this be possible in ren'py?
Cheers =)
I'm currently working on a short horror VN and had a few ideas that I was wondering would be possible to implement or not.
The main idea I have is to incorporate something like a 'panic metre'. The way I see it working, is as an (invisible) metre that fills the more you move the mouse - so the idea is that you stay calm and keep your hand still during tense scenes. It would have to be detected in the background and not effect gameplay. As the metre fills, I could intensify (raise the volume) on certain SFX and well as intensify (increase the opacity) of certain filters. What do you think, would something like this be possible?
The other idea I had, was using a gradually dimming lamp (brightness (black PNG that gradually increases in opacity?) - when the screen gets too dim, you have to shake the mouse to awaken the lamp and restore full brightness/visibility. Again, would something like this be possible in ren'py?
Cheers =)
alwaysthesamebluesky.com
Re: Panic Metre Based On Mouse Movement?
I'm not sure how fast you can run a loop in renpy, but using renpy.get_mouse_pos() will allow you to find the mouse position, and from that use simple math in the loop to find out how far the mouse has moved.
I can't help you with the image/sound adjustment though someone will surely point you in the right direction.
I can't help you with the image/sound adjustment though someone will surely point you in the right direction.

If we are what we repeatedly do, then good coding is not an act, but a habit
Re: Panic Metre Based On Mouse Movement?
Very, very, very fastIylae wrote:I'm not sure how fast you can run a loop in renpy
===>
UDD is best for this task I think. Darkish background will work but you may get an even better result with im. manipulators.
-
crimsonnight
- Veteran
- Posts: 298
- Joined: Fri Apr 20, 2012 4:44 am
- Contact:
Re: Panic Metre Based On Mouse Movement?
Cheers guys, I suppose instead of using 'renpy.get_mouse_pos()' and seeing how far it moves, it may be better to monitor constant movement (ie the amount of time the mouse is moving/still) as well as how far it's travelled if possible? This'll be necessary for the lamp function outlined. I feel like we have a strong start though 
alwaysthesamebluesky.com
Re: Panic Metre Based On Mouse Movement?
I wonder, does RenPy handle spawning sub-processes? That'd make a mouse monitoring loop much simpler for this effect.

If we are what we repeatedly do, then good coding is not an act, but a habit
- Winterslice
- Veteran
- Posts: 228
- Joined: Mon Sep 28, 2015 3:51 am
- Completed: The Next World, Golem Creation Kit
- Organization: Illuminated Games
- Contact:
Re: Panic Metre Based On Mouse Movement?
Using renpy.get_mouse_pos() in a UDD, you'd be able check the new value against an old one, see how far the mouse has moved in pixels, and make a judgement based on said amount of pixels. It is by far the simplest way of doing exactly what you want. Check out the flashlight UDD in the Ren'Py cookbook for inspiration.
Re: Panic Metre Based On Mouse Movement?
You don't really have to, values are supplied to the event method...Winterslice wrote:Using renpy.get_mouse_pos() in a UDD
- Winterslice
- Veteran
- Posts: 228
- Joined: Mon Sep 28, 2015 3:51 am
- Completed: The Next World, Golem Creation Kit
- Organization: Illuminated Games
- Contact:
Re: Panic Metre Based On Mouse Movement?
Interesting. Not sure I understand that part yet. If it's not too much of an imposition, can you give an example?xela wrote:You don't really have to, values are supplied to the event method...Winterslice wrote:Using renpy.get_mouse_pos() in a UDD
Re: Panic Metre Based On Mouse Movement?
Example!Winterslice wrote: Interesting. Not sure I understand that part yet. If it's not too much of an imposition, can you give an example?
- Winterslice
- Veteran
- Posts: 228
- Joined: Mon Sep 28, 2015 3:51 am
- Completed: The Next World, Golem Creation Kit
- Organization: Illuminated Games
- Contact:
Re: Panic Metre Based On Mouse Movement?
Ahhhh, okay, I see it now. Thanks.
-
crimsonnight
- Veteran
- Posts: 298
- Joined: Fri Apr 20, 2012 4:44 am
- Contact:
Re: Panic Metre Based On Mouse Movement?
After chatting with TheSHAD0W on the IRC, he kindly came up with a system to track mouse-movement and build up a metre based on that - I'll attach it to this post to help anyone looking to do a similar thing.
- Attachments
-
- panic_meter_test.zip
- (7.2 KiB) Downloaded 78 times
alwaysthesamebluesky.com
Who is online
Users browsing this forum: Bing [Bot], Google [Bot]
