Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

replacing the arrow keys with A,S,D,W for movement

I used to know how to do this, but I haven't used rmxp in a fat minute. What I'm trying to do is replace the arrow keys with A,S,D and W for player movement. Where in which script would i need to edit?

BTW, I'm on rmvx.
 
First, you need a keyboard script that allows you to access the full range of keys.  I recommend the software by vgvgf:  Aleworks Input Module (and all the related add-ons).

With that set, you should be able to perform substitutions such as changing Input::UP to Keys::A which would substitute your generic 'UP' button with the letter 'A'.  These changes should still be performed in the Scene_Map system.
 
there's no way of doing it unless you wanna use someone elses keyboard module or build one yourself (like i have done)... its not too hard and it doesnt lag (depending on the amount of keys you want to have available)... if you need help doing so please just ask me although i recommend you have a good knowledge of RGSS / ruby and the Win32API.new command... both are neccessary for even making a dent in the scripts production.
 
i think he wants to find a way of doing it using standard scripts (impossible) or making it himself... note:

Cruelty":b42v0e03 said:
ugh the point of this project is to not use any resourced scripts. this used to be such a simple edit, is there no other way of doing it?

as i replied there is no way to do that with standard scripts but with API calls it is easy... also poccil, why do you use keyboard states?

i myself created a automatic multi-dimensional array creator (similar to table but supports 5 dimensions, strings and has different output codes) and then stored the data within that, this ay i could just use the VK number and GetAsyncKeyState in turn to quickly get data in and out (similar to VGVGF's but much much smaller)
 
i wasn't looking for a script, really (i'm actually staying away from using any pre-made scripts). I was just assuming there's an easy, quick way to modify the standard scripts to just change to key inputs. Looks like there isn't.

thanks for the information, guys.
 
as i said though... if you want to still then just PM me and i'll make you the smallest possible script... especially as you say you only want it to use WASD... also if you want it to be for movement only then it would only be around... 10 lines...

4 lines for the keycodes, 4 lines for the input.dir4 addon and 2 lines for the API... simple enough?

or do you want the input.trigger, input.press and input.repeat functions for those keys too (for menus and such)
 

Haki

Member

Why are you complicating this so much?
You can do this for player movement - replace these lines in Game_Player script:

Code:
      case Input.dir4
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
      end
With this:
Code:
      if Input.press?(Input::Y)
         move_down
      elsif Input.press?(Input::X)
         move_left
      elsif Input.press?(Input::Z)
         move_right
      elsif Input.press?(Input::R)
         move_up
      end

You can do almost the same for any scene if you just edit it in the window_selectable class.
Replace Input::R with Input::A (This will take care of actor switching in the menu)
          Input::UP with Input::R
          Input::DOWN with Input::Y
          Input::LEFT with Input::X
          Input::RIGHT with Input::Z
 
yes but this only allows the preset buttons which are very limited... any other buttons will not be available... also this means that the user could screw it up but using the F1 menu... not good...
 
Haki":ef7jdl5r said:
Why are you complicating this so much?
You can do this for player movement - replace these lines in Game_Player script:

Code:
      case Input.dir4
      when 2
        move_down
      when 4
        move_left
      when 6
        move_right
      when 8
        move_up
      end
With this:
Code:
      if Input.press?(Input::Y)
         move_down
      elsif Input.press?(Input::X)
         move_left
      elsif Input.press?(Input::Z)
         move_right
      elsif Input.press?(Input::R)
         move_up
      end

You can do almost the same for any scene if you just edit it in the window_selectable class.
Replace Input::R with Input::A (This will take care of actor switching in the menu)
          Input::UP with Input::R
          Input::DOWN with Input::Y
          Input::LEFT with Input::X
          Input::RIGHT with Input::Z

this is exactly what i was looking for. thanks much, bro.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top