Machsupport Forum

Mach Discussion => Mach4 General Discussion => Mach4 Plugins => Topic started by: daffyduck on December 29, 2022, 03:43:20 PM

Title: XBox 360 Plugin - Can't get it to work or recognize
Post by: daffyduck on December 29, 2022, 03:43:20 PM
Hello All,

Trying to use the plugin made by @dazthegas for the XBox 360 Controller.  Have some weird issues, wondering if someone can give some advice.  I have the plugin in the plugins directory.  I can activate the plugin from the Configure -> Control->Plug in menu. However here is where it gets a bit weird for me.  I do NOT see the plugin under Configure->Plugins.  Also it does not show me that the XBox 360 Controller is active in the message bar. I am on Windows 10 running the latest version of Mach4.  Another weird thing is that if I check the controller from Diagnostic->Regfile it DOES show signals from the controller.  I am sure it is something simple, but I can't seem to figure this one out.  I've reinstalled, restarted, etc... no joy. 

Thanks!
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: JohnHaine on December 30, 2022, 02:40:43 AM
I use the controller with Mach3 under Win10 and found that you need to reinstall some windows components (ActiveX?) that Win10 doesn't normally have.  This came up recently and I posted a link to the fix iirc.
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: JohnHaine on December 30, 2022, 03:42:32 AM
See this post...
https://www.machsupport.com/forum/index.php?topic=45733.msg290465#msg290465
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: daffyduck on December 30, 2022, 09:10:06 AM
Thank you very much for the reply JohnHaine!  I am proceeding as suggested however after the DirectX install I cannot find "xbox.dll".  Where is that file?  Thanks.
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: JohnHaine on December 30, 2022, 10:08:57 AM
Attached photo may help - it's in the Mach3 plugins folder, may be different for Mach4.  There is a copy in my downloads folder so I presumably downloaded it from somewhere...
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: daffyduck on December 30, 2022, 10:25:17 AM
I can't find that file anywhere on my computer.  Searching Google for the exact filename ....
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: JohnHaine on December 30, 2022, 10:29:37 AM
I could send you a copy?
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: daffyduck on December 30, 2022, 10:34:39 AM
That would be awesome.  Thanks for the offer.  Can we do it here or in a PM?
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: daffyduck on December 30, 2022, 10:35:35 AM
I am wondering if it is a native Windows dll or something DazTheGas made?
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: daffyduck on December 30, 2022, 10:41:52 AM
I found it on the Mach3 Plugins page :-). 
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: daffyduck 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
Title: Re: XBox 360 Plugin - Can't get it to work or recognize
Post by: daffyduck 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")