Hello Guest it is April 18, 2024, 03:06:28 PM

Author Topic: XBox 360 Plugin - Can't get it to work or recognize  (Read 1923 times)

0 Members and 1 Guest are viewing this topic.

Re: XBox 360 Plugin - Can't get it to work or recognize
« Reply #10 on: December 30, 2022, 03:11:18 PM »
Ok.  I am getting somewhere slowly.  I am using some debug output messages to trace the LUA script functionality.  For some reason, at least on my system, I need to explicitly define the number variable on both sides of an if statement operator.

For example, this does NOT work:
LTR_Val = GetXin("LTR_Val") --left trigger value 0-255
if LTR_Val > 0 then
   mc.mcCntlSetLastError(mInst,"LTR_Val not 0")
elseif LTR_Val == 0 then
   mc.mcCntlSetLastError(mInst,"LTR_Val 0")
end

However this DOES work:
LTR_Val = GetXin("LTR_Val") --left trigger value
if tonumber(LTR_Val) > tonumber(0) then
   mc.mcCntlSetLastError(mInst,"LTR_Val not 0")
elseif tonumber(LTR_Val) == tonumber(0) then
   mc.mcCntlSetLastError(mInst,"LTR_Val 0")
end
Re: XBox 360 Plugin - Can't get it to work or recognize
« Reply #11 on: December 30, 2022, 03:26:03 PM »
I also found that I have to first assign the trigger value to a variable before putting into a logical statement. Example:

LTR_Val = GetXin("LTR_Val")