Gamepad Extender (v1.1, 2/20/2015)

Hello Lone Wolf, I hope I'm not necro-posting by making this comment, but it should be fine since you were active today, although it has been 2 years since the last comment was made on here... I mean, I think it's ok... right?

Anyways, I was wondering if it's possible to make a method for a conditional branch that detects if player two's controller is plugged in or not. What I'm trying to do is make a menu option that, when selected, runs a common event that detects if a second controller is connected or not. If it is, it activates a switch. If one isn't, a message appears saying that player 2 isn't connected. I've got the menu down and everything, but now I need that conditional branch... Is it possible?

P.S. This script is extremely helpful and impressive. Thanks for putting hard work into it and improving it over-time!
Amazingly enough, I am in fact still alive and working (privately) on my own projects.

It's not otherwise documented, but WolfPad.plugged_in? is actually overloaded to take an ID as a parameter. Using the script option on a conditional branch to check WolfPad.plugged_in?(1) should accomplish what you want (1 meaning pad 2 because integer IDs are stupid like that).

It won't work for emulators or input remappers that fake detection on disconnected pads, though, but then again nothing can (or should even be able to) detect that.
Thanks, it works perfectly! Is it also possible for controller 2 to be able to take control of player 1's functions? Like say at one point player 1 is doing all the map movement, battle control, menu selections, and so on. But then (via a script call or something), controller 2 takes over the functions that player 1 was doing
You would have to code some kind of conditional yourself, but the sky's the limit, really. Adding some kind of "active player" variable to the core input checks should suffice. (Remember to call WolfPad instead of Input when checking inputs by pad ID.)
I think I might have an alternate idea. What would be called to force player 1 to make an input (like A or Y)? Maybe I can make conditional branches where, when controller 2 presses the A button for example, a script call happens that forces input A to be activated (assuming it would come from controller 1 by default). That way, player 2 can basically do whatever player 1 can do
bump
It's possible to convert this script to XP?
I tested on XP and it doesn't give any errors (though, the only thing that works are the analog sticks to move the player), only if i use the input.pressed with the script's inputs.
Or, maybe it works on it too but my controller is old? I have no idea if my controller is old, though as i said, only the analog sticks work.
Hello, sorry for the bump, but I was wondering if anyone could help me make this more applicable to Yanfly Engine Ace - Enemy Target Info v1.02? I'm using Gamepad Extender, as well as Gamepad Extender Game Adapter & Gamepad Extender Game Adapter - Arc Engine by Jono99. I have LT set as Shift, LB as L (Q), and RB as R (W). They work fine outside of battles and in menus, but when using target info they don't work. Shift won't open the info page for me, so I changed it to X. While I had it set to X, it would open, but L and R still wouldn't work and there's no expendable buttons that I could use besides LB and RB.

Enemy Target Info: https://yanflychannel.wordpress.com/rmvxa/battle-scripts/ace-battle-engine/enemy-target-info/
Game Adapter/Game Adapter Arc Engine: https://forums.rpgmakerweb.com/index.php?threads/ge-game-adapter.69589/
Arc Engine: https://arcthunder.blogspot.com/p/scripts.html
sorry for the bump
necroposting is okay in this area.
I have LT set as Shift, LB as L (Q), and RB as R (W)
Perhaps use this and change the values to what you need.
Ruby:
class Window_Comparison < Window_Base
  #--------------------------------------------------------------------------
  # process_enemy_window_input
  #--------------------------------------------------------------------------
  def process_enemy_window_input
    return unless SceneManager.scene_is?(Scene_Battle)
    return unless SceneManager.scene.enemy_window.active
    return if SceneManager.scene.enemy_window.select_all?
    SceneManager.scene.toggle_enemy_info if Input.trigger?(@button) || Input.trigger?(:X)
    return unless self.visible
    SceneManager.scene.enemy_info_page_up if Input.trigger?(:L) || Input.trigger?(:L1)
    SceneManager.scene.enemy_info_page_down if Input.trigger?(:R) || Input.trigger?(:R1)
  end
end
no idea if it will work.
Perhaps use this and change the values to what you need.
Ruby:
class Window_Comparison < Window_Base
  #--------------------------------------------------------------------------
  # process_enemy_window_input
  #--------------------------------------------------------------------------
  def process_enemy_window_input
    return unless SceneManager.scene_is?(Scene_Battle)
    return unless SceneManager.scene.enemy_window.active
    return if SceneManager.scene.enemy_window.select_all?
    SceneManager.scene.toggle_enemy_info if Input.trigger?(@button) || Input.trigger?(:X)
    return unless self.visible
    SceneManager.scene.enemy_info_page_up if Input.trigger?(:L) || Input.trigger?(:L1)
    SceneManager.scene.enemy_info_page_down if Input.trigger?(:R) || Input.trigger?(:R1)
  end
end
no idea if it will work.
It worked! Thank you so, so much! This saved me a lot of time on my project!
Hello, sorry for necroposting, I don't know if it is allowed but maybe I will finish my game (for about 10 yr of work with a lot of break from creating it 😉)
I have problem with pad F310 Logitech when Im using this script, the buttons are mapped ok but only the Cancel button is working. Any guess why? I'm using Khas Sapphire battle system.
The usual answer would be that some other script is checking buttons differently. The second answer is something is interfering with mappings at the driver level (as Logitech does sometimes). Try testing just the pad plugin in a new project, it should feel like nothing is installed at all. There's also a link a few posts (and years!) back to an adapter someone wrote for that battle system you may want to try if you haven't.

Original thread: https://forums.rpgmakerweb.com/threads/gamepad-extender-v1-1-2-20-2015.1284/