Author Topic: Gamepad compatibility script for BL  (Read 1608 times)

I have downloaded a script for Blockland a while ago that basically optimized the Xbox controller for Blockland. I have lost that add-on and searched long and hard yet no avail. Is there any chance that you guys may have the script up for download so that I may use it?

You can use an Xbox controller for Blockland? :o

Is it possible with a PS3 controller too?

I have downloaded a script for Blockland a while ago that basically optimized the Xbox controller for Blockland. I have lost that add-on and searched long and hard yet no avail. Is there any chance that you guys may have the script up for download so that I may use it?

you should have this in the suggests and requests forum sorry :l

You can use an Xbox controller for Blockland? :o

Is it possible with a PS3 controller too?
No you can't use it for PS3 controller unless you download a driver for it. Playstation equipment isn't optimized for PC.

I'll look and see if I have it.

No you can't use it for PS3 controller unless you download a driver for it. Playstation equipment isn't optimized for PC.
DS3 Tool is the best PS3 controller driver. It works with the 6-axis motion, the controller lights, vibration, and actually makes it work like a controller instead of a keyboard/mouse emulator.

you should have this in the suggests and requests forum sorry :l
The add-on has already been made. Why would I suggest/request someone to create something that's already created?






Here's the code you're looking for.
Sorry that it's not in add-on format. I kinda ripped it apart and kept the old code in a text file.

Code: [Select]
$Pref::Input::JoystickDeadZone = "-0.26 0.26";
$Pref::Input::JoystickEnabled = true;
$Pref::Input::JoystickInvert = false;
$Pref::Input::JoystickSensitivity = 0.1;
$Pref::Input::JoystickSouthPaw = false;

if($Pref::Input::JoystickEnabled)
enableJoystick();

function joystickMoveX(%val)
{
if(%val > 0)
{
$mvRightAction = %val * $movementSpeed;
$mvLeftAction = 0;
}
else
{
$mvLeftAction = -%val * $movementSpeed;
$mvRightAction = 0;
}
}

function joystickMoveY(%val)
{
if(%val > 0)
{
$mvBackwardAction = %val * $movementSpeed;
$mvForwardAction = 0;
}
else
{
$mvForwardAction = -%val * $movementSpeed;
$mvBackwardAction = 0;
}
}

function getJoystickAdjustAmount(%val)
{
   // based on a default camera FOV of 90'
   return(%val * ($cameraFov / 90) * $Pref::Input::JoystickSensitivity);
}

function joystickYaw(%val)
{
if(%val > 0)
{
$mvYawLeftSpeed = getJoystickAdjustAmount(%val);
$mvYawRightSpeed = 0;
}
else
{
$mvYawRightSpeed = getJoystickAdjustAmount(-%val);
$mvYawLeftSpeed = 0;
}
}

function joystickPitch(%val)
{
if($Pref::Input::JoystickInvert)
%val = -%val;

if(%val > 0)
{
$mvPitchUpSpeed = getJoystickAdjustAmount(%val);
$mvPitchDownSpeed = 0;
}
else
{
$mvPitchDownSpeed = getJoystickAdjustAmount(-%val);
$mvPitchUpSpeed = 0;
}
}

function joystickFire(%val)
{
if(%val < 0)
{
$mvTriggerCount0++;
}
else if(%val > 0)
{
$mvTriggerCount4++;
}
else
{
$mvTriggerCount0 = 0;
$mvTriggerCount4 = 0;
}
}

function joystickShowPlayerList(%val)
{
if(%val)
Canvas.pushDialog(NewPlayerListGui);
else
Canvas.popDialog(NewPlayerListGui);
}

function joystickToggleEscapeMenu(%val)
{
if(%val)
escapeMenu.toggle();
}

if($Pref::Input::JoystickSouthPaw)
{
moveMap.bind(joystick, "rxaxis", "D", $Pref::Input::JoystickDeadZone, joystickMoveX);
moveMap.bind(joystick, "ryaxis", "D", $Pref::Input::JoystickDeadZone, joystickMoveY);
moveMap.bind(joystick, "xaxis", "D", $Pref::Input::JoystickDeadZone, joystickYaw);
moveMap.bind(joystick, "yaxis", "D", $Pref::Input::JoystickDeadZone, joystickPitch);
}
else
{
moveMap.bind(joystick, "xaxis", "D", $Pref::Input::JoystickDeadZone, joystickMoveX);
moveMap.bind(joystick, "yaxis", "D", $Pref::Input::JoystickDeadZone, joystickMoveY);
moveMap.bind(joystick, "rxaxis", "D", $Pref::Input::JoystickDeadZone, joystickYaw);
moveMap.bind(joystick, "ryaxis", "D", $Pref::Input::JoystickDeadZone, joystickPitch);
}

moveMap.bind(joystick, "zaxis", "D", $Pref::Input::JoystickDeadZone, joystickFire);

moveMap.bind(joystick, "button0", plantBrick);
moveMap.bind(joystick, "button1", openBSD);
moveMap.bind(joystick, "button2", useBricks);
moveMap.bind(joystick, "button3", useTools);
moveMap.bind(joystick, "button4", shiftBrickDown);
moveMap.bind(joystick, "button5", shiftBrickUp);
moveMap.bind(joystick, "button6", invLeft);
moveMap.bind(joystick, "button7", invRight);
moveMap.bind(joystick, "button8", RotateBrickCCW);
moveMap.bind(joystick, "button9", RotateBrickCW);

moveMap.bind(joystick, "lpov", shiftBrickLeft);
moveMap.bind(joystick, "rpov", shiftBrickRight);
moveMap.bind(joystick, "upov", shiftBrickAway);
moveMap.bind(joystick, "dpov", shiftBrickTowards);

You can use an Xbox controller for Blockland? :o

Is it possible with a PS3 controller too?
Ive done it.

Now, someone make one for the Nintendo 64 controller!

Why does Nintendo have to use their own special connections instead of standard USB stuff.

And here's an idea I will post in requests later, control Blockland with a Guitar Hero/Rock Band Guitar, just for the hell of it.

Now, someone make one for the Nintendo 64 controller!

Why does Nintendo have to use their own special connections instead of standard USB stuff.

And here's an idea I will post in requests later, control Blockland with a Guitar Hero/Rock Band Guitar, just for the hell of it.
Nintendo uses standard Bluetooth stuff. Ninty64/GameCube are from the "let's invent propretariary plugs for everything" era; both Xbox (the original) and PS1/2 had propretariary plugs too.