Disable "Pause on Loss of Focus"

General discussion about Super Mario Bros. X.
User avatar
ByTheBookGames
Bob-Omb
Bob-Omb
Posts: 21
Joined: Tue Jun 04, 2019 8:35 pm

Disable "Pause on Loss of Focus"

Postby ByTheBookGames » Thu May 28, 2020 12:25 pm

Trying to get two instances of SMBX running simealtaneously for a project, sensing input and staying active at the same time. It would be great if I didn't have to mess with a virtual machine or complicated emulation to do that. Is there a setting in the game.ini or elsewhere that disables the automatic loss of focus and keeps the focus going?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9016
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: Disable "Pause on Loss of Focus"

Postby Enjl » Thu May 28, 2020 12:38 pm

You can start the engine via the command line with
LunaLoader --runWhenUnfocused
Ideas are useless if you can't make them real.
Image

All my assets from packs and episodes are free to use for non-Novaverse levels and projects, as long as proper credit is given.

Mirror of all my content and collaborations on IPFS: QmZKzVJAsD6dE2tTHEb58XEmsNLzrW2MVsTtW7HWLAAcCC

User avatar
Cedur
Bowser
Bowser
Posts: 6790
Joined: Tue Jun 28, 2016 10:14 am
Pronouns: he/him

Re: Disable "Pause on Loss of Focus"

Postby Cedur » Thu May 28, 2020 1:46 pm

Out of curiosity, what do you want to do this for?
Image
More Supports: show

Image
Image

Still using the legacy editor? Get SMBX2 and PGE, it will improve your experience significantly. Here's why. And remember, Yoshis are tools to be used and discarded.

ShadowStarX (06/14/18) wrote: South Korea is easy deal

User avatar
ByTheBookGames
Bob-Omb
Bob-Omb
Posts: 21
Joined: Tue Jun 04, 2019 8:35 pm

Re: Disable "Pause on Loss of Focus"

Postby ByTheBookGames » Thu May 28, 2020 3:37 pm

Enjl wrote:
Thu May 28, 2020 12:38 pm
You can start the engine via the command line with
LunaLoader --runWhenUnfocused
Thanks so much for your reply! I'm sorry to say I'm having trouble following those simple instructions... Let me know what I'm doing wrong:
I open PowerShell in the SMBX data folder and punch in "start LunaLoader --runWhenUnfocused," but that doesn't seem to be working. No difference in the focus issue. It doesn't recognize -runWhenUnfocused as a parameter either. Tried it on the LunaLoader-exec program too. I'm sure this is just a rookie mistake on my end, thanks again.

Added in 11 minutes 50 seconds:
Cedur wrote:
Thu May 28, 2020 1:46 pm
Out of curiosity, what do you want to do this for?
Well, it's kind of a long story. I've been trying for a long time to develop a workaround system for 3+ player multiplayer within the limitations of the current build's input system, character hitboxes, and so forth. It was actually going really well until I ran into the insurmountable obstacle of the camera system (won't get into that). Kinda gave up on it all for a while until I discovered luasocket, which others have tried to use to make an SMBX online system but discontinued because of the complexity. So long story short, I'm trying to see if I can develop an online multiplayer code for SMBX, hoping this could double as a psuedo-4P local system with 2 instances of the game running side-by-side, hence my issue with the program focuses. Beyond local multiplayer, though, it's really hard to test and develop luasocket code this way without being able to run two simultaneous instances at once on the same computer.

...anyway, I'm trying not to talk about it too much here because I'm not an official developer for SMBX and there's no point getting peoples' hopes up if it doesn't work it. Just an independent hobby for me. If I get things working, I'll look into ways I can share it with everyone per the lead developers' judgment.

rednaxela
Cheep-Cheep
Cheep-Cheep
Posts: 14
Joined: Sat Dec 05, 2015 7:06 pm

Re: Disable "Pause on Loss of Focus"

Postby rednaxela » Thu May 28, 2020 5:18 pm

ByTheBookGames wrote:
Thu May 28, 2020 3:48 pm
Thanks so much for your reply! I'm sorry to say I'm having trouble following those simple instructions... Let me know what I'm doing wrong:
I open PowerShell in the SMBX data folder and punch in "start LunaLoader --runWhenUnfocused," but that doesn't seem to be working. No difference in the focus issue. It doesn't recognize -runWhenUnfocused as a parameter either. Tried it on the LunaLoader-exec program too. I'm sure this is just a rookie mistake on my end, thanks again.
Not sure what's going wrong for you, because it works in the current version, PowerShell and all (I don't normally use PowerShell for this but for sake of demonstrating exactly as you described). See video:



This has been supported since SMBX2 Beta 4 Patch 2. Maybe you're running an older build still?


As a note for when launching via command line, you can load directly into an episode too. i.e.

Code: Select all

--loadWorld=worlds/cliche/world.wld --num-players=1 --p1c=1 --saveslot=2
for loading into the princess cliche, in 1 player mode, with player 1 character of mario, using save slot 2.
Long signatures are ungood.

User avatar
ByTheBookGames
Bob-Omb
Bob-Omb
Posts: 21
Joined: Tue Jun 04, 2019 8:35 pm

Re: Disable "Pause on Loss of Focus"

Postby ByTheBookGames » Thu May 28, 2020 8:46 pm

rednaxela wrote:
Thu May 28, 2020 5:18 pm
This has been supported since SMBX2 Beta 4 Patch 2. Maybe you're running an older build still?

As a note for when launching via command line, you can load directly into an episode too. i.e.

Code: Select all

--loadWorld=worlds/cliche/world.wld --num-players=1 --p1c=1 --saveslot=2
for loading into the princess cliche, in 1 player mode, with player 1 character of mario, using save slot 2.
I had not updated to Patch 2 yet which was the problem. Reinstalled and it works fantastic. Sorry for the trouble. And wow, you made a YouTube clip... very kind, thank you. Your info about other command line possibilities is helpful as well - is there a document somewhere where these are listed? I'd love to learn more about utilizing LunaLoader. Is it essentially a replacement for the "SMBXLauncher.exe" menu while still patching in the LundaDLL?

rednaxela
Cheep-Cheep
Cheep-Cheep
Posts: 14
Joined: Sat Dec 05, 2015 7:06 pm

Re: Disable "Pause on Loss of Focus"

Postby rednaxela » Thu May 28, 2020 10:08 pm

ByTheBookGames wrote:
Thu May 28, 2020 8:46 pm
is there a document somewhere where these are listed?
Not really at present. There's just the code. Note that some of the options there are residual outdated things that are no longer relevant or may not work anymore.

I suppose a short summary of currently usable/relevant/non-deprecated/suited-for-manual-use options I know work are:
  • Pass in the filename of any .lvl/.lvlx file to load a level file in test mode. You can also prefix this with --testLevel= but that is not required.
  • Pass in the filename of any .wld file to load a world map file. You can also prefix this with --loadWorld= but that is not required. If you also specify a save slot this will be loading into an episode normally, but otherwise it will be more of a test mode that doesn't save normally.
  • --saveslot= to specify a save slot when loading into an episode
  • --num-players= to specify the number of players when loading into an episode
  • --p1c= and --p2c to specify the characters for player 1 and player 2 respectively when loading into an episode
  • --runWhenUnfocused to keep the engine running when unfocused
  • --softGL to force using software OpenGL (can also be accomplished from data\config\luna.ini)
  • --forceHardGL to prevent automatic fallback to software OpenGL and give an error instead when it would be necessary (can also be accomplished from data\config\luna.ini)
  • --console causes a debug console to display as a separate window. Lua code can print to this with rawprint(...)

ByTheBookGames wrote:
Thu May 28, 2020 8:46 pm
I'd love to learn more about utilizing LunaLoader. Is it essentially a replacement for the "SMBXLauncher.exe" menu while still patching in the LundaDLL?
It's not a replacement. LunaLoader's role is simply running smbx.exe while patching in LunaDll.dll, and it transparently passes through all command line arguments. The command line arguments themselves are handled by LunaLua itself. As of current versions, SMBXLauncher also just runs LunaLoader with the right command line arguments to start the game.
Long signatures are ungood.

User avatar
ByTheBookGames
Bob-Omb
Bob-Omb
Posts: 21
Joined: Tue Jun 04, 2019 8:35 pm

Re: Disable "Pause on Loss of Focus"

Postby ByTheBookGames » Fri Jun 05, 2020 11:03 am

rednaxela wrote:
Thu May 28, 2020 10:08 pm
I suppose a short summary of currently usable/relevant/non-deprecated/suited-for-manual-use options I know work are:
Thank you for passing this along. I've kept a record of it and it's definitely been helpful so far.

Added in 1 minute 23 seconds:
rednaxela wrote:
Thu May 28, 2020 10:08 pm
LunaLoader's role is simply running smbx.exe while patching in LunaDll.dll [...] As of current versions, SMBXLauncher also just runs LunaLoader with the right command line arguments to start the game.
Yes, this is what I was wondering about, thanks.


Return to “General”

Who is online

Users browsing this forum: No registered users and 11 guests