Status
Not open for further replies.

BurningOrca

Veteran
Veteran
Joined
Apr 14, 2019
Messages
304
Reaction score
279
First Language
German
Primarily Uses
RMMZ
I have some questions about controlling a game made with RMMZ using a gamepad.
I don't have a controller for PC, so I just can't test it to figure out the answers myself.
I want to know:
1. To which kind of controller do the comments next to the numbers refer to? Is this X-Box or some kind of special PC controller?
2. Are the remaining numbers 6 - 11 just not used by RMMZ or aren't they mapped to any button?
3. If the remaining numbers are mapped to any button, to which buttons are they mapped to?

Here is the excerpt from the core scripts:
Code:
/**
 * A hash table to convert from a gamepad button to a mapped key name.
 *
 * @type Object
 */
Input.gamepadMapper = {
    0: "ok", // A
    1: "cancel", // B
    2: "shift", // X
    3: "menu", // Y
    4: "pageup", // LB
    5: "pagedown", // RB
    12: "up", // D-pad up
    13: "down", // D-pad down
    14: "left", // D-pad left
    15: "right" // D-pad right
};
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,114
Reaction score
3,172
First Language
EN
Primarily Uses
RMMZ
  1. I believe the default mapping works OK for the XBox 360 controller, but ultimately it's controller-dependent. A controller lists its buttons in a given order, and the engine refers to those buttons in that order. After all, 2 different controllers may have entirely different button counts/layouts.

    Here's an excerpt from an article you might find helpful:

    The buttons array contains the Xbox 360 button layout:
    JavaScript:
    buttons: [
      'DPad-Up','DPad-Down','DPad-Left','DPad-Right',
      'Start','Back','Axis-Left','Axis-Right',
      'LB','RB','Power','A','B','X','Y',
    ],
    This can be different for other types of gamepads like the PS3 controller (or a no-name, generic one), so you have to be careful and not just assume the button you're expecting will be the same button you'll actually get.

  2. They're not in the input mapper, therefore not used by RMMZ. Whether they correspond to a valid gamepad input is dependent on the gamepad's hardware & driver (see point 1).

  3. See article linked in point 1.
 

BurningOrca

Veteran
Veteran
Joined
Apr 14, 2019
Messages
304
Reaction score
279
First Language
German
Primarily Uses
RMMZ
Thanks for the explanation.
I guess then I'll just focus on the keyboard for now.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
10,012
Reaction score
6,338
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

no longer using rm2k3
Don't you hate when you're trying to sleep and suddenly the smoke detector needs batteries? That's exactly what happened to me. Now I'm sluggish and tired after that darn thing started chirping at 11:30 at night. Man I wish I had one of those smart smoke detectors that sends a message to your phone way before it starts chirping.
Interior of a bus, may do more vehicle interiors :kaoswt2:
1670089782219.png
I can hardly believe it is the third day of Christmas and I have yet to put up decorations! Spending my morning cooking breakfast and getting them up.
https://itch.io/s/83641/1-week-sale Do you want a Roguelike game like a turn-based Hades? Get Zodiac Hunters now while it's on sale!

Forum statistics

Threads
127,014
Messages
1,183,197
Members
166,877
Latest member
Danone_Adventures
Top