Second post because MBU/O script source:
Code:function spewmovevars()
{
echo(yaw: SPC $mvYaw SPC pitch: SPC $mvPitch);
$Debug::spewmovesched = schedule(500,0,spewmovevars);
}
function gamepadYaw(%val)
{
if( $pref::invertXCamera )
%val *= -1.0;
// if we get a non zero val, the user must have moved the stick, so switch
// out of keyboard/mouse mode
if (%val != 0.0)
$mvDeviceIsKeyboardMouse = false;
// stick events come in even when the user isn't using the gamepad, so make
// sure we don't slam the move if we don't think the user is using the gamepad
if (!$mvDeviceIsKeyboardMouse)
{
%scale = (ServerConnection.gameState $= wait) ? -0.1 : 3.14;
$mvYawRightSpeed = -(%scale * %val);
}
}
function gamepadPitch(%val)
{
if( $pref::invertYCamera )
%val *= -1.0;
// if we get a non zero val, the user must have moved the stick, so switch
// out of keyboard/mouse mode
if (%val != 0.0)
$mvDeviceIsKeyboardMouse = false;
// stick events come in even when the user isn't using the gamepad, so make
// sure we don't slam the move if we don't think the user is using the gamepad
if (!$mvDeviceIsKeyboardMouse)
{
%scale = (ServerConnection.gameState $= wait) ? -0.05 : 3.14;
$mvPitchUpSpeed = %scale * %val;
}
}
function mouseYaw(%val)
{
if( $pref::invertXCamera )
%val *= -1.0;
$mvDeviceIsKeyboardMouse = true;
$mvYaw += getMouseAdjustAmount(%val);
}
function mousePitch(%val)
{
if( $pref::invertYCamera )
%val *= -1.0;
$mvDeviceIsKeyboardMouse = true;
$mvPitch += getMouseAdjustAmount(%val);
}
function jumpOrStart(%val)
{
if (%val)
$mvTriggerCount2 = 1;
else
$mvTriggerCount2 = 0;
}
function jumpOrPowerup( %val )
{
// LTrigger
if( %val > 0.0 )
$mvTriggerCount2++;
else
$mvTriggerCount0++;
}
function moveXAxisL(%val)
{
if (%val != 0.0)
$mvDeviceIsKeyboardMouse = false;
$mvXAxis_L = %val;
}
function moveYAxisL(%val)
{
if (%val != 0.0)
$mvDeviceIsKeyboardMouse = false;
$mvYAxis_L = %val;
}
function centercam(%val)
{
$mvTriggerCount3++;
}
// gamepad
if (isPCBuild())
{
// set up some defaults
moveMap.bind( xinput, btn_x, altTrigger );
moveMap.bind( xinput, btn_a, jumpOrStart );
moveMap.bind( xinput, btn_b, mouseFire );
moveMap.bind( xinput, trigger_r, mouseFire );
moveMap.bind( xinput, trigger_l, jumpOrStart );
//moveMap.bind( xinput, zaxis, jumpOrPowerup );
moveMap.bind( xinput, btn_rshoulder, altTrigger );
moveMap.bind( xinput, btn_lshoulder, altTrigger );
moveMap.bindCmd( xinput, btn_back, pauseToggle(1);, );
moveMap.bindCmd( xinput, btn_start, pauseToggle(0);, );
moveMap.bindCmd( xinput, btn_y, togglePlayerListLength();, );
moveMap.bind( xinput, thumb_lx, DN, -0.23 0.23, moveXAxisL );
moveMap.bind( xinput, thumb_ly, DN, -0.23 0.23, moveYAxisL );
moveMap.bind( xinput, thumb_rx, D, -0.23 0.23, gamepadYaw );
moveMap.bind( xinput, thumb_ry, D, -0.23 0.23, gamepadPitch );
// moveMap.bind(keyboard, m, spawnStupidMarble);
// moveMap.bind( gamepad, btn_y, spawnStupidMarble );
//if (strstr(getGamepadName(), Logitech) != -1)
//{
//error(Binding for SPC getGamepadName() SPC controller);
//moveMap.bind( gamepad, zaxis, D, -0.23 0.23, gamepadYaw );
//moveMap.bind( gamepad, rzaxis, D, -0.23 0.23, gamepadPitch );
//}
}
else // xbox
{
// gamepad
//GlobalActionMap.bindCmd( gamepad, lshoulder, cycleDebugPredTiles();, );
moveMap.bind( gamepad, btn_x, altTrigger );
moveMap.bind( gamepad, btn_a, jumpOrStart );
moveMap.bind( gamepad, btn_b, mouseFire );
moveMap.bind( gamepad, rtrigger, mouseFire );
moveMap.bind( gamepad, ltrigger, jumpOrStart );
moveMap.bind( gamepad, rshoulder, altTrigger );
moveMap.bind( gamepad, lshoulder, altTrigger );
moveMap.bindCmd( gamepad, back, pauseToggle(1);, );
moveMap.bindCmd( gamepad, start, pauseToggle(0);, );
moveMap.bindCmd( gamepad, btn_y, togglePlayerListLength();, );
moveMap.bind( gamepad, xaxis, DN, -0.23 0.23, moveXAxisL );
moveMap.bind( gamepad, yaxis, DN, -0.23 0.23, moveYAxisL );
moveMap.bind( gamepad, rxaxis, D, -0.23 0.23, gamepadYaw );
moveMap.bind( gamepad, ryaxis, D, -0.23 0.23, gamepadPitch );
//moveMap.bind( gamepad, zaxis, D, -0.23 0.23, gamepadYaw );
//moveMap.bind( gamepad, rzaxis, D, -0.23 0.23, gamepadPitch );
//moveMap.bind( gamepad, btn_y, spawnStupidMarble );
}
the 0.23 refers to the deadzone. xInput was removed from MBO and I suspect that's why it crapped out on the controller. Anyway you'll find a number of those inputs not possible in MBG since it's not in the engine so you'll need joy2key.
Edit: I don't remember seeing DeadZone in MBU/O anywhere else... I'll search though.
"matan, now i get what you meant a few years back when you said that "the level in mbg is beyond me" after the last rampage i noticed things were insane, and now i truly feel that too" - Dushine, 2015.