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 196 times
0 x

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?
0 x

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
0 x

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
0 x

Sheekel
Posts: 1390
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
0 x

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.
0 x

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.
0 x

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.
0 x

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 129 times
0 x

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.
0 x

User avatar
Blue_Falcon
Posts: 155
Joined: 16 Oct 2008, 18:54

Re: Use your joystick with spring

Post by Blue_Falcon »

Oh. OK.
0 x

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.
0 x

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?
0 x

User avatar
Blue_Falcon
Posts: 155
Joined: 16 Oct 2008, 18:54

Re: Use your joystick with spring

Post by Blue_Falcon »

No help? :(
0 x

User avatar
Blue_Falcon
Posts: 155
Joined: 16 Oct 2008, 18:54

Re: Use your joystick with spring

Post by Blue_Falcon »

Bump :|
0 x

User avatar
Jazcash
Posts: 5302
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?
0 x

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).
0 x

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 :)
0 x

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
0 x

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?
0 x

Post Reply

Return to “Lua Scripts”