SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > Silent Hunter 4: Wolves of the Pacific
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 03-12-21, 11:58 PM   #16
themrwho
Torpedoman
 
Join Date: Jul 2010
Posts: 119
Downloads: 140
Uploads: 0


Default

Script linked below is a workaround for now: it does not fix the core issue, and I am still after a better solution but until then, hopefully this will do.
Tested this only for an hour, more testing is needed but initial results are good.
Script just makes it easier (via AutoHotkey automation) to re-activate sh4 window without doing anything or clicking anything -- works simply by "waiting".
Script URL: https://gitlab.com/themrwho/focus-sh4

Script has three settings:
0=off
1=slight effort (activate sh4 window after 5s inactivity)
2=focused effort (activate sh4 window after 0.25s inactivity)

A global desktop shortcut (SHIFT+F2) changes toggles the setting (increments it by 1, after max value 2, another hit takes it to level 0).
Human voice (mp3) announces the new setting level as feedback.

With quick testing, I found the default and aggressive setting 2 -which is best for having maximum amount sh4 audio- difficult to use for doing anything more than a single click in the "other window".
However it works great for its intended purpose: if you're watching stuff on YouTube and also playing sh4 on the other screen (more like idling/patrolling, waiting for a contact etc.) you can click to a different point in time in the video, then you will get your sh4 audio back almost instantly.

When script activates sh4 window, what happens to the other-window?
The other-window (let's say web browser) stays mouse-wheel-controllable and as long as your mouse pointer is only hovering over on that other screen (i.e.: if you do NOT click into that other-window) you can keep mouse wheel controlling it forever, it will not deactivate sh4 window and thus will not lose sh4 audio.

Practical example: if you are on a forums thread, you can mouse wheel up/down, keep scrolling up/down and read the whole thing.
You could do all that without this script anyway.
With this script in its aggressive default setting (level 2) you can even click on the NEXT PAGE button then the script, in quarter of a second, will re-activate sh4 window for you and you'll regain audio without lifting a finger.
Effortless automation, combined with an adequate delay seems to be working well in the sense that I can now both browse/read forums and webpages, watch YouTube and also not lose sh4 audio which is what I wanted in the first place.

What I still cannot do is use the keyboard, for example while typing this message I have had to set the script to setting 0 (automation turned off) otherwise it would keep reactivating sh4 window when I don't want it to.
That's why I am still after a better solution, if I find one I will share that too. Meanwhile always happy for any more tips/assistance.

Just to be clear to benefit from this script, you need a dual (or better) screen setup and (probably) need to be running sh4 with (almost)-fullscreen-borderless mode, using the 1-pixel-less hack described in post #14 in this thread. Only after that you can freely move your mouse in the other screen without losing sh4 audio.
themrwho is offline   Reply With Quote
Old 03-13-21, 04:10 PM   #17
themrwho
Torpedoman
 
Join Date: Jul 2010
Posts: 119
Downloads: 140
Uploads: 0


Default

Playing the game now & testing this script which led to a few small improvements. The GitLab repo has been updated.

1) For announcing new focus effort level rather than using .MP3 files we are now using .WAV files (0.wav, 1.wav, 2.wav). This change make script 100% compatible pretty much with any Windows O/S you can play sh4 on - in other words potentially missing mp3 codec is a non-issue now.

2) After further testing, the announcement volume level bothered me as it was too high. I have modified the 3x wav files and made alternative versions which have audio gain reduced by 18dB.
Script by default tries to play the minus18dB WAV files but should you prefer original (loud) WAVs or loud MP3s then you can simply change the relevant lines to restore old behaviour.

With this change, announcement now is more like: "FYI this is the new level..."
Older version was more like 25th second of this clip:
themrwho is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.