Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Mamehooker Settings For positional gun recoils (Steel Gunner Hammer Guns)  (Read 4048 times)

0 Members and 1 Guest are viewing this topic.

frankrizzo2

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 38
  • Last login:Yesterday at 01:39:53 pm
  • I want to build my own arcade controls!
I've got 2 guns out of a Steel Gunner cab that are positional guns with 24v recoils on them. I'm using the PacDrive to drive some solid state relays which are switching power to the 24v solenoids in the gun. I am also using the APac for the positional data for aiming the guns. The question that I have is with Mamehooker. I went through the tutorial and was able to get T2 on Mame to output the machine guns effects properly to the guns and it works really well. Now when I try to use the same effects on Revolution X it is a very faint effect and the gun is not recoiling like it should. Its very week and even when watching the debug screen in Mamehooker the "0's" and "1's" are not as distinct as T2. I have the ini files set up as "Left_Gun_Recoil=uls 1 1%s%" and every other spot left blank on both games. I've been scouring the internet for 3 days trying to find the answer and I'm having a hard time finding any resolve. Maybe I'm missing a setting in Mamehooker or have overlooked something. Any help is appreciated.

revx.ini
[General]
MameStart=
MameStop=
StateChange=
OnRotate=
OnPause=
[Output]
Player1_Gun_Recoil=uls 1 1 %s%
Player2_Gun_Recoil=
Player3_Gun_Recoil=
Player1_Gun_LED=
Player2_Gun_LED=
Player3_Gun_LED=
[KeyStates]
RefreshTime=

frankrizzo2

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 38
  • Last login:Yesterday at 01:39:53 pm
  • I want to build my own arcade controls!
I haven't made any progress yet and am still trying to figure out where my issue is at. It's either the fact that I'm using the wrong output mapping in Mamehooker or some setting that I'm not seeing. I've went through the tutorials about 5 times but isn't a ton of information on driving solenoids or gun recoils so I'm doing a little trial and error right now.

Here is a video of how it is working in T2.



Here is a video of how the same gun is working in Revolution X. It's almost like Rev X pulses so fast that the gun doesn't have a chance to take the full charge.
I am using a 24v Laptop style power supply to feed the power through the Solid State Relay to the Steel Gunner Guns.



Any help is appreciated. I'm running on Windows 10 Pro so I'm not sure if that has anything to do with it either?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
It's working just fine.  The problem is you aren't using a RevX gun... I hooked that driver up in mame myself and it fires crazy fast.  Adding a very short wait command (like 10 or less) after your pacdrive command might help, but no guarantees. 

frankrizzo2

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 38
  • Last login:Yesterday at 01:39:53 pm
  • I want to build my own arcade controls!
Thank you!! The wait command definitely helped. I had to get up to "wat 20" to give it enough time to make a full stroke. I think I may try a weaker spring on my solenoid and see if that helps the speed.

New Output ini:
 revx.ini
[General]
MameStart=
MameStop=
StateChange=
OnRotate=
OnPause=
[Output]
Player1_Gun_Recoil=uls 1 1 %s%,wat 20
Player2_Gun_Recoil=
Player3_Gun_Recoil=
Player1_Gun_LED=
Player2_Gun_LED=
Player3_Gun_LED=
[KeyStates]
RefreshTime=

So now my next questions are:

How do I make it recoil on the games that are fully on (stuck on 1 instead of pulsing) when pulling the trigger such as Alien3 :The Gun? I'm assuming that I'm going to need to use the "wat" command again?

What do the script functions do in Mamehooker? I did some looking in them and see similar commands as the ini's but I guess I'm unsure on the purpose of them. 

On games without recoil can I create an gamename.ini where it shoots 1 time each time I pull the trigger? (time crisis, area 51, carnevil, etc)

That's all I have for questions for mamehooker for now. The next thing I need to figure out is why TS2 crashes when I hit the player 2 start button on Model 2 but 1 step at a time.

Thanks

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Scripts are there for a few reasons... so you can do a loop (for lighting control panels, a strobe or something similar) and so you can reuse a complicated set of functions across multiple games.  I believe I include a script for strobing an input, but just in case I didn't, yes you make use of the wait command again along with a looping script called via the loop script function. 

You'd do something like this inside the script:

uls 1 1 %s%
wat 10
uls 1 1 0

So basically it sets the state (on or off) waits 10 ms, turns it off (of course if the state was zero it'll do nothing, but this keeps the loop consistent) and then starts the whole thing over again.  If you have multiple guns, it's best to do them both in the same loop, so it'd be something like this:

uls 1 1 %Player1_Gun_Recoil%
uls 1 2 %Player2_Gun_Recoil%
wat 10
uls 1 1 0
uls 1 2 0

Note that in the above example I used the specific output names, which should also work.  If you run into issues let me know... I don't get a lot of feedback on advanced script usage so there could always be a bug or two and I'm on the verge of a new release so now would be the time to let me know. 

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:August 19, 2021, 01:12:24 pm
  • I want to build my own arcade controls!
It looks like the frequency is too high for your solenoid in that second video. That's what happens when the solenoid gets reactivated before it has traveled all the way back. A stronger spring may help but could cause problems on other games. Have you oiled the solenoid piston? That helps too.

My suggestion is to set it up to recoil at the same speed for every game. I.e. Make it how you like it instead of trying the impossible task of recreating the feel of the original arcade gun's recoil for every game with a single gun. A large portion used a motor instead of a solenoid.

I don't use mame hooker but if it lets you copy a recoil frequency and use it for every game, that would be the way to go. Ideally, you would be able to set it to recoil when you pull the trigger, not just when hooks are available. I achieve this with a $7 Ne555 board off ebay like this:

https://www.ebay.com/itm/NE555-Pulse-Frequency-Duty-Cycle-Square-Rectangular-Wave-Signal-Generator-MoNJH/114063259273?epid=1881291624&hash=item1a8eb33689:g:XU0AAOSwJshc~z9G

It let's you set it up once how you like it and then not worry about it again.

There are tons of games that benefit from recoil even if the original arcade didn't have it. Try playing Afterburner with your gun. Recoil will make it feel like a whole new game.


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Eh, you can't really adjust the frequency, you can merely fudge it a little with wait commands.  A constant on/off can of course be adjusted, but something that's already strobing on and off is difficult to manipulate  It's pretty easy to make it slower, but making it faster is impossible. 

You can use the keystate detection option to have something fire off whenever a keyboard key or mouse button is held, but it isn't really setup for dual guns or joysticks unfortunately.  Troubleshooter is supposed to be the solution for that, and yes, a person could write a troubleshooter config for a mame game in theory. 

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 619
  • Last login:August 19, 2021, 01:12:24 pm
  • I want to build my own arcade controls!
This is why I prefer to use the ne555 board for full auto recoil. If I want it faster or to recoil more or less often, I just turn one of the pots on the board. It's infinitely adjustable. Obviously there is a natural upper limit because once it gets above 45-50hz then it doesn't have time for the solenoid piston to get back before being activated again.

The Aimforce dongle allows variable recoil speed on a game by game basis. You just select the game in the app, choose full auto recoil and adjust the slider until it gets to the speed you want. It let's you do this either in conjunction with the hooks from mame, or independent of hooks so it works with games that had no recoil.

Being able to increase or decrease the recoil frequency is necessary to get good results for all games with a single gun's recoil mechanism.


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
It's not necessary and you get better feedback with full game control, but you do you man. 

frankrizzo2

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 38
  • Last login:Yesterday at 01:39:53 pm
  • I want to build my own arcade controls!
Thanks for the information guys. It's helping me get through some of this. I will work on it tmw when I have time and if I have anymore questions I'll be sure to ask.

Is there a certain language that these scripts are written in so that I can research commands on my own? It's a skill that I am trying to get better at understanding anyways and I would love to contribute more in the future on some of this stuff too.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
It's just something I made up to work with mamehooker.  Documentation is in the readme.txt and the website.  Scripts are the exact same mamehooker commands you do in the ini files, only functions are separated by a new line instead of a comma. 

frankrizzo2

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 38
  • Last login:Yesterday at 01:39:53 pm
  • I want to build my own arcade controls!
Okay. Thanks for the info Howard! I'll mess with it today.

frankrizzo2

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 38
  • Last login:Yesterday at 01:39:53 pm
  • I want to build my own arcade controls!
Re: Mamehooker Settings For positional gun recoils (Steel Gunner Hammer Guns)
« Reply #12 on: February 12, 2020, 01:07:46 am »
So what's the best way to use the loop function? Do I use the lfs and call up a prewritten script? I have one made up that I'll post tmw and I think I have it correct but I want to make sure. I need to add delay between every "on" "off" so do I set it to fire on, wat 20, fire off, wat 20, fire on, wat 20? I want a consistent delay between each "on" "off" shot that the gun fires if that makes sense?