Use your joystick with spring

Use your joystick with spring

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Use your joystick with spring

Post by Auswaschbar »

What do you need:
  • a recent version of spring
  • any joystick device: including gamepads, wheels etc.
How to do?
See attached sample widget:
joy_test.lua
(1.28 KiB) Downloaded 212 times
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Use your joystick with spring

Post by Pxtl »

Is it support for only one joystick, or could it be used for implementing an arcade-game in Spring using Lua?
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: Use your joystick with spring

Post by 1v0ry_k1ng »

yay

now all we need is an interior cockpit gadget and a tool that locks the players perspective to the units facing on aircraft
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Use your joystick with spring

Post by Auswaschbar »

  • in "FPS Camera", you can fly around with joystick (even throttle works)
  • in direct controlling ground units, you can rotate and pitch, throttle does not work here yet
  • didn't tested what happens with air direct control
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Re: Use your joystick with spring

Post by Sheekel »

Do you supposed this would work with a 3D connexion "space explorer" tool? http://www.3dconnexion.com/3dmouse/spaceexplorer.php

I've got one lying around at work, would be cool to use it in spring i guess
User avatar
Blue_Falcon
Posts: 155
Joined: 16 Oct 2008, 18:54

Re: Use your joystick with spring

Post by Blue_Falcon »

Wow, looks good!

But...
It doesn't react to any joystick events for me. I've enabled it, but the functions don't seem to be triggered properly. The joystick works in other programs.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Use your joystick with spring

Post by Auswaschbar »

Sheekel wrote:Do you supposed this would work with a 3D connexion "space explorer" tool? http://www.3dconnexion.com/3dmouse/spaceexplorer.php

I've got one lying around at work, would be cool to use it in spring i guess
Depends on the driver, if it is detected as mouse, gamepad or whatever else.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Use your joystick with spring

Post by Auswaschbar »

Blue_Falcon wrote:Wow, looks good!

But...
It doesn't react to any joystick events for me. I've enabled it, but the functions don't seem to be triggered properly. The joystick works in other programs.
Infolog should say some stuff about joystick. Please post.
User avatar
Blue_Falcon
Posts: 155
Joined: 16 Oct 2008, 18:54

Re: Use your joystick with spring

Post by Blue_Falcon »

Here's my infolog. I did a quick skim through, but the only thing I could find was information on the fact that it had loaded the widget.
Attachments
infolog.txt
(19.18 KiB) Downloaded 139 times
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Use your joystick with spring

Post by Auswaschbar »

Blue_Falcon wrote:Here's my infolog. I did a quick skim through, but the only thing I could find was information on the fact that it had loaded the widget.
With recent, I mean one of the development versions, its not in the release.
User avatar
Blue_Falcon
Posts: 155
Joined: 16 Oct 2008, 18:54

Re: Use your joystick with spring

Post by Blue_Falcon »

Oh. OK.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Use your joystick with spring

Post by imbaczek »

tested this, there roll control should be changed to yaw, or at least both should be added. currently the fps camera works rather weird.

also, there absolutely has to be a way of rebinding axes, my gamepad has z-axis inverted.
User avatar
Blue_Falcon
Posts: 155
Joined: 16 Oct 2008, 18:54

Re: Use your joystick with spring

Post by Blue_Falcon »

Sorry for necro.

It's working now, the joy_test.lua script works and registers all the events, but how can I configure this to control units in FPS mode or the camera?
User avatar
Blue_Falcon
Posts: 155
Joined: 16 Oct 2008, 18:54

Re: Use your joystick with spring

Post by Blue_Falcon »

No help? :(
User avatar
Blue_Falcon
Posts: 155
Joined: 16 Oct 2008, 18:54

Re: Use your joystick with spring

Post by Blue_Falcon »

Bump :|
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Use your joystick with spring

Post by Jazcash »

Could you list a few devices in which this works for? How about a standard Xbox 360 Controller?
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Use your joystick with spring

Post by Auswaschbar »

JAZCASH wrote:Could you list a few devices in which this works for? How about a standard Xbox 360 Controller?
Should work for any joystick or gamepad device.
Blue_Falcon wrote:It's working now, the joy_test.lua script works and registers all the events, but how can I configure this to control units in FPS mode or the camera?
Integrating it into any of the existing lua camera widgets should be easy. Using it to control engine camera or units isn't (or at least I don't know how).
User avatar
Blue_Falcon
Posts: 155
Joined: 16 Oct 2008, 18:54

Re: Use your joystick with spring

Post by Blue_Falcon »

Auswaschbar wrote:
JAZCASH wrote:Could you list a few devices in which this works for? How about a standard Xbox 360 Controller?
Should work for any joystick or gamepad device.
That you have the drivers for. :P
Auswaschbar wrote:
Blue_Falcon wrote:It's working now, the joy_test.lua script works and registers all the events, but how can I configure this to control units in FPS mode or the camera?
Integrating it into any of the existing lua camera widgets should be easy. Using it to control engine camera or units isn't (or at least I don't know how).
Ah, ok. :(
Thanks anyway :)
Rossendale
Posts: 2
Joined: 20 Apr 2010, 18:24

Re: Use your joystick with spring

Post by Rossendale »

Hey,
Ok, i put the lua in etc etc, and on running it in game - it registers my joystick, displaying inputted joystick movement on screen, yet does nothing to the map. It's the joystick of a Logitech G13 btw, if that helps at all

Also i don't know how to write lua for spring at the current time
User avatar
Sucky_Lord
Posts: 531
Joined: 22 Aug 2008, 16:29

Re: Use your joystick with spring

Post by Sucky_Lord »

Edit the infolog file into your post?
Locked

Return to “Lua Scripts”