|
Answer» im making a text-based rpg. i HEARD thats a good way to flex your batch file skills. apparently, i dont have as much skills as id have hoped.
i know %errorlevel% can be used in a window to run commands when another main window closes, after converting the batch to an exe. in this case, it would be used as an autosave so when the player loses, they cant exit out for a do over. i have a basic txt-file-based saving system already, so that isnt a problem.
but my predicament is that the player can exit out the autosave window to allow do overs, once they lose in the main window.
is there a way to hide another batch window, and open it once another batch file opens?There is no real way to make a bat file invisible, though if you compiled it into an exe then you can USE vbs to minimize the 2nd batch file that looks in 'tasklist' for 'xxx.exe' and when it closes saves the game. The issue with this is that both batch files have SEPARATE variables and the 2nd would not be able to recover any data from the first.
You could always save after every EQUATION. This is a little more code intensive and runs a little slower, but not enough to be noticeable as you are only saving the changing value. (keep all of your variables in .txt files and draw them out when you need them, then remake the file after you have changed the value.)
A little off topic, but you may want to consider making it in parts and then using the 'call' command to jump between the parts. There is not a lot of room for error if you write it all in one giant file.
|