beetlesheII

reese
Member
Joined
Oct 4, 2020
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMVXA
When you hold down the up or down key in a menu, the cursor scrolls automatically. How do I change the speed at which this scroll happens? It's a bit uncomfortably slow for me
 

AkiraKotatsuhime

炬燵姫
Veteran
Joined
Jan 2, 2013
Messages
285
Reaction score
200
First Language
DE / ドイツ語
Primarily Uses
N/A
Interesting, never thought it could be considered slow.

You would have to replace the Input.repeat? function which all interactive windows use to navigate through lists. For that, it uses a long initial interval and a repeating shorter interval rooted to the game's target framerate (60) to only confirm inputs when a key is pressed for time long enough.

While that's possible to do, the official Input module is not a part of the engine-code that is available open-for-edit. Did a little try on this task, written in Notepad. This is completely untested.

Config:
_BASE is initial (set to 12 frames), …_INTERVAL is short (set to 3 frames).

Ruby:
#==============================================================================
# ** Custom Input Repeat Intervals for Directions
#------------------------------------------------------------------------------
#  © 2023 KotatsuAkira
#  Do not redistribute without this copyright notice intact.
#------------------------------------------------------------------------------
#  Made for RPGVXAce. For compatibility with RPGXP/VX, try replacing the syms
#  (e.g. ":DOWN") with constants (e.g. "DOWN") in directions and repeats list.
#==============================================================================

module Input
  #--------------------------------------------------------------------------
  # * Module Constants
  #--------------------------------------------------------------------------
  REPEAT_BASE = 12
  REPEAT_INTERVAL = 3
  REPEAT_INIT = REPEAT_INTERVAL - REPEAT_BASE
  DIRECTIONS = [ :DOWN, :LEFT, :RIGHT, :UP ]
  #--------------------------------------------------------------------------
  # * Module Variables
  #--------------------------------------------------------------------------
  @@_repeats = { :DOWN => nil, :LEFT => nil, :RIGHT => nil, :UP => nil }
  #--------------------------------------------------------------------------
  # * Method Redirects
  #--------------------------------------------------------------------------
  class << self
    alias_method(:__original_update__, :update) unless $@
    alias_method(:__original_repeat__, :repeat?) unless $@
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def self.update
    __original_update__
    DIRECTIONS.each do |sk|
      unless press?(sk)
        @@_repeats[sk] = nil
        next
      end
      @@_repeats[sk] ||= (trigger?(sk) ? REPEAT_INIT : 0) - 1
      @@_repeats[sk] += 1
      @@_repeats[sk] %= REPEAT_INTERVAL if @@_repeats[sk] > 0
    end
  end
  #--------------------------------------------------------------------------
  # * Check if Key repeats
  #--------------------------------------------------------------------------
  def self.repeat?(sk)
    return __original_repeat__(sk) unless DIRECTIONS.include?(sk)
    return @@_repeats[sk] == REPEAT_INIT || @@_repeats[sk] == 0
  end
end

~炬燵あ
 

beetlesheII

reese
Member
Joined
Oct 4, 2020
Messages
12
Reaction score
0
First Language
English
Primarily Uses
RMVXA
Thanks, this is exactly what I needed!

The thing about the slow menu is probably just a personal thing, I just like making menus as snappy as possible. Weird how this interval isn't a part of any of the given code, but this script def does the trick.

You wouldn't mind if I used this? Given credit ofc.
Thanks again !
 

Latest Threads

Latest Profile Posts

imgur sure is getting weird, one day I lose gradually all my images, the other I get them back randomly and then again they disappear again.
Despite OPT2 praise it still has some strange stories in it. Lady Mikka is trying to work herself to death because of guilt. Guilt over what? ¯\_(ツ)_/¯ So instead of finding a NPC to have a heart to heart with her they decide the cure is a new kimono. So when she drops dead she'll at least be well dressed. I haven't even got to the strange part yet.
Did so much work on the game today. I wish I could post it all in this status update but there is a character limit of course haha. I thought about making a topic for updates, though... maybe.
The most recent sign that I am old. I have done martial arts for over 4 decades. Never HAD to stretch out. Good, of course, but never required. Was doing some kicks in the kitchen because, why not, and I felt a pop in the back of my thigh. Now I am limping around. Gotta love getting old.
One of the biggest perks of being fluent in English is how many new and interesting recipes I am able to find and try out that I would have hardly come across if I just spoke my mothertounge :3

Forum statistics

Threads
131,683
Messages
1,222,233
Members
173,436
Latest member
Manic_Umbra
Top