Scripts / xbox controller variable not defined in global.lua ?

Author
Message
SAR1
6
Years of Service
User Offline
Joined: 9th Jun 2017
Location:
Posted: 5th Apr 2018 23:17
A while back I posted in in the bugs subforum but it may have been missed or I was in the wrong place, but I still haven't resolved the issue described below:

When attempting to connect a wireless xbox 360 controller to use in gameguru I encounter the following error on script initialisation:

.\scriptbank\gameplayercontrol.lua: 553: attempt to call global 'JoystickTwistY' (a nil value)

the apparently offending line is:

ttjoyroty=((JoystickTwistY()+0.0)-32768.0)/32768.0

Having looked in my global.lua, JoystickTwistX (and Z) is defined but not JoystickTwistY which seems to be the cause ?

I'm not certain whether this is a bug or an error on my part (apologies if it's the latter).

Many thanks for any help in advance.

I'm runing build 2017.05.12 of Gameguru on the following:

Windows 7 Pro 64-bit. Sp. 1
Intel Core i7-4790 @ 3.6GHz
16 Gb HyperX RAM
NVidia GTX 970
DirectX ver. 11

Setup.ini is configured:

xbox=1
xboxinvert=0
xboxcontrollertype=0
PM
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 6th Apr 2018 13:24
The Xbox controller support is very rudimentary, not full support and only works with certain types of XBox controller (they're not all the same), i know it was working fine with my Microsoft XBox One wired controller a while back but not with my non-branded version of the same controller.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 6th Apr 2018 15:09
Did you try adding the function yourself?
Just copy the existing X or Z and change it to Y (in both the function name and the send message if needed).
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
SAR1
6
Years of Service
User Offline
Joined: 9th Jun 2017
Location:
Posted: 6th Apr 2018 23:14
Thanks for the replies.

I don't think this is a controller-specific issue as the error relates to an undefined variable or function. As Smallg suggested I had already tried copying and pasting one of the existing 'X' and 'Z' lines, replacing the respective character with a 'Y' but to no avail as I've now noticed that all of the direct call LUA commands are block rem'd out, including the other two JoyStickTwistX and 'Z'). I now don't know if these are defined in another setup script somewhere or embedded deeper in GG ?

I honestly can't recall if this ever worked for me in the past but other people must have used the controller function at some point so I wonder if I've somehow got a different version of whatever script holds the function definitions ?
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 7th Apr 2018 22:55 Edited at: 7th Apr 2018 23:11
just checked and it's there for me (the direct calls are remmed out, that is ok).
Quote: "JoystickTwistX: JoystickTwistX() -- command used by the default player control mechanism
JoystickTwistY: JoystickTwistY() -- command used by the default player control mechanism
JoystickTwistZ: JoystickTwistZ() -- command used by the default player control mechanism"

interestingly your gameplayercontrol.lua may be wrong too as the JoystickTwistY() is found on line 583, not 553 - or a mistake on your post?
just tested and my wireless controller doesn't really work but it doesnt error out, just kinda slowly looks up into space and doesn't support any input... though i have no idea which controller mode i'm supposed to use.
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
SAR1
6
Years of Service
User Offline
Joined: 9th Jun 2017
Location:
Posted: 8th Apr 2018 14:33
Thanks for looking into this Smallg.

I think we may indeed have different versions of both scripts. I currently have those from version 2017.05.12, are you using the latest public beta perhaps ?
I have double checked and 'ttjoyroty=((JoystickTwistY()+0.0)-32768.0)/32768.0' is on line 553 of my gameplayercontrol.lua

in global.lua on lines 1465 & 1466 I have:

JoystickTwistX: JoystickTwistX() -- command used by the default player control mechanism
JoystickTwistZ: JoystickTwistZ() -- command used by the default player control mechanism

Out of curiosity I replaced all reference to JoyStickTwistY() with 'Z' in part at least to see if it was the only undefined variable causing the script to bug out and indeed it runs without error (but unsurprisingly results in the player camera rotating upward and spinning around on it's vertical axis.)

The Setup.ini config I have been using is:

xbox=1
xboxinvert=0
xboxcontrollertype=0
PM

Login to post a reply

Server time is: 2024-04-19 19:20:42
Your offset time is: 2024-04-19 19:20:42