Issues with Sinden light guns, DemulShooter, Model2, and RocketLauncher

slizzap

Member
RL Member
Hey guys,

I'm working on my latest project using Sinden light guns and running into a problem when running the DemulShooter/Model2 combo with RocketLauncher. I had a fully functional setup using Aimtraks, and the DemulShooter/Model2 combo worked perfectly fine...so this is something new after I switched to the Sindens.

I installed the Sinden software, and have it fully tested and working for 1 light gun. With the Sinden software running in the background, I next got the Model2 emulator working using House of the Dead (hotd) as my test game. Deleted my input file since that was configured for the Aimtraks, reset the controls for the Start/Coin buttons, then launched a game and did the Service menu calibration for the gun. Then played a test game...everything is working as it should.

Next up I reconfigure my existing Demulshooter installation (v10.1.5). All I had to do was run DemulShooter_GUI, select P1 Configuration, set the new ID of the Sinden gun, test the input (successfully), and save settings. I then run the command line for DemulShooter (tray icon showing red), then run Model2 (tray icon showing green - locked on)...everything still working exactly as it should.

Finally I simply launch House of the Dead from RocketLauncher. No changes should be necessary here...House of the Dead still configured for Model2 emulator with DemulShooter enabled. However, running the game, it doesn't detect any input from the gun...movement or trigger. The RL log shows that it's running DemulShooter properly, and calling the Model2 emulator...in the same manner that I did manually from command line. Interestingly enough, if I Ctl-Alt-Del to the desktop, I'll see the DemulShooter icon in the tray and it's green...running and locked on. If I change the RocketLauncher setting to disable DemulShooter for House of the Dead, everything works exactly as it should with gun input (movement and trigger) working perfectly. However, I need DemulShooter running for the 2nd player to work...which is the next step after getting all this sorted.

As a test, I also did the following:
1) Disabled DemulShooter for House of the Dead in RL settings
2) Manually ran DemulShooter from the command line (tray icon showing red)
3) Run HyperSpin. I then did Ctl-Alt-Del to desktop...DemulShooter still running with tray icon red
5) Run House of the Dead. No movement or trigger detected from Sinden. I then did Ctl-Alt-Del to desktop...DemulShooter still running with tray icon green

Clearly DemulShooter is communicating with the emulator. This is extremely odd to me that disabling DemulShooter in the RL settings allows the game to work perfectly fine when launched through RocketLauncher. However, when DemulShooter is running, whether or not it is spawned from RocketLauncher, it completely breaks only through RocketLauncher. Any ideas what could be causing this behavior? FWIW I also tried downloading the newest version of DemulShooter and started from scratch. I then performed all the same tests coming to the exact same results.

Here's the relevant details from the log file, with complete log file attached. Let me know if more detail is needed (debug enabled).

Search "hotd" (17 hits in 1 file) D:\RocketLauncher\RocketLauncher.log (17 hits) Line 39: 12:44:56:191 | RL | INFO | +0 | Main - Raw CLI received: "MAME hotd" Line 44: 12:44:56:193 | RL | INFO | +0 | Main - RocketLauncher received "MAME" and "hotd" Line 45: 12:44:56:194 | RL | INFO | +0 | Main - hotd contains a System key in D:\RocketLauncher\Settings\MAME\Games.ini. Switching systemName to Sega Model 2 Line 47: 12:44:56:198 | RL | INFO | +0 | Main - hotd is switching to emulator Sega Model 2 Emulator via: D:\RocketLauncher\Settings\MAME\Games.ini Line 52: 12:44:56:202 | RL | INFO | +0 | Main - hotd will use module: D:\RocketLauncher\Modules\Sega Model 2 Emulator\Sega Model 2 Emulator.ahk Line 58: 12:44:56:215 | RL | INFO | +0 | Main - "hotd" does not qualify for MultiGame. Only roms with any of these strings in their name are acceptable: \(Disc|\(Disk|\(Cart|\(Tape|\(Cassette|\(Part|\(Side Line 60: 12:44:56:215 | RL | INFO | +0 | CheckPaths - Looking for rom: X:\ROMs\Arcade-SegaModel2\hotd.zip Line 61: 12:44:56:216 | RL | INFO | +0 | CheckPaths - Found rom: X:\ROMs\Arcade-SegaModel2\hotd.zip Line 112: dbName := "hotd" Line 115: romName := "hotd" Line 421: romProfile := "D:\RocketLauncher\Profiles\xpadder\Sega Model 2\hotd" Line 428: ahkRomProfile := "D:\RocketLauncher\Profiles\AHK\Sega Model 2\hotd" Line 677: 12:44:56:218 | RL | INFO | +0 | BuildScript - "D:\RocketLauncher\Lib\User Functions\Sega Model 2\hotd.ahk" not found Line 711: 12:44:56:601 | MD | INFO | +0 | Module Setting - [hotd] - Link_Enabled: false Line 713: 12:44:56:601 | MD | INFO | +0 | Module Setting - [hotd] - DemulShooterEnabled: true Line 755: 12:44:59:387 | MD | INFO | +0 | Process.Run - Running: D:\Emulators\DemulShooter\DemulShooter.exe -target=model2 -rom=hotd -noresize Line 756: 12:44:59:430 | MD | INFO | +47 | Run - Running: D:\Emulators\Model2\emulator_multicpu.exe hotd

Search "demulshooter" (18 hits in 1 file) D:\RocketLauncher\RocketLauncher.log (18 hits) Line 195: demulShooterPath := "D:\Emulators\DemulShooter\DemulShooter.exe" Line 195: demulShooterPath := "D:\Emulators\DemulShooter\DemulShooter.exe" Line 195: demulShooterPath := "D:\Emulators\DemulShooter\DemulShooter.exe" Line 495: demulShooterEnabled := IniReadCheck(settingsFile, "Settings|" . romName, "DemulShooterEnabled", "false",,1) Line 495: demulShooterEnabled := IniReadCheck(settingsFile, "Settings|" . romName, "DemulShooterEnabled", "false",,1) Line 541: If (demulShooterEnabled = "true") { ; If demulshooter is enabled for this game, launch it with relevant options Line 541: If (demulShooterEnabled = "true") { ; If demulshooter is enabled for this game, launch it with relevant options Line 542: demulShooterTarget := StringUtils.Contains(executable,"multicpu") ? "model2" : "model2" Line 543: DemulShooterExe := New DemulShooter() Line 543: DemulShooterExe := New DemulShooter() Line 544: DemulShooterExe.Launch(demulShooterTarget,romName,"-noresize") Line 544: DemulShooterExe.Launch(demulShooterTarget,romName,"-noresize") Line 659: If (demulShooterEnabled = "true") { Line 660: DemulShooterExe.Close() Line 712: 12:44:56:601 | MD | INFO | +0 | Module Setting - [Settings] - DemulShooterEnabled: false Line 713: 12:44:56:601 | MD | INFO | +0 | Module Setting - [hotd] - DemulShooterEnabled: true Line 755: 12:44:59:387 | MD | INFO | +0 | Process.Run - Running: D:\Emulators\DemulShooter\DemulShooter.exe -target=model2 -rom=hotd -noresize Line 755: 12:44:59:387 | MD | INFO | +0 | Process.Run - Running: D:\Emulators\DemulShooter\DemulShooter.exe -target=model2 -rom=hotd -noresize Search "hotd" (17 hits in 1 file)
 

Attachments

  • RocketLauncher.txt
    43.3 KB · Views: 3

djvj

Administrator
Staff member
Developer
What about setting RL to run as admin or vice versa? I don't see how RL would interfere as it's just telling an app to run, not controlling what happens after. The admin privilege could affect that though.
 

slizzap

Member
RL Member
Thanks for the input, but I don't expect that would be a factor. This is running on Windows 7 64-bit with UAC disabled and the user account that is logged in to Windows that runs RocketLauncher and all emulators is configured as a local administrator.

This was working perfectly fine with Aimtraks. The only thing that has changed is the gun. So I'm completely confused as to why it's behaving this way. As melon scratchers go, this one's a honeydoodle.

Is it possible it's ignoring the Sinden "lightgun.exe" application? If that application is not running, then Windows doesn't recognize the gun movement or trigger. I know it is running, but it's exhibiting the same behavior as if it wasn't. Maybe I should try explicitly starting "lightgun.exe" from the AHK file and closing upon exit.
 
Last edited:

djvj

Administrator
Staff member
Developer
You said it works w/o RL right? I'd try just making a small ahk script with a run command and see if the same thing happens
 

slizzap

Member
RL Member
So...no less a mystery, but this certainly fixed (or worked around) my problem.

I added this command right before the DemulShooter section:
;Run Sinden​
Run, D:\SindenLG-P1\SindenLightgunWindowsSoftwareV1.07\SindenLightgun\Lightgun.exe​
If (demulShooterEnabled = "true") { ; If demulshooter is enabled for this game, launch it with relevant options​

...and this one at the end:
WinClose("AHK_class MYWIN")​
Process,close,Lightgun.exe​
Return​

Regardless of whether I launched "Lightgun.exe" manually from the desktop before running HyperSpin/RocketLauncher or calling it from the Model 2 AHK script, while playing House of the Dead if I drop to the desktop I see the Sinden application running in the tray. However, it only actually works when calling it from the AHK script.
 

slizzap

Member
RL Member
Now that's out of the way, do you have any suggestions for how I might implement this at a global level? I can certainly add this to all relevant emulator AHK scripts, but this is a dedicated light gun cabinet, so I won't be playing any games on it that don't use the light gun.

Thanks.
 

djvj

Administrator
Staff member
Developer
Check out the user functions:

It won't run at specific parts of the module though. It's more for apps you want to run globally. Like you can't pass a module variable to user functions if I recall correctly how I created it.
 

leslie

New member
RL Member
Can you call a variable from module using UserFunction? Like for example FadeTitle so i will have something like

If WinExist("ahk_class <whatever game class>)
{
Do this . . .
}
Return


So i dont have to rewrite all of my games that uses PCLaucher in the UserFunction
 

djvj

Administrator
Staff member
Developer
So take a look in this folder:
C:\RocketLauncher\Lib\User Functions (Example)
Copy/paste it and remove 'Example' from the folder name. RL will only load files that match your correct names for your setup, besides Global.ahk.

In those files are already the functions that will be processed when RL loads that file. Feel free to edit which ones you need so it loads your app when you want it to.
 

leslie

New member
RL Member
Hi djvj,

Thank you for your reply. I'm already using this feature on some system so im a bit familiar already.

I assume that when you said "files", you are referring to Global.ahk and SystemName.ahk. What i did so far was made a copy of SystemName.ahk and rename it to PCGames which matches the name of my system. I added that script i mentioned above in FadeInExit() function but mentioning all the Fade Title names. So it goes like

If WinExist ("Fade Title 1") and ("Fade Title 2") . . . ("Fade Title X")
{
Do this
}

It is working fine but what i would like to know is instead of writing all the Fade Titles, would it be possible just to write a single variable which will always represent whatever is in my Fade Title setting?
 

djvj

Administrator
Staff member
Developer
Sure, you just have to make the variable global within the function.

Global FadeTitleVar
 

leslie

New member
RL Member
Thanks a lot! I will try this later to clean up my very long list of games in one line

If WinExist ("FadeTitleVar")
{
Do this
}
 

leslie

New member
RL Member
Hi djvj, I added FadeTitleVar but it seems like its not working correctly.

Here is my script, I use MsgBox to see if it will show the FadeTitle. Seems like its not picking up the variable value for some reason. I tested this with just AHK script and it is working fine

Code:
    ; This function gets ran right after FadeInExit(), after the emulator is loaded
    PostLoad() {
        Global dbName,FadeTitleVar
        RLLog.Info(A_ThisFunc . " - Starting")
        ; INSERT CODE HERE
                            ; Do something after game is loaded base on Fade title
                                If WinExist(FadeTitleVar)
                                    {
                                        MsgBox, the fade title is %FadeTitleVar%
                                    }
return
        RLLog.Info(A_ThisFunc . " - Ending")
    }

image_2022-07-01_181608024.png





Code:
FadeTitleVar := "ahk_class Notepad"

t::
If WinExist(FadeTitleVar)
    {
        MsgBox, the fade title is %FadeTitleVar%
    }
return


image_2022-07-01_182039618.png
 

djvj

Administrator
Staff member
Developer
So you can create a var in the module and pass it to user function, but not vice versa. It has to do with when the user functions are parsed into memory vs the module.20220702020741.jpg20220702020754.jpg
 

leslie

New member
RL Member
So you can create a var in the module and pass it to user function, but not vice versa. It has to do with when the user functions are parsed into memory vs the module.View attachment 3443View attachment 3444
Thanks for clearing that up, I think get what you mean now. I used FadeTitleVar as you said on your previous reply probably the reason why it is not working.

I used FadeTitle which can be found in PCLauncher module and I think it is working now. it does show me now what is the FadeTitle in msgbox.

The only thing I'm wondering is that why even if the open window does not match the FadeTitle, the msgbox still opens. meaning if I have a script, it will still do it. My aim is to only do the script on games with FadeTitle only
 

djvj

Administrator
Staff member
Developer
Sounds like you need to work on your conditional.

I just bought a pair of sindens. So I'll be playing around with RL more for them when they arrive. Think I read might take months though.
 
Top