(Solved) How to make screen repeat an action when HOLDING DOWN right stick for controller?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
SypherZent
Veteran
Posts: 331
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Soundcloud: Chrysopoeist
Location: Puerto Rico
Contact:

(Solved) How to make screen repeat an action when HOLDING DOWN right stick for controller?

#1 Post by SypherZent » Sat Oct 17, 2020 9:06 am

I have this code:

Code: Select all

    for button in ["K_PAGEDOWN","pad_righty_pos"]:
        key button action Function(yadj.change, yadj.value + 50), renpy.restart_interaction
This is intended to control the scrollbar of a viewport.

Page Down key on my keyboard KEYPAD isn't detected and doesn't work at all.
repeat_K_PAGEDOWN also does not work.
However, that's not my question for this post.

My question for this post is: How do I make the function run many times when holding down the right stick on controller?

Currently it only runs ONCE and I have to press down many times on the right stick of my controller. I want it to smoothly scroll, or repeat the functions.
What the documentation calls an 'Analog Axis event', I want this event to be repeated as long as the stick is held in a certain direction.

Note that repeat_pad_righty_pos doesn't work.


Solved
I used a different method, so I no longer need to know how to do this.
Method described in the solution to viewtopic.php?f=8&t=60375

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]