Live Chat

Controller support

The place to discuss all things Receiver.

Controller support

Postby Jack5500 » Fri Mar 07, 2014 4:17 am

It would be nice to play the game with a controller, since the control scheme would fit on there as well. I thought I'd open a thread here to discuss this, since I can't open an issue on github. I tried to implement it by myself, but seems be non-trivial.
Jack5500
 
Posts: 5
Joined: Tue Mar 15, 2011 2:57 pm

Re: Controller support

Postby APsychonaut » Sat Mar 08, 2014 3:47 pm

as a stop-gap, emacs?
APsychonaut
 
Posts: 56
Joined: Sun Feb 02, 2014 4:16 am
Location: A benificery of the 'glorious' US Empire.

Re: Controller support

Postby Thomason1005 » Sat Mar 08, 2014 4:22 pm

If you have the project opened in unity, you can reassign the keys in project settings -> input, but i dont know how the thumb sticks are handled
User avatar
Thomason1005
 
Posts: 713
Joined: Sat Apr 20, 2013 9:44 am
Location: GerMany

Re: Controller support

Postby Jack5500 » Sun Mar 09, 2014 4:11 pm

As mentioned I already tried to implement it and the current code coesn't support controllers per se.
The view sticks are not resseting which results in a strafing for the movement and view.
Jack5500
 
Posts: 5
Joined: Tue Mar 15, 2011 2:57 pm

Re: Controller support

Postby Thomason1005 » Tue Mar 11, 2014 9:05 am

i dont know how far you have it working so here goes how to do it:

the buttons are easiest, go to edit ->project settings -> input, then on the right simply put the controller button you want as alternate input:
Unbenannt.png
Unbenannt.png (18.66 KiB) Viewed 3001 times

the button numbers are like on this image: http://wiki.unity3d.com/index.php?title=Xbox360Controller

for the cam rotation first right-click the mouse x input and duplicate it, then change type to joystick axis and axis to x axis and maybe sensitiviy to 1 (never over 1! adjust it in the esc-screen or multiply it in the script) and dead zone to 0.1
then do the same with the y axis
for walking, duplicate these and set the axis to 4th and 5th, i named them "Controller Vertical" and "Controller Horizontal"
you should check the invert checkbox on controller y and controller vertical
Screenshot 2014-03-11 14.52.10.png


they dont work yet, you have to grab these inputs in the script.
go on the bottom left to scripts, them open aimscript and search for "mouse x"

you have to add the controller axis so you add
Code: Select all
      rotation_x += Input.GetAxis("Controller X") * sensitivity_x;
      rotation_y += Input.GetAxis("Controller Y") * sensitivity_x;

beneath the mouse axis lines

and a few lines beneath
Code: Select all
         view_rotation_x += Input.GetAxis("Controller X") * sensitivity_x;
         view_rotation_y += Input.GetAxis("Controller Y") * sensitivity_x;


for walking, go in FPSInputController.js and replace line 15 with
Code: Select all
   var directionVector = new Vector3(Input.GetAxis("Horizontal")  + Input.GetAxis("Controller Horizontal"), 0, Input.GetAxis("Vertical") + Input.GetAxis("Controller Vertical"));


save your script files and run the game, it should be working now

running doesnt work like this, maybe map the alternate positive button in horizontal input to a controller button, then you can tab it quickly to run

if you tell me where you want which buttons ill add these to my receiver mod.
User avatar
Thomason1005
 
Posts: 713
Joined: Sat Apr 20, 2013 9:44 am
Location: GerMany

Re: Controller support

Postby Timbles » Wed Mar 12, 2014 8:05 pm

There's also a program called JoyToKey which enables Gamepad to Keyboard/Mouse input.
User avatar
Timbles
Overgrowth Modder Deluxe
 
Posts: 2387
Joined: Sat Mar 17, 2012 2:05 pm

Re: Controller support

Postby Thomason1005 » Thu Mar 13, 2014 12:27 am

Timbles wrote:There's also a program called JoyToKey which enables Gamepad to Keyboard/Mouse input.

yeah but you wouldnt have to do all the things which would be kindof lame
User avatar
Thomason1005
 
Posts: 713
Joined: Sat Apr 20, 2013 9:44 am
Location: GerMany

Re: Controller support

Postby C00NT0NE » Fri Apr 25, 2014 12:42 am

As mentioned, the camera stick can't function. I just used my PS3 controller (setup by MotionInJoy,) and I enabled the automatic camera option, so I was always looking in the direction I was moving. It was just taste, but I can tell that I'll like this game more with the controller support!
User avatar
C00NT0NE
 
Posts: 1
Joined: Sun Jan 26, 2014 3:48 pm


Return to Receiver

Who is online

Users browsing this forum: No registered users and 2 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group