5thWolf Posted December 28, 2023 Share Posted December 28, 2023 So I am trying to get a Windows game that starts out windowed to start in full screen. (Not maximized window) The game full screens with Alt+Enter. I would prefer to just edit the game in Launchbox to go full screen. Command line perimeter maybe? But will take a .bat command as last resort. Quote Link to comment Share on other sites More sharing options...
bundangdon Posted December 28, 2023 Share Posted December 28, 2023 12 hours ago, 5thWolf said: But will take a .bat command as last resort. Have you tried using a script? You could add something like this (below) to the area where it says "Running Script". However, this only works when editing emulators, and I'm not sure how to use this with a single game Send {Alt Down}{Enter}{Alt Up} 1 Quote Link to comment Share on other sites More sharing options...
skizzosjt Posted December 28, 2023 Share Posted December 28, 2023 (edited) @5thWolf the game would need to have built in commands in order to take advantage of them as a command line parameter. likely they simply don't exist. the script posted by bundangdon would work out just fine. what you need to do is save it as a .ahk fle and have it run as an additional app that launches prior to the game. you should add one more line to make sure it works consistently though. it will need to wait for the window to exist. so you can add a sleep line at the start to wait for X seconds. or use a line to wait for the window to exist. these all achieve the same thing Sleep, 5000 ;waits 5 seconds Send {Alt Down}{Enter}{Alt Up} you can change the sleep time if you need to WinWait, The Legend of Zelda II - Adventures of Link Enhanced Send {Alt Down}{Enter}{Alt Up} waits for window to exist. the title must match exactly so make sure to change it, it is case sensitive WinWait, ahk_exe ZeldaII.exe Send {Alt Down}{Enter}{Alt Up} also waits, but checks for the process (exe) name instead. this is not case sensitive, but it needs to otherwise match the exe name of the game. all 3 would give the same result. so just pick your preference if none of the above work, then I would replace the 2nd line with this. Being more specific with the keys here Send {RAlt Down}{Enter down}{Enter up}{RAlt Up} Edited December 28, 2023 by skizzosjt 1 1 Quote Link to comment Share on other sites More sharing options...
5thWolf Posted December 28, 2023 Author Share Posted December 28, 2023 Awesome guys! I will try and let you know! Also, just double checking that there is no way to get it through the parameters in Lunchbox then? Quote Link to comment Share on other sites More sharing options...
bundangdon Posted December 28, 2023 Share Posted December 28, 2023 52 minutes ago, 5thWolf said: Awesome guys! I will try and let you know! Also, just double checking that there is no way to get it through the parameters in Lunchbox then? Probably not, unless the program itself (Zelda Enhanced) has command line features that could be used. It's made with GameMaker and I don't see any documentation there regarding command line, so you'll have to find another solution like the one @skizzosjt mentioned 1 Quote Link to comment Share on other sites More sharing options...
5thWolf Posted December 28, 2023 Author Share Posted December 28, 2023 (edited) I couldn't get any of it to work. Using ahk nothing would happen. Closest I got was doing .bat file by it's self starting the exe, delay 10 seconds then nothing. Just the key never seems to send. I also learned the the game can also utilize just the F key to full screen, to simplify things. online seems to be many way to send the F key but non of them worked. There has got to be a way to do this with just the .bat alone Edited December 28, 2023 by 5thWolf Quote Link to comment Share on other sites More sharing options...
Retro808 Posted December 28, 2023 Share Posted December 28, 2023 You could make a launcher exe for it to run the game and send the AHK script. 1. In the game's exe folder right click an empty space and choose New AutoHotKey Script. 2. A new file will appear so give it a name. I called this one "Adventure of Link Enhanced Launcher". Once you rename it open the file with Notepad or Notepad++ 3. Write your own/better script or past in the one I used below. Now save the file. 4. Right click on that ahk file and choose Compile Script. A new exe will be created. 5. Point LB to that as the game's file. I tested this using something JoeViking helped me with a few years ago and it worked without issue. I am sure there is better code/format for this. I have only tinkering knowledge of coding/AHK scripting. So maybe skizzosjt can make better sense of my patchwork. For some reason it would only work if I used the name Windows was showing when the app was running. Maybe using the exe name I had a typo, but I was rushing so you can try with the exe name in the WInWait line. Run, Z2TAOL_P03.exe WinWaitActive, GameMaker: Studio Send {Alt Down}{Enter}{Alt Up} $Esc:: Send, !{F4} ExitApp Return 1 Quote Link to comment Share on other sites More sharing options...
5thWolf Posted December 28, 2023 Author Share Posted December 28, 2023 52 minutes ago, Retro808 said: I Only question I have then is how did you make the launcher? I never really used AHK before outside pasting peoples scripts in LB. Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted December 28, 2023 Share Posted December 28, 2023 Playing off Retro808's script, here's another one. This assumes the script is in the same folder as the (games) exe file. WinWaitActive 'knows' to wait for the prior lines Run executable. The Sleep timer seems to need to be there before send "f". Also added an Escape sequence to exit the game (and the script). SetWorkingDir %A_ScriptDir% Run, Z2TAOL_P03.exe WinWaitActive Sleep, 1000 Send, f $Esc:: Send, !{F4} ExitApp Instead of compiling the script to an exe, you could add an emulator to LB. Just point it to \LaunchBox\ThirdParty\AutoHotkey\AutoHotkey.exe and add an Associated Platform of any platform. Just don't check the default box. Then import the .ahk script as a ROM and use the "AutoHotkey" emulator. 1 2 Quote Link to comment Share on other sites More sharing options...
Retro808 Posted December 28, 2023 Share Posted December 28, 2023 4 minutes ago, 5thWolf said: I Only question I have then is how did you make the launcher? I never really used AHK before outside pasting peoples scripts in LB. The steps are in my post. I numbered the steps so it is cleaner to read. 1 Quote Link to comment Share on other sites More sharing options...
skizzosjt Posted December 30, 2023 Share Posted December 30, 2023 On 12/28/2023 at 11:37 AM, Retro808 said: 4. Right click on that ahk file and choose Compile Script. A new exe will be created. On 12/28/2023 at 12:32 PM, 5thWolf said: I Only question I have then is how did you make the launcher? I never really used AHK before outside pasting peoples scripts in LB. to clarify this a little deeper, the right click function to compile a script will only appear if you have installed the exe version of AHK. meaning you would have already downloaded their installer from their website and installed it like any average program. as in it also shows up in your installed applications list. it is also possible to have AHK in a portable install. this is simply unpacking a zip file to any location you want and it runs like that. this is how the AHK exe works that comes included with LaunchBox. if you do things this way you would not have the right click and compile option available. if you have the portable way setup, you can still compile but need to run Ahk2Exe.exe and in there select the script to compile. Ahk2Exe.exe can be found in the AHK folder that will be unzipped in the Compiler folder Using Ahk2Exe -Select your script -Then select the AHK EXE to use for compiling (I usually use the one selected below) -Click convert 2 Quote Link to comment Share on other sites More sharing options...
Retro808 Posted December 30, 2023 Share Posted December 30, 2023 Thanks @JoeViking245 and @skizzosjt for chiming in. Joe did mention the AHK install part and I forgot to edit my post. I forget sometimes some software used over the years is not normally installed by others. 3 Quote Link to comment Share on other sites More sharing options...
5thWolf Posted January 1 Author Share Posted January 1 On 12/28/2023 at 12:42 PM, JoeViking245 said: SetWorkingDir %A_ScriptDir% Run, Z2TAOL_P03.exe WinWaitActive Sleep, 1000 Send, f $Esc:: Send, !{F4} ExitApp I really want to work with this!!! Looks like it should work, but tried it and it didn't do anything. The .bat is in the the same folder as exe. I did copy and past. I just don't see what could be wrong. It looks like it should be perfect! Quote Link to comment Share on other sites More sharing options...
5thWolf Posted January 1 Author Share Posted January 1 (edited) If I can't get the .bat to work I will explore the AHK option like @JoeViking245 stated. Seems like it would be the overall best solution then dealing with .bat files. If anyone has a good script for AHK I will try it at the same time. Edited January 1 by 5thWolf Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted January 1 Share Posted January 1 1 hour ago, 5thWolf said: I really want to work with this!!! Looks like it should work, but tried it and it didn't do anything. The .bat is in the the same folder as exe. I did copy and past. I just don't see what could be wrong. It looks like it should be perfect! What .bat file? All code listed so far is AutoHotkey. If you take the [good] script that I gave you and save it into a file with a .ahk file extension then do what I described above, not only will it 'should work', it will work. To reiterate (with a little more description), create a new text file in the games folder. Edit that text file and paste the code I gave into it. Save and close. Now rename the file AND file extension to something like (or whatever you want, as long as it has an 'ahk' file extension) JoesWorkingScriptForLOZ2.ahk Make sure the actual file extension gets changed. You don't want 'JoesWorkingScriptForLOZ2.ahk.txt' The 1st one is good, the 2nd is bad. (the give-away is under Type) Now, in LaunchBox, create the emulator as described. Then edit the LOZ2 game and set (change) in the Launching section the path to the .ahk file above. Not the .txt file. 1 Quote Link to comment Share on other sites More sharing options...
5thWolf Posted January 2 Author Share Posted January 2 (edited) Ok, I added AHK as an emulator and told it to be used for the game. Created the ahk file with the copy pasted script and made the game exe be the scripted ahk file.. The game launches but doesn't go fullscreen. 😣 Any ideas? Edited January 2 by 5thWolf Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted January 3 Share Posted January 3 1 hour ago, 5thWolf said: Ok, I added AHK as an emulator and told it to be used for the game. Created the ahk file with the copy pasted script and made the game exe be the scripted ahk file.. The game launches but doesn't go fullscreen. 😣 Any ideas? Glad to hear it [almost] works. No need to frown. Set the Sleep timer to longer than 1 second (1000). Try changing it to 2000 (2 seconds) or 3000 (3 seconds). Or longer? 1 Quote Link to comment Share on other sites More sharing options...
5thWolf Posted January 4 Author Share Posted January 4 (edited) It is insanely odd how long it takes this game to show up after clicking it. Between 5 - 10 seconds or so. Will time it and put set it to that and report back in a few. Edited January 4 by 5thWolf Quote Link to comment Share on other sites More sharing options...
5thWolf Posted January 4 Author Share Posted January 4 (edited) I did it for 5000 and it worked the first time, than after that it doesn't! Esc key always works great. One odd flaw.... When I exit the game and come back and run it again, I get this message below. Maybe AHK is not shutting down properly? After a few restarts of LB, the message doesn't show up anymore and the game doesn't fullscreen. Esc still works. Experimented with 5000 all the way to 8000. Edited January 4 by 5thWolf Quote Link to comment Share on other sites More sharing options...
5thWolf Posted January 4 Author Share Posted January 4 (edited) I figured out the message. If I exit the game with any means other then Esc AHK stays running. Otherwise Esc shuts it down properly and no message. Also tried 1 second intervals from 4000 to 12000 and can't get it to go fullscreen. Only worked the very first launch I tried at 5000, but didn't work putting it back to 5000 after moving the timer around. Edited January 4 by 5thWolf Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.