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

Kane Hart

Elmlor.com
Veteran
Joined
Jun 27, 2014
Messages
656
Reaction score
166
First Language
English
Darn them experienced scripters should just make their own controller script :p I mean after all their experienced :p

Thanks for the comments though. That makes it a easier choice for us.
 

Lone Wolf

Tsundere
Veteran
Joined
Mar 13, 2012
Messages
311
Reaction score
73
First Language
English
Primarily Uses
Darn them experienced scripters should just make their own controller script :p I mean after all their experienced :p

Thanks for the comments though. That makes it a easier choice for us.
This isn't really a "script." It accurately emulates the default Input module while bridging the gap between game and gamepad using the XInput API (which was never meant to be used with Ruby to begin with). Neither of those are exactly simple, DIY tasks, even for experienced scripters, which is the reason I wrote this module.

Don't get me wrong, there are ways to do what you want with it, and most of them are fairly simple with the backend already taken care of, but for me to build all that into the module itself would just create problems for people who just want to work with the features this module provides. There is some really complicated low-level stuff going on, so I made the upper level as minimal as possible to allow people who understand how to use it to work with it rather than around it.

That said, I have been working on a more versatile configuration system, but there never really seemed to be much demand for me to release anything of the sort until very recently. I may get around to it, or you can break down and start reading code. There are no shortcuts on the path to glory!
 

Kane Hart

Elmlor.com
Veteran
Joined
Jun 27, 2014
Messages
656
Reaction score
166
First Language
English
This isn't really a "script." It accurately emulates the default Input module while bridging the gap between game and gamepad using the XInput API (which was never meant to be used with Ruby to begin with). Neither of those are exactly simple, DIY tasks, even for experienced scripters, which is the reason I wrote this module.

Don't get me wrong, there are ways to do what you want with it, and most of them are fairly simple with the backend already taken care of, but for me to build all that into the module itself would just create problems for people who just want to work with the features this module provides. There is some really complicated low-level stuff going on, so I made the upper level as minimal as possible to allow people who understand how to use it to work with it rather than around it.

That said, I have been working on a more versatile configuration system, but there never really seemed to be much demand for me to release anything of the sort until very recently. I may get around to it, or you can break down and start reading code. There are no shortcuts on the path to glory!
Thanks! Tbh their is always a need and want. Just not enough people know how to speak their mind. The big thing say VS XP to Ace is Xbox has pretty much put a controller or forced a controller for all PC Games now. You might of played recent PC games that were made on PC for the console that some how feels like a port to PC.

Long story short everyone has a controller ;)

But yeah I wish I knew how to script and I would try but I been learning C# and the basics of programming for Unity :p
 

CompTek

Warper
Member
Joined
Sep 24, 2014
Messages
1
Reaction score
0
First Language
English
Primarily Uses
I want to make it so that when I press the L3, the player runs.  Also, I can't move the cursor on the menu.  No matter what I do, the cursor will not move.  I have one more thing I would like to do.  Would it be possible to make the start button open the menu?
 

Lone Wolf

Tsundere
Veteran
Joined
Mar 13, 2012
Messages
311
Reaction score
73
First Language
English
Primarily Uses
I want to make it so that when I press the L3, the player runs.  Also, I can't move the cursor on the menu.  No matter what I do, the cursor will not move.  I have one more thing I would like to do.  Would it be possible to make the start button open the menu?
That's all pretty basic stuff. I'm pretty sure there are tutorials out there for changing the buttons used in scripts, and it's simply a matter of doing that but with gamepad button assignments (i.e WolfPad::L3). The in-script documentation should tell you most of what you need to know, but for the most basic basics of script editing you'd be better served finding a real tutorial than asking me.
 

Mireneye

High Chromancer
Veteran
Joined
Dec 22, 2013
Messages
143
Reaction score
20
Primarily Uses
I have to agree. It did take me a while to figure out the script because it's not just plug & play because you have to make it work with the other scripts you are already using. This means you have to modify things outside of this script. 

Speaking of which Lone Wolf, I have made a rough variation that allows you to rebind the keys using in game variables.

This is what I did on the script side:
http://pastebin.com/uqizPQu0

And in the game I made a quite ardous event file that:
1, sets a variable to a specific default button (ex 71 = :R1
2, Display text Bind specified button to?
3, Show choices

-On default setting do nothing
-To bind to say.. button 1:
$game_variables[71] , $game_variables[72] = $game_variables[72] , $game_variables[71]
-To bind to button 2:
$game_variables[71] , $game_variables[76] = $game_variables[76] , $game_variables[71]
4, rinse and repeat for every button you want to be able to re-assign.

Not certain why I wrote this but I guess it might be helpful if someone wanted to make keys that you could rebind yourself.
 
Joined
Sep 26, 2014
Messages
1
Reaction score
0
First Language
German
Primarily Uses
At first: Nice module!

Really interesting to use it in games!

But I have one problem.

I use a Xbox 360-Controller but can't figure out how to embed the D-Pad, RT (R2), LT (L2), R3 and L3.

A, B, X, Y, UP (analog stick), DOWN, LEFT, RIGHT, RB, LB, START and BACK (SELECT) are no problem. I can use them whenever I want.

I don't use scripts, just the module. However, there seems to be no way to use them.

Can someone please show me an example (piece of code) where you use the D-Pad or RT / LT...?

Okay, solved it. Wasn't so weird.  :guffaw:
 
Last edited by a moderator:

Jomarcenter

jomarcenter-MJM
Veteran
Joined
Apr 24, 2012
Messages
1,270
Reaction score
206
First Language
ENGLISH
Primarily Uses
RMMV
is it possible to have if any a vibrating controller. vibrate at a specific event or attack/battles.

edit: didn't check it out too much.

But upon testing nothing happened to my controller even tho the vibration is set to true.

I am using a cheap controller with vibration to test it. I already tested with different game non-rm and it's working but for this script. nothing happened.
 
Last edited by a moderator:

Mireneye

High Chromancer
Veteran
Joined
Dec 22, 2013
Messages
143
Reaction score
20
Primarily Uses
[SIZE=14.2857141494751px]UPDATE3: Oh.. I think I understand why I'm getting turned around. lstick4 would be left & right? and lstick8 would be up & down? if that is true. How would I translate that into the base scripts of VX Ace when they ask specifically for up/down etc? also last but not least sorry for all the overlapping updates.[/SIZE]

[SIZE=14.2857141494751px]UPDATE2: I guess my real question is.. how would I make the left Analog stick control menues/inventory/etc [/SIZE][SIZE=14.2857141494751px]nstead of the D-pad?[/SIZE], what do I write? If I know that I can find the right places to replace in the base scripts.

UPDATE: Yeah I'm just being stupid. of course I just gotta go find where the game handles their :UP :DOWN and switch them out in their scripts. What is still a valid question is.. CAN wolfpad be used as a script call and if so how would be the good way to do it?

OLD:

A question about something I just ran into while testing things, how would i reference the analog sticks from an event? I had to do this to avoid input lag for activation (none analog sticks): Input.press?(PadConfig.activateevent) so I used press instead.

But for analog sticks simply saying: Input.press?(lstick) or similar doesn't work. It's probably clear as day in your excellent explanation on how to use the script, but I'm not seeing it :/

Again, don't know what I would do without this script! It adds SOOO much to my project!
 
Last edited by a moderator:

Lone Wolf

Tsundere
Veteran
Joined
Mar 13, 2012
Messages
311
Reaction score
73
First Language
English
Primarily Uses
I see what you're trying to do, but it can't be done that way because the analog sticks aren't tracked the same as buttons in the current version.

lstick4 and lstick8 simply read the state of the left stick and return a 4- or 8-way directional value, identical to RGSS's own Input.dir4 or dir8 commands. Ideal use is in a conditional handler like so:

case Wolfpad.lstick4(0)when 2 #down   #do somethingwhen 4 #left   #do somethingwhen 6 #right   #do somethingwhen 8 #up   #do somethingendbut you can also do a simple check like WolfPad.lstick4 == 2.

Hope that clears things up for you!
 
Last edited by a moderator:

Mireneye

High Chromancer
Veteran
Joined
Dec 22, 2013
Messages
143
Reaction score
20
Primarily Uses
Absolutely! that clears up a lot! I'm getting a crash tho, seeing as .repeat? is also a method in GaryCXJk's InpEx that I use to for players to rebind Keyboard keys. "Can't convert integer into false". I'm still researching the issue so I don't have more data atm. 

Thanks mate!
 
Last edited by a moderator:

Lone Wolf

Tsundere
Veteran
Joined
Mar 13, 2012
Messages
311
Reaction score
73
First Language
English
Primarily Uses
You currently can't use analog stick directions with press?, repeat?, or trigger?, and the additional code required to treat them the same as other mappable buttons would bring the entire script to screeching halt as far as performance, which is why it's not set up that way.

A radial menu or the like is still easily doable with the way I have it set up, but handling analog stick directions as fully mappable buttons is way more of a headache than it's worth, which is why most modern games don't have that as an option. It would be different if I could poll directions from the hardware directly, but that's not possible for controllers using the XInput standard.

That said, I think I've figured out a way to make it work without too much of a performance hit, but it will take some time to fully test out.
 

Mireneye

High Chromancer
Veteran
Joined
Dec 22, 2013
Messages
143
Reaction score
20
Primarily Uses
UPDATE: After some tinkering and figuring out the logic, this almost solves it: 

cursor_down (Input.trigger?:)DOWN))  if WolfPad.lstick4 == 2
The only issue is that it doesn't loop around like it does when you use the d-pad for some reason beyond me atm. Also it's DAYMN fast. I'll also have to nestle in the plugged in check but I think I can manage  that =) 

Ohh, see that's VERY informative ^-^ Since what I've been trying to replace is this:
cursor_up   (Input.trigger?:)UP))    if Input.repeat?:)UP)

With something that could be governed by the left analog. 

Again! Loving all the help with this.
 
Last edited by a moderator:

Lone Wolf

Tsundere
Veteran
Joined
Mar 13, 2012
Messages
311
Reaction score
73
First Language
English
Primarily Uses
Version 1.1 released

4-way analog stick input can now be referenced in the same manner as the analog triggers or any other button mapping. (see readme)

This also replaces the original angle-based handling when using lstick4 and related calls, for improved accuracy and what should be a pretty good speed boost. Not that this module ever ran slow.
 

Mireneye

High Chromancer
Veteran
Joined
Dec 22, 2013
Messages
143
Reaction score
20
Primarily Uses
Wow that was quick! lmao, I guess I don't need my silly workaround that I made after all ^-^ Great work! I'll try it out next time I do some developing!
 

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,905
Reaction score
451
First Language
April Fools
Primarily Uses
N/A
Can this work with a generic usb controller like a logitec one I got. aka not a ps3 or xbox360 controller.
 

 

Lone Wolf

Tsundere
Veteran
Joined
Mar 13, 2012
Messages
311
Reaction score
73
First Language
English
Primarily Uses
As I said in the FAQ on the first post, pretty much any Windows 7+-compatible USB controller will work. As a rule, if the button labels correspond to an XBox 360 controller, it's pretty much guaranteed to work. I can't vouch for any old pad made by any old manufacturer, but a modern Logitech controller, like that one in your post, will work out of the box with no special drivers required.
 

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,905
Reaction score
451
First Language
April Fools
Primarily Uses
N/A
I asked because I did add the script and it didn't seem to work. 
 

Lone Wolf

Tsundere
Veteran
Joined
Mar 13, 2012
Messages
311
Reaction score
73
First Language
English
Primarily Uses
It also says in the FAQ that simply copying the module into your scripts section will have no noticeable effect. Can I see the section of code you're testing? I've done testing with a Logitech pad like that one and it worked just fine.
 
Joined
Apr 20, 2015
Messages
23
Reaction score
0
First Language
English
Primarily Uses
Hello, awesome script! But I'm having a problem I'm getting an error with the script. 

Error.jpg      This is the error I'm getting.

Extras.jpg    Extra things I added to the script.

Multiplayer.jpg     I'm also using Tsukihime's Multiplayer script so this might be causing a problem
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,090
Members
137,587
Latest member
Usagiis
Top