morad Posted February 22, 2012 Share Posted February 22, 2012 HI Is there any reference on how to use joystick axis and buttons with lua scripting? couldn't find any on the wiki. Thanks Morad Quote Link to comment Share on other sites More sharing options...
Flexman Posted February 23, 2012 Share Posted February 23, 2012 There's no inherent support for Joystick devices, you would need to add your own (somehow). I only use LUA for simple animation. Joysticks and gaming devices tend to be tricky as they are harder to work cross-platform unless you use something like SDL (Simple Direct Media Layer) or Blitmax's own joystick functions and make those available via a shared LUA object. It does seem to be an oversight but nobody has yet asked for it to be added to the LUA interface. Regards Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 23, 2012 Share Posted February 23, 2012 Actually Diedir has put up this download in the asset store: http://www.leadwerks...-joystick-demo/ I haven't tried it though. Quote Link to comment Share on other sites More sharing options...
Andy Gilbert Posted February 23, 2012 Share Posted February 23, 2012 Just to confirm that the Lua Joystick Diedir has uploaded is for Xbox only controllers (should say really). Rick was working on one but not sure if hes had any luck. Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Canardia Posted February 23, 2012 Share Posted February 23, 2012 I think you can use XBOX controller on PC too, because I can use my PS3 controller on PC. I only installed a PS3 driver on my PC, and then it detects the PS3 controller like any ordinary joystick. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Mumbles Posted February 23, 2012 Share Posted February 23, 2012 I think you can use XBOX controller on PC too, because I can use my PS3 controller on PC. I only installed a PS3 driver on my PC, and then it detects the PS3 controller like any ordinary joystick. In the case of the xbox (360?) Windows won't take "advantage" (if you can call it that) of the two rumble motors (it will control them both as if they were one), and it will have that irritating "LT and RT are the same axis" thing... Unless you use xinput that is - in which case, both of those are possible... Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
Canardia Posted February 23, 2012 Share Posted February 23, 2012 Actually it does, when you use the SDL Haptic library. It supports also PS3 force feedback. Not sure if the driver supports it though, so maybe indeed some modification to the driver and/or haptic library is needed. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Flexman Posted February 23, 2012 Share Posted February 23, 2012 Well there you go, someone already wrote a third party package for LUA. To confirm yes it uses XINPUT.DLL (XBOX controller DLL). Thanks Aggror for pointing that out. (LUA Joystick Demo) Perhaps you can take the concept of the demo and use an SDL LUA package to get at all the SDL_Joystick functions you need. Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
morad Posted February 23, 2012 Author Share Posted February 23, 2012 I'm using the demo for now and don't have the permission to download. Can i still get the main idea? Quote Link to comment Share on other sites More sharing options...
Andy Gilbert Posted February 25, 2012 Share Posted February 25, 2012 Still though this isn't a joystick package? It is an Xbox only package and to only be able to distribute a windows game where the only input is a Xbox controller isn't the best option? I would love a lua generic joystick module, would try and do it myself if I was familiar with creating wrappers. Andy Quote The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do. Leadwerks Game-Ready 3D Models:https://sellfy.com/gib3d Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.