These scripts were created to save replays from the awesome website Advance Wars by Web to gif or movie files. The code works by taking snapshots of the replays at each turn (through Selenium) and compiling the snapshots into gif files through ImageMagick.
First time setup and use are still a bit clunky but I'm making improvements in usability as time allows.
- Download the contents of the repository to your computer.
- Download the Selenium driver for Chrome.
- Place the file in a folder (ideally
./chromedriver/chromedriver
relative to the scripts folder). - Install ImageMagick for
gif
export. - Install the conda environment or the required python packages independently (see Dependencies).
- Upload the replay file if needed (in case it has already been deleted from the server).
- Get the match ID and number of turns as detailed in my blog post.
- Launch the bash script from the terminal as:
./awbw.sh ID DESIRED_MATCH_NAME TURNS_NUMBER ZOOM_LEVEL EXPORT_PATH
(for more info on these variables, look at the awbw.sh file or my blog post. - Wait until the whole script has finished (might take a while).
- Two GIFs and an MP4 file should show up in the provided path.
If something's not working correctly, try modifying the HEADLESS
variable in the constants file. This will make the chromedriver visible if it's launching correctly.
I've documented the code a bit over on my blog post. It's not comprehensive, but it might be handy if something is nor working correctly. The explanations on why the script takes so long and avenues for possible modifications are also detailed in it.