• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Detect gamepad input

  • 119
    Posts
    11
    Years
    • Seen Sep 1, 2023
    RPG Maker XP's original input class also supports input form gamepads, however Pokémon essentials does not. I've looked around to find out how to actually detect gamepad input, yet thus far I've only found one script for rpg maker vx, and vx ace (vx ace script, vx script). I've experimented with the scripts yet thus far I've only managed to get the field movement to work with the left joystick.

    Could anyone please explain me how to detect input from a gamepad in Pokémon Essentials.
     
    I would really like to bump this as implementing gamepad support would allow me to include a co-op mode which sounded interesting to some of my friends (and hopefully sparks the community's imagination).

    Again; I have no clue about how to detect gamepad input in RPG Maker XP. If someone would be able to give me a hint about this, that'd be awesome. If someone would want to convert one of the scripts linked to in the first post to RPG Maker XPm that'd be epic.
    Or maybe I'm just asking for to much, in which case please let me know (and I'll continue to make some attempts myself occasionally while working on other stuff).
     
    Hello,

    Let's hope I'm wrong, but as this is not a common feature in pokemon fan games, I find it unlikely that someone will be able to help you out. If I were you I'd try to work a solution by myself.

    Good luck mate.

    Giu
     
    Thanks, I hope I accidentally stumble upon the solutions as everything I've tried thus far hasn't worked. I don't expect anyone to just give me the solution and do the work for me, although that would be awesome. I just hope that someone can share their knowledge or give me some ideas of how to tackle this. I have some scripting experience, yet right now I just don't have a clue of what I can try.

    The vanilla rpg maker xp does have gamepad support, thus I'm wondering how it's done there. (I know the original input module can't be viewed, nor have I found it anywhere on the internet)
     
    Hello,

    Let's hope I'm wrong, but as this is not a common feature in pokemon fan games, I find it unlikely that someone will be able to help you out. If I were you I'd try to work a solution by myself.

    Good luck mate.

    Giu

    It's not a common feature in Pokémon games, but that's because it's not available in Essentials by default (Even though it should be in my opinion).

    Thanks, I hope I accidentally stumble upon the solutions as everything I've tried thus far hasn't worked. I don't expect anyone to just give me the solution and do the work for me, although that would be awesome. I just hope that someone can share their knowledge or give me some ideas of how to tackle this. I have some scripting experience, yet right now I just don't have a clue of what I can try.

    The vanilla rpg maker xp does have gamepad support, thus I'm wondering how it's done there. (I know the original input module can't be viewed, nor have I found it anywhere on the internet)

    There are older versions of essentials that have Wii remote support, but not having a functional bluetooth dongle, I'm unable to test the functionality for it in any version of essentials.

    At any rate, you said you were able to get the analog stick working, and that in itself is impressive... Unfortunately, I am out of pace with RGSS, and tied up with many things, so I can't be much help, but I wish you luck in this. Controller support would be a welcome feature in essentials to me.
     
    Try this: Use my Set the Controls Screen Script. At CONTROLSLIST, remove every interval, for example:

    Code:
      CONTROLSLIST = {
        # Mouse buttons
        _INTL("Backspace") => 0x08,
        _INTL("Tab") => 0x09,
        _INTL("Clear") => 0x0C,
        _INTL("Enter") => 0x0D,
        _INTL("Shift") => 0x10,
        _INTL("Ctrl") => 0x11,
        _INTL("Alt") => 0x12,
        _INTL("Pause") => 0x13,
        _INTL("Caps Lock") => 0x14,
        # IME keys
        _INTL("Esc") => 0x1B,

    to

    Code:
      CONTROLSLIST = {
        _INTL("0x01") => 0x01,
        _INTL("0x02") => 0x02,
        _INTL("0x03") => 0x03,
        _INTL("0x04") => 0x04,
        _INTL("0x05") => 0x05,
        _INTL("0x06") => 0x06,
        _INTL("0x07") => 0x07,
        _INTL("Backspace") => 0x08,
        _INTL("Tab") => 0x09,
        _INTL("Clear") => 0x0C,
        _INTL("Enter") => 0x0D,
        _INTL("Shift") => 0x10,
        _INTL("Ctrl") => 0x11,
        _INTL("Alt") => 0x12,
        _INTL("Pause") => 0x13,
        _INTL("Caps Lock") => 0x14,
        _INTL("0x15") => 0x15,
        _INTL("0x16") => 0x16,
        _INTL("0x17") => 0x17,
        _INTL("0x18") => 0x18,
        _INTL("0x19") => 0x19,
        _INTL("0x1A") => 0x1A,
        _INTL("Esc") => 0x1B,
    So, test you joystick at "Enter Key" option. This way you probably can read the relation of the hexadecimal codes and buttons in gamepad. After this, just add the gamepad codes to the input button lists.
     
    Thanks for your input, but unfortunately it doesn't work that way. Those values (0x08, etc.) are constants set by windows for the virtual keyboard, thus they are only able to detect keyboard input. Just to be sure I tested your suggestion, without much success. I've also tried to use the constants for virtual gamepads (or at least something similar to the keyboard constants, which I was able to find at microsoft's website), yet these also don't work.

    Gamepad data can be retrieved using XInput from Win32API, yet I don't know how to detect the button inputs.

    Getting directional keys working was actually very easy, at least the way I did it, which was simply making the gamepad script for vx ace (linked in the first post) run without errors.
     
    Back
    Top