Does the game have to be running for this to work?
Game does not have to be running for this to work!
The .exe does take a little while to load. Did you close it yourself, or did the command prompt (black box) open and then close by itself?
If you run the .exe from the command prompt directly, it won't automatically disappear when it completes. If there was an error, you can then see what it is and report what you see here.
Things to double-check: make sure that the ai_wars.txt file is pointing to your game in the file="..." line. For instance, if you want to run this for Game7, make sure it is "./Game7/Autosave.bcs". Switch Game7 to a different game number to run for a different game -- the tensions will be stored.
Post by tortugapower on Jun 20, 2019 16:43:45 GMT -5
Updated to v0.305, which mostly changes how the settings file is parsed and loaded.
clevebro If you have a chance to download the new version and check how it works, I'd be curious if at least it works with spaces in the directory now. (I don't think it will work with the localization issues yet.)
I'm leaving v0.302 as I haven't stress-tested v0.305, so it could have some big issue (although it ran for me).
Edit: ALSO. I am shifting my time to develop the Combat Auto-Resolve Simulator for RtW2. I can't do what I want to do with this one until we can somehow feed the game updates without having to quit and load the game. I'm happy to continue supporting this if people find issues.
And if any API-like structure is implemented into the game, I'll resume work on this.
I can't do what I want to do with this one until we can somehow feed the game updates without having to quit and load the game.
I gave a few minutes (no more) of thought to that. i have an idea that still needs some changes to RTW2, but should be a lot easier to implement than an API.
If the game .exe could take as an argument the game save, and if the game was activated (with licence and so on) directly load the save, we could be doing something like:
0) start the game throught a script 1) the script looks at the savegame every second or so 2) if the save game changes, after a short delay (to make sure that all files are saved), the script close the game 3) the script runs the AI wars 4) the script restart the game with something like "rtw2.exe -game1" 5) the game is restarted with the AI wars done.
So the player would have to suffer a few seconds delay when saving the game but that's it.
Bonus for the testers: The testers also could use the command line argument, and have a cycle of modify the game file => test => modify the game file => test... that would be lot faster than if they have to manually load the save game each time.
And finally this has no impact at all on the "normal" player.
Last Edit: Jun 27, 2019 1:17:39 GMT -5 by Capsized
Post by tortugapower on Jun 27, 2019 2:54:19 GMT -5
Capsized I'm all ears! Closing a program and opening another program worries me in that it might be considered malaware by most virus protection or security software.
I think even a simple "Load Game" button from inside the game itself, next to the Resign and next turn buttons, might even help this mod along.
The best way is if the game can look at a file (e.g. "input.txt") and check a parameter there (e.g. load=0). If load=1, then it pulls in data from the file, overwriting the existing game state for those variables. That would allow full interactions.
And that gives some useable results. In a few minutes I made a macro will double click on my AI wars shortcut, close it as soon as it shows its window, then double click the RTW2 shortcut, confirms that yes I want to play, and finally click "continue" to load the savegame. It would be easy to modify it to first save and close RTW2 before starting the AI wars.
The macro is very brittle: it uses the screen coordinates so if a window is a few pixels left or right (or up or down) from the expected position it will not work correctly.
On my PC it takes around 17 seconds from starting the macro until the game is ready to play, with something like 12s for the AI war script part. So not very fast but OK if it is run every few months.