ID:1620211
 
Keywords: byond, gamepad, xbox, xinput
I am aware that Rockinawesome had the first 360controller support on BYOND, mine is in-no way associated with his.

You can play a demo of it in the attached file.
It will check your system for the VC++13 Redist. Package(msvcr120.dll), and if it doesn't exist, it'll prompt you to download it.

Before any public releases of this library, I would like to further test these functions through this playable demo.

Playable Demo here


Supported Functions

client
XINPUT_A()
XINPUT_A_RELEASE()
XINPUT_B()
XINPUT_B_RELEASE()
XINPUT_X()
XINPUT_X_RELEASE()
XINPUT_Y()
XINPUT_Y_RELEASE()
XINPUT_D_PAD_LEFT()
XINPUT_D_PAD_LEFT_RELEASE()
XINPUT_D_PAD_RIGHT()
XINPUT_D_PAD_RIGHT_RELEASE()
XINPUT_D_PAD_UP()
XINPUT_D_PAD_UP_RELEASE()
XINPUT_D_PAD_DOWN()
XINPUT_D_PAD_DOWN_RELEASE()
XINPUT_BACK()
XINPUT_BACK_RELEASE()
XINPUT_START()
XINPUT_START_RELEASE()
XINPUT_LEFT_BUMPER()
XINPUT_LEFT_BUMPER_RELEASE()
XINPUT_RIGHT_BUMPER()
XINPUT_RIGHT_BUMPER_RELEASE()
XINPUT_LEFT_THUMBSTICK()
XINPUT_LEFT_THUMBSTICK_RELEASE()
XINPUT_RIGHT_THUMBSTICK()
XINPUT_RIGHT_THUMBSTICK_RELEASE()
XINPUT_LEFT_TRIGGER()
XINPUT_LEFT_TRIGGER_RELEASE()
XINPUT_RIGHT_TRIGGER()
XINPUT_RIGHT_TRIGGER_RELEASE()
XINPUT_LEFT_THUMBSTICK_RIGHT()
XINPUT_LEFT_THUMBSTICK_LEFT()
XINPUT_LEFT_THUMBSTICK_UP()
XINPUT_LEFT_THUMBSTICK_DOWN()
XINPUT_RIGHT_THUMBSTICK_RIGHT()
XINPUT_RIGHT_THUMBSTICK_LEFT()
XINPUT_RIGHT_THUMBSTICK_UP()
XINPUT_RIGHT_THUMBSTICK_DOWN()
XINPUT_VIBRATE(intensity=50,duration=7)


When you hit a button on the gamepad which supports xinput(XBOX360 and I beleive XBOX One controllers), it'll send a message to BYOND and be intercepted by these client functions.

Simply override these functions to produce your macros.


Example:

client
XINPUT_X()
if(holding_x)return //this is so we don't get constant messages to initate XINPUT_X.
XINPUT_VIBRATE(100,7) //intensity is a numerical percentage from 1-100, the length is a numerical number which in length is 1/10th of a second.


The above code will make the xinput type controller vibrate upon hitting the "X" button on a XBOX360 controller.



Variables:

client
holding_x = 0
holding_y = 0
holding_a = 0
holding_b = 0
holding_right_bumper = 0
holding_left_bumper = 0
holding_left_thumbstick = 0
holding_right_thumbstick = 0
holding_right_trigger = 0
holding_left_trigger = 0
holding_d_pad_up = 0
holding_d_pad_down = 0
holding_d_pad_right = 0
holding_d_pad_left = 0
holding_start = 0
holding_back = 0
vibrate_enabled=1


Playable Demo Here
Please note that this is a public demo to test and utilize these features. There isn't gameplay really.
Your demo doesn't work, and it won't work for multiplayer.
It isn't intended for multiplayer. It doesn't work overall though?
It works for me and some other test computers, hmm.
You forgot to package it with the DLLS it requires. It just plain throws a fit after approving it to use the MFC dll.
Hmm? I included the .dll in the resource so it could be copied during runtime.

Like so:
fcopy('xinput/xinputBYOND.dll',"xinput/xinputBYOND.dll")


should it not generate the .dll?

Aside from that, it just checks if you have VC++ 2013 Redist. installed or not before it attempts to load the xinputBYOND.dll