DJ_GLiTCH Posted March 11 Posted March 11 I just wanted to share my project with everyone that aims to add light gun force feedback to a bunch more MAME games via LUA script and is compatible with Mamehooker and Hook Of The Reaper (preference is to use HOTR as that is what I'm personally more familiar with). It operates under a universal script I made that has enough settings to be useful for any game, so the community can use it and add support for more games, which I can add into future releases. The list of supported games is available in the "Progress Notes" text file on GitHub, and in the release description. Please read the GitHub readme for more details. It's still in the final beta testing phase, but it should be finalised very soon. I hope the community finds it useful. https://github.com/djGLiTCH/MAME-LUA-SCRIPT-STATE-OUTPUTS 3 1 Quote
Emiel Posted March 14 Posted March 14 Thanks for your work. Now i use co pilot to understand all this. He told me that i need a special Version of mame to let the recoil work. He made this message for me Quick question for the HOTR users here: > > I’m looking for the HOTR‑compatible MAME build (0.250 or 0.253) that includes the output_lua plugin and the scripts folder. > > Specifically the version that has: > > - plugins/output_lua/ > - scripts/*.lua (Duck Hunt, Point Blank, Area 51, etc.) > - support for -output lua > - recoil / hit‑rumble events for HOTR > > I’ve already tried several packs (RetroBat, Sinden builds, MAMEGUN, 0.259LG, etc.), but none of them include the HOTR plugin. > > I only need the standalone MAME folder (around 200–300 MB), not a full pack. > > If anyone has the HOTR‑MAME 0.250 or 0.253 build and could share it with me, I’d really appreciate a DM. > > Thanks in advance! Do you know if this is wat u really need to let mame work? Quote
DJ_GLiTCH Posted March 14 Author Posted March 14 No worries, hope you enjoy it. Not all games/ROMs in MAME require these LUA scripts to enable recoil/rumble in light gun games, only some. What you need is any version of MAME, but I always recommend the latest version (currently 0.285), a tool called Hook Of The Reaper (HOTR), which is needed to communicate between games and your light guns to control recoil/rumble/etc, and then my files, which enable support for games/ROMs in MAME that don't typically support recoil/rumble. To install my scripts, you just need to copy the relevant files into the relevant MAME and HOTR folders, which are already in the correct folder location in the downloaded file. Hope this helps. 1 Quote
Emiel Posted March 14 Posted March 14 Thanks for your reply! Co pilot is saying that the lua scripts will only work if i have a Version of mame with the output_lua plugin. Or is co pilot wrong in this? Quote
DJ_GLiTCH Posted March 14 Author Posted March 14 Copilot is wrong. You just need the tools I mentioned earlier, and to ensure you have set "output network" in your mame.ini file. Quote
Emiel Posted March 14 Posted March 14 Thanks! I already noticed it. It works perfect! Thanks for all the effort 1 Quote
DJ_GLiTCH Posted March 15 Author Posted March 15 Glad to hear it's working. I just released a new version today as well, so please be sure to use the latest files as they include a few bug fixes. 👍 Quote
Benoid Posted April 4 Posted April 4 (edited) Thanks so much DJ, this is great and opens up a bunch of lightgun games for my Launchbox cab that I’d not added as they’re not the same without proper recoil. One minor issue (which may be be using HOTR and the Reapers wrong) is that for my game.txt files I add in a line after the to ensure the Reapers are set to the right aspect ratio each time (>AspectRatio_4:3) but if I do this using your scripts then I get an error for an unexpected line. Is there an easy way for me to fix that? It’s not a major issue and the scripts work perfectly otherwise but thought I’d ask. Edited April 4 by Benoid 1 Quote
DJ_GLiTCH Posted April 4 Author Posted April 4 Thanks @Benoid, appreciate the feedback. Would you mind elaborating on what you mean by the game.txt file? If you can take some screenshots and share an example that will help me understand what you mean, cheers. Quote
Benoid Posted April 4 Posted April 4 Hi, Yes sorry that wasn’t clear. I just mean the HOTR file for whichever “game” so in my example if I try to add the aspect-ratio command into the duckhunt.txt file it then outputs that error when the script runs and doesn’t hook the lightguns Quote
DJ_GLiTCH Posted April 5 Author Posted April 5 The txt files that go into your HookOfTheReaper\defaultLG folder are not meant to be edited, as the only commands that should exist within these files are already included. When it comes to aspect ratios, I have a 4k monitor (16:9), and I just set MAME to automatically adjust the aspect ratio depending on the game. That way the calibration for my monitor remains 16:9 at all times, and when a game has a native 4:3 ratio MAME will automatically display the game in 4:3 aspect ratio and create "black" borders (and you can use bezel artwork to fill in the black borders using game specific artwork). Is the aspect ratio something you used to use before, or are you just trying to implement it for the first time? By default you should be good to go with MAME, as I've never had to touch the aspect ratio settings at all. Quote
Benoid Posted April 5 Posted April 5 Thanks DJ that makes sense on the files. My emulators are all set up correctly in terms of aspect ratio and bezels, the AspectRatio command just sets the aspect ratio for the Reaper guns. If not set correctly then the aiming is off as you move to the edge of the screen in MAME. I reckon I can find away around this via an AHK script or possibly my MAME settings as you say. Thanks again for the files, very cool to have recoil working for Area51 and Lethal Enforcers in particular. Quote
DJ_GLiTCH Posted April 6 Author Posted April 6 @Benoid I've just read up on the HOTR documentation for commands (https://hotr.6bolt.com/pmwiki.php/GameFiles/Commands), and maybe you can try this for aspect ratio to see if it helps: AspectRatio_16:9 This command tells the light gun that the screen aspect ratio is 16:9. Usually used right after ‘Open_COM’ or right before ‘Close_COM’. AspectRatio_4:3 This command tells the light gun that the screen aspect ratio is 4:3. Or simulating a 4:3 screen on a 16:9 screen. Usually used right after ‘Open_COM’ or right before ‘Close_COM’. I have attached an example for duckhunt and lethalen which uses the command ">AspectRatio_4:3" and they don't crash for me. If you could let me know if this works and improves the gameplay, I can update the other defaultLG files for the other games. duckhunt.txt lethalen.txt Quote
Benoid Posted April 6 Posted April 6 (edited) Thanks DJ, this worked perfectly for me. Not sure what was different to when I added that command in the .txt file but clearly I was doing something wrong. It might be I was also using an older version of MAME before but anyway all working as expected now with accurate 4:3 aiming in MAME! Edited April 6 by Benoid Quote
DJ_GLiTCH Posted April 6 Author Posted April 6 (edited) Thanks @Benoid for letting me know. Could you confirm if this change was needed in the end to fix your aiming precision, as well as let me know what version of MAME you were/are using? I'll need to test this change with some other users (to confirm it doesn't negatively impact Sinden users, etc.), but for now you can update your defaultLG files to use the attached version (which includes the ">AspectRatio_4:3" change). I'll be uploading another major update within the next few days, so please check my GitHub page every now and then to make sure you get the latest version. All of the tweaks and bug fixes to the underlying script are just about complete, and there's a few rom specific fixes as well. 🙂 defaultLG (Universal MAME LUA Script) - 2026.04.06.zip Edited April 6 by DJ_GLiTCH Quote
DJ_GLiTCH Posted April 8 Author Posted April 8 @Benoid I have just released the latest version on GitHub, if you wouldn't mind confirming whether this works better for you now and whether the aspect ratio command is needed in the defaultLG files for HOTR still or not? Many thanks in advance. Quote
bandicoot Posted Saturday at 06:21 PM Posted Saturday at 06:21 PM thanks a lot for your work i ask you on github for some other game , and you give me answer i post here it's better than an issue ^^ DO you think you could make better output for supermodel3 ? i know we can make LUA on this emulator but i don't have skill for that One more time thanks for your work Quote
DJ_GLiTCH Posted Monday at 05:12 AM Author Posted Monday at 05:12 AM (edited) On 4/19/2026 at 4:21 AM, bandicoot said: DO you think you could make better output for supermodel3 ? i know we can make LUA on this emulator but i don't have skill for that For Supermodel3, they need to enable network output support for states first, which I believe is being added natively via the following pull request: Add network output compatible with MAME. by tbreckle · Pull Request #303 · trzy/Supermodel (https://github.com/trzy/Supermodel/pull/303) As for which games do and don't support state outputs natively for Model 3, that I'm unsure of, and I don't know if Supermodel3 supports LUA scripts in the same manner as MAME (or if it does at all). I will look into this in the future, but for now I think it'd be best for me to focus on finishing all MAME games first before looking into Supermodel3 games. If you know that LUA scripts are supported in Supermodel3 then I can maybe take a look at things sooner, but it'd take a lot of time for me to learn how to map memory addresses in a different emulator environment and make sense of what I'm looking at, so I wouldn't expect anything for this anytime soon unfortunately. Edited Monday at 05:13 AM by DJ_GLiTCH Quote
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.