MasterMoes

Capable of everything a game creator will need
Member
Joined
May 22, 2018
Messages
13
Reaction score
1
First Language
English
Primarily Uses
RMVXA
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!
 

Lone Wolf

Tsundere
Veteran
Joined
Mar 13, 2012
Messages
319
Reaction score
81
First Language
English
Primarily Uses
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.
 

MasterMoes

Capable of everything a game creator will need
Member
Joined
May 22, 2018
Messages
13
Reaction score
1
First Language
English
Primarily Uses
RMVXA
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
 

Lone Wolf

Tsundere
Veteran
Joined
Mar 13, 2012
Messages
319
Reaction score
81
First Language
English
Primarily Uses
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.)
 

MasterMoes

Capable of everything a game creator will need
Member
Joined
May 22, 2018
Messages
13
Reaction score
1
First Language
English
Primarily Uses
RMVXA
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
 
Last edited:

MasterMoes

Capable of everything a game creator will need
Member
Joined
May 22, 2018
Messages
13
Reaction score
1
First Language
English
Primarily Uses
RMVXA

Andrea87Sky

Just a random musician, eventer and spriter.
Veteran
Joined
Aug 30, 2017
Messages
122
Reaction score
2
First Language
Italian
Primarily Uses
RMXP
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.
 

Rattata

Villager
Member
Joined
Jan 21, 2021
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,982
Reaction score
665
First Language
English
Primarily Uses
RMVXA
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.
 

Rattata

Villager
Member
Joined
Jan 21, 2021
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMVXA
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!
 

Latest Threads

Latest Posts

Latest Profile Posts

Jeez...
I finally decide, after several ppl asking me to, to create a gamethread about project M... And my internet craps out on me halfway through the process :(
making my first game is like trying to stuff all my experience with old games into one
so its slow and painful when i dont get it right... i bet the next game is gonna be finished earlier!
When you don't find any time to work... :kaocry:
First Ten Minutes of my Caretaker inspired game

Finally, I got a good Gmail message [from smg5urded]
"This game does look a bit plain, but, I'm sure this does not destroy the experience as a whole. Monsters fit your style of game-play, mapping looks crude but I'm sure you can make it better if you do a remake of Forgotten Eclipse"

Forum statistics

Threads
110,397
Messages
1,052,967
Members
143,457
Latest member
BrainRot
Top