Gamepad Extender
version 1.1
by Lone Wolf
Introduction:
By default, RGSS3 uses DirectInput to make only 8 buttons available to scripters. This script provides an alternate, XInput-based gamepad interface, giving scripters access to all 16 buttons on a modern gamepad, as well as dual-analog sticks, analog triggers, and force-feedback controls. Also enables multiplayer for up to four players with compatible gamepads.
Features:
- Doubles the number of available buttons.
- Easy access to analog sticks and triggers.
- Basic force-feedback control.
- Support for up to four controllers simultaneously.
- NEW: analog stick directions can now be treated like individual buttons
Video:
Spoiler
https://www.youtube.com/embed/u0hbz9plTlQ
FAQ:
Q: What controllers will work?
A: Any PC-specific USB controller made in the last five years should work without issue. Older controllers, console controller adapters, etc. will need XInput drivers or an XInput emulator. Google is your friend.
Q: No Guide button?
A: No Guide button. It uses a separate interface from XInput and is generally reserved by the system.
Q: Can you make this work in...?
A: This is the VX Ace version. An outdated VX port can be found
here. I am not planning any further ports at this time.
Q: I installed this script, so why doesn't my gamepad work?
A: This script adds a new module to handle input from modern gamepads, but doesn't change any of the script core's default button calls. To actually use any of the new possible mappings (or the additional PadConfig module's bindings), you need to manually edit the input related functions in the default scripts (Game_Player and Window_Selectable are good places to start). Comments for specific functions are included in the main script body.
Credit and Tanks:
-Lone Wolf
-An old forum post on Win32API I clearly should have bookmarked.
Script:
Spoiler Code:
Author's Notes:
This script is forever a work-in-progress. Feel free to suggest features and fixes.
Updates:
(4/12/17) - Corrected top page for the new layout.
(2/20/15) - First update in two years! Optimized analog stick directional handling.
(3/8/13) - Script update. Fixed a bug, updated documentation, cleaned a few typos, and laid groundwork for writing add-ons.
(1/9/13) - Updated main post. No changes to script.
(7/25/12) - Fixed input refresh bug on controllers handling update packets correctly. This one's my bad.
(6/13/12) - Updated main post. No changes to script.
(4/10/12) - Fixed a bug with multiple controllers where update_vibration would be skipped if gamepad detection failed.
本贴来自国际rpgmaker官方论坛作者:Lone Wolf处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/gamepad-extender-v1-1-2-20-2015.1284/