Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+2)

Adding a screensaver with extra steps

For this example I'll be adding Flowers Synchrony Demo as a screensaver for the launcher.


These are the files that you can download from its page. Trying to use them as is reveals two problems: 

  • UnityCrashHandler64.exe is included in the random file rotation and doesn't do anything when run on its own
  • the game opens with this window, requiring a confirmation after it has loaded

To solve the first - remove the crash handler altogether as it's not crucial for it to work.

The second part is harder - there are no commandline arguments that disable the quality selection popup (I have looked far and wide). So instead we will use a workaround!


Rename the executable to dontrun-C2_Visuals.exe so it gets excluded by the launcher, rename the data folder as well so that they match and unity can find the corresponding data folder.

Now in a folder next to it I added 2 files:

flowers.vbs and flowers.bat


flowers.bat is the file that gets picked by the launcher and executed. All it does is run:

start .\flowers.vbs

launching the visual basic script flowers.vbs:

with createobject("wscript.shell")
.run ".\flowers-synchrony-demo\dontrun-C2_Visuals.exe"
wscript.sleep 10000
.AppActivate "C2_Visuals Configuration"
.sendkeys "{enter}" 
end with

which:

  • runs the executable itself,
  • waits for 10 000 ms (10 seconds) (how long my laptop takes to load the demo and for the popup to appear)
  • switches to that window to focus it
  • simulates pressing enter (on the already selected by default "Play" button)

This ends up skipping the configuration window and the waiting part goes unnoticed when the screensaver starts itself while I'm away from the computer!


I later wanted to set up Fast Machine to also be used as a screensaver.

For that all the steps were quite similar with one exception: Fast Machine contains a bunch of different visualizers you switch between using your keyboard keys.

To do that the .vbs script which launches it 

with createobject("wscript.shell")
.run ".\fastmachine\dontrun-FastMachine.exe"
wscript.sleep 12500
.AppActivate "Experiment_Unity Configuration"
.sendkeys "{enter}" 
wscript.sleep 7500
max=12
min=1
Randomize
startat = Int((max-min+1)*Rnd+min)
.sendkeys Mid("qwertyuiopas",startat, 1) 
end with

waits for 7 more seconds after hitting enter on the graphics popup and then randomly chooses and presses one of the keys that switch the displayed scene.


I hope this gives you ideas for how to integrate other apps you might want to launch as a screensaver! And if you have any questions about your specific situation I would be glad to help!