multimonitor lightgun issue

d8thstar

New member
Supporter
RL Member
so i have noticed that if i am running more than just my primary monitor, my actlab lightguns don’t work correctly. it’s as if the gun sees the total resolution of all three monitors as one monitor. the only way to get the guns to work correctly is to disable all monitors except my game monitor.

it would be awesome to be able to turn off specific monitors per game.

i have created some displayswitch shortcuts to select internal only or expanded desktop. the issue with this is that win10 sees my arcade monitor as screen 2 so if i select displayswitch internal, the wrong monitor stays on.

any thoughts on how difficult this would be to implement? i’d be willing to pay for this feature!

EDIT: found a cool tool, multimonitortool that i can send a command line to turn off specific monitors. with this in mind. isthereanywherein RLUI that i can send a command line per game?
 
Last edited:

agent47

Super Moderator
Staff member
Supporter
RL Member
You can do that with User Functions, specifically the PreLaunch() and PostExit() functions. There should be examples in the Lib/User Functions directory.
 

d8thstar

New member
Supporter
RL Member
Ok, I am completely lost with this user function ahk. Are there any walk thrus on how to write one? I have two bats, one to run when a specific game launches, another to run when the game is exited.

Appreciate any help while I learn this!
 

agent47

Super Moderator
Staff member
Supporter
RL Member
Post the contents of the batch files in code tags and I'll make it.
 

d8thstar

New member
Supporter
RL Member
agent you are my man! unfortunately, i just tried making a bat to run the multimon tool i mentioned but when i try running the commands (outside of the bat), the app doesn’t place the monitors back where they were. so, i need to dig a bit more into the app to see if there is a way when turning them back on, place the monitors in specific places.

my other thought is to just knuckle down and get a couple of aimtrack guns which wouldn’t have this issue and i could always keep the monitors on. but playing gun games so far away (4 feet with my monitor size) from the screen isn’t appealing to me.

now if you know of a way to turn off a specific monitor via command, i’m all ears!

as always agent, thank you for the potential assist. maybe i can spot you a couple of beers?
 

agent47

Super Moderator
Staff member
Supporter
RL Member
Did you try using the /SaveConfig and /LoadConfig params? From the documentation for /SaveConfig: "Saves the current configuration of all your monitors into the specified filename, including the screen resolution, colors depth, and monitor position. You can load the saved configuration back into the system by using the /LoadConfig command-line option."
 

d8thstar

New member
Supporter
RL Member
well damn, thank you for that agent, worked great! if you are still up for editing a user function file for me, below are the two commands from my two bat files that are working. if you can edit that UF for me, point out the lines you added, i'm sure i would be able to tweak it to add any games/emus moving forward. as the example, maybe use vcop for model 2?

thank you very much sir!

bat to to turn off all monitors except one:

chdir "C:\Users\tony\Desktop\multimon"
start MultiMonitorTool.exe /LoadConfig onemon.cfg

bat to turn all three monitors back on:

chdir "C:\Users\tony\Desktop\multimon"
start MultiMonitorTool.exe /LoadConfig allmon.cfg
 

agent47

Super Moderator
Staff member
Supporter
RL Member
Try this, name this file "vcop.ahk" and place it in the "RocketLauncher/Lib/User Functions/Sega Model 2" directory. If it works, just copy and rename the file for the other games.

Code:
class GameUserFunction extends GameFunction {

	; Use this function to define any code you want to run on initialization
	InitUserFeatures() {
		RLLog.Info(A_ThisFunc . " - Starting")
		global multiMonitorTool := new Process("C:\Users\tony\Desktop\multimon\MultiMonitorTool.exe")
		RLLog.Info(A_ThisFunc . " - Ending")
	}

	; This function gets ran right before the primaryExe
	PreLaunch() {
		global multiMonitorTool
		RLLog.Info(A_ThisFunc . " - Starting")
		multiMonitorTool.Run("""/LoadConfig onemon.cfg""")
		RLLog.Info(A_ThisFunc . " - Ending")
	}

	; This function gets ran after the module thread ends and before RL exits
	PostExit() {
		global multiMonitorTool
		RLLog.Info(A_ThisFunc . " - Starting")
		multiMonitorTool.Run("""/LoadConfig allmon.cfg""")
		RLLog.Info(A_ThisFunc . " - Ending")
	}

}
 

d8thstar

New member
Supporter
RL Member
can’t wait to give this a try when i get home tonight agent! is there anything in the system setup that i need to enable to send user function or does it send user function automatically if it finds a file with the game name?

thanks a ton man!
 

agent47

Super Moderator
Staff member
Supporter
RL Member
Nope, just place the file in the correct location. RL checks all the possible user functions script locations for the chosen system/emu/game automatically when you run a game (and the global one).
 

brolly

Administrator
Developer
PreLaunch/PostLaunch won't work with legacy modules which is the case for Model 2, so until the module is updated to the new style you should use the StartUserFeatures function instead.
 

d8thstar

New member
Supporter
RL Member
thanks for the info brolly. not being a RL expert, where can i find the startuserfunction?

fyi, i also just tried with sega model 3, rom losrwsga and it had the same behavior. is model 3 also a legacy module?

i certainly appreciate the input you all have given me, thank you!
 
Last edited:

agent47

Super Moderator
Staff member
Supporter
RL Member
The SuperModel module is also a legacy module, yes. I'll have to go through my setups and see what I have since I know I updated a few of the legacy modules.

To use the StartUserFeatures instead as brolly mentioned, just change "PreLaunch()" to "StartUserFeatures()" in the code I posted.
 

d8thstar

New member
Supporter
RL Member
thank you both guys.

just a bit of history, i’ve had an arcade mame machine for as long as i can remember, FE’s advMAMe, MANEwah and a few others.

the more i dig into RL, the more i see how brilliant a piece of work it is.

so a heartfelt thank you for this app and for the support.
 

d8thstar

New member
Supporter
RL Member
seems to be running in the new log but it isnt turning monitors off? tried running twice, when i exit out, i have four instances of multyimon up and running o i know its getting called just doesnt seem to be loading the config? the same exact line in cmd works. i feel like we're very close!

https://pastebin.com/MnhX3bNq
 

d8thstar

New member
Supporter
RL Member
Hey agent, can’t get multimontool to work with your script so I thought I would try editing it to try DisplayFusion.

DF has a command line utility and the argument is -windowmonitorconfig “one”. One is the config I made for turning off the other two monitors but the argument needs to have the config file in quotes, just as I have here:

-windowmonitorconfig “one”

But my syntax is off trying to edit your script, im not sure how to get the ‘one’ config name in quotes. This is the line I’m having issues with

multiMonitorTool.Run("""/LoadConfig onemon.cfg""")

Please help! Getting these g7ns to work is just about the last thing I need to do to retire this machine!

Thank you sir, appreciate any help you can offer
 

d8thstar

New member
Supporter
RL Member
yo agent, thank you for your help but I think I’m gong to give up on this idea. I have hypermarquee running and when I reduce from two screens down to one, hypermarquee is pushed down to the primary screen, over whatever emu is running. I did this offline, not thru RL. The line you wrote me is behaving the same way as the multimontool. The app starts in the background but the config file isnt loaded (but that line does work thru cmd prompt).

But now that I am thinking about it, if I exit hypermarquee at game start and then restart hypermarquee when the game exits, maybe that will work?

if I may ask, is there a way to just run a bat file at game start / end? I can do what I want to do in a bat pretty easily but the scripting in userfunctions is just beyond me
 
Top