Zerk Zone

Pages for the Creations of Ryan Armstrong

Image Gallery Script

Posted on October 11th, 2014 @ 9:45 am by Zerker

This is a script I wrote to generate an image gallery HTML file for a given folder, or for the Steam Screenshots folder. It will, by default, show the full resolution original image, so it can be useful for browsing a folder of moderate-sized images without having to rely on thumbnails. It can also generate thumbnails of any size if desired. Thumbnails are created into .thumb folders, which will be hidden in Unix-type OSes, but not (unfortunately) in Windows. Finally, the script can double-size and apply aspect ratio correction for smaller images (e.g. NES, SNES or DOS screenshots). These are sized using CSS attributes and do not generate a second copy of the image. Here’s an example gallery of X-Com screenshots with double-sizing and aspect ratio correction.

This can be run without any parameters to create the basic gallery in the current directory. For Windows users, you can also add a shortcut to the script in your SendTo folder to easily create a gallery for any folder by right clicking on it and using the SendTo menu.
(more…)

Comments (0)

Filed under: Programs/Libraries,Python |

Steam Image Scripts

Posted on October 11th, 2014 @ 9:32 am by Zerker

After finding most instructions for downloading Steam grid view images to be out-of-date, and same goes for the only grid view downloader I could find, I wrote my own.

I also put together a quick library that can create a dictionary of Steam applications on a given profile based on the JavaScript of the profile page (using JSON).
(more…)

Comments (0)

Filed under: Programs/Libraries,Python |

Convert Midi script

Posted on October 4th, 2014 @ 8:41 am by Zerker

This is script I recently cooked up after picking up MT32 and Roland SoundCanvas sound modules to play midi files and record the playback with said hardware synth. I then encoded the recordings and loaded them on my media player.

If you have a hardware synth (or quality software synth should such a thing exist) you should be able to use this.

usage: convertmidi.py [-h] [-d MIDIDEVICE] convertpath

Converts all mid files in a path to WAV. Uses the tools playsmf to play the midi files and sox to record the resulting audio. Both tools must be present on the system path. You should have your OS configured to record from whichever device the midi output will be sent to ahead of time.

positional arguments:
  convertpath    Path to process

optional arguments:
  -h, --help     show this help message and exit
  -d MIDIDEVICE  Midi Device identifier (default of 1 for first external
                 synth)

This script also requires Python 3.x. I’ve only tested this in Windows due to better support for my sound card, but there’s nothing particularly Windows-specific about the script. It should run fine in Linux with appropriate versions of playsmf and sox.

It also comes with a reset.mid file I downloaded from somewhere to reset the midi controller between songs in case anything gets stuck/confused. I’d love to also give credit for this file, but I can’t figure out where I got it anymore.

Download (1.4 kB)

Comments (0)

Filed under: Programs/Libraries,Python |

gmusicbrowser playlist exporter

Posted on November 10th, 2013 @ 9:37 am by Zerker

So, this is a script I wrote a while ago to interpret the gmusicbrowser database format in python, then automatically create a series of playlists. It’s a little bit hackish and not particularly user friendly, but I’ve tried to document it reasonably well. If you’re a moderately technical user who uses gmusicbrowser, give it a shot and let me know if it’s useful for you.

Included in the download are three files:

gmusicbrowserplaylistexport.py
The module that does all the work
gmusicbrowserplaylistexport.html
Documentation for said module
exportplaylists.py
An example export script that uses the module to export a series of playlists.

When you download this, have a look at the exportplaylists.py file to get an idea of how it works, then modify to suit your database/export needs.

Note that this script was written for (and requires) Python 3.x.

Download

gmusicbrowserplaylistexport.tar.bz2 (6.6 kB)

Comments (0)

Filed under: Programs/Libraries,Python |

Shadow Caster Isometric Mapper and Resource Extractor

Posted on November 14th, 2012 @ 7:02 pm by Zerker

About and Dependencies

This is a series of Python scripts to generate Isometric views of Shadow Caster maps, as well as extract most of the Shadow Caster Resources. These scripts require the Python Imaging Library (PIL) and Python 2.x (tested with Python 2.7.3). PIL unfortunately does not yet support Python 3, which prevents these scripts from being forward-compatible at this time.

Windows users should be able to download Python and PIL from the above links. Most Linux/Unix varients should be able to install Python and PIL via your package manager of choice; Ubuntu users can install the python and python-imaging libraries. OSX users should already have Python, but you may need to compile PIL yourself via the source download at the PIL website.

The scripts also obviously require Shadow Caster (CD version), which can be a bit hard to find nowadays. Purchasing a used copy on eBay or other used game source appears to be the only option.

As before, special thanks to the SLADE Editor and everyone on the ShadowCaster modding thread at Doomworld. Both sources were instrumental in the development of these tools.

Please note the sample.png image file is used to obtain the Shadow Caster colour
palette and is required for this tool to work.

Usage

There are three scripts included in the package that are intended to be executed directly.
isomap.py is the main isometric mapper script,
shadowdat.py is a script to extract the contents of a Shadow Caster .dat file, and shadowlib.py is a script to extract the contents of a Shadow Caster .lib file. In addition to the three scripts above, several supplimentary scripts can be run to gather debug outputs of one form or another, and are listed under the Other Scripts heading.

isomap.py

Usage: python isomap.py [LIB FILE] [cd_castr.dat] [hd_castr.dat]

Generates a isometric map for each level in the specified Shadow Caster
LIB file (typically shadow.lib). The DAT files are used for image data.

shadowdat.py

Usage: python shadowdat.py [DAT FILE]

Extracts the complete contents of a give Shadowcaster dat file.
Does not support the cutscene dat files from the CD version, only
cd_castr.dat and hd_castr.dat. The .dat file from the floppy version may
also work, although it is unknown how frequently the floppy version uses
the RLE flag.

shadowlib.py

Usage: python shadowlib.py [LIB FILE]

Extracts the complete contents of a given Shadowcaster lib file. Resources are not interpreted and are written as-is.

Other Scripts

shadowdebugmapper.py

Usage: python shadowdebugmapper.py [LIB FILE]…

Generates a debug HTML file for each level in the specified LIB file.
Each index in the map is output into a cell in an HTML table
containing the following information:

The map index

the value for each of the map layers, in order

shadowsimplemapper.py

Usage: python shadowsimplemapper.py [LIB FILE]…

Generates a debug HTML file for each level in the specified LIB file.
Each index in the map is output into a cell in an HTML table
with lines representing walls.

shadowmap.py

I didn’t even write any usage instructions for this, but this
can generate image files for each layer of each map in a given lib file,
as well as CSV files for the data from each supplementary data file.

Download

ShadowCaster Mapper.tar.gz (162.8 kB)
ShadowCaster Mapper.zip (161.4 kB)

Comments (0)

Filed under: Maps,Programs/Libraries,Python |

ROTT Isometric Mapper and WAD Extractor Release

Posted on October 13th, 2012 @ 10:33 am by Zerker

About and Dependencies

This is a series of Python scripts to generate Isometric views of Rise of the Triad maps, as well as extract the complete contents of DARKWAR.WAD. These scripts require the Python Imaging Library (PIL) and Python 2.x (tested with Python 2.7.3). PIL unfortunately does not yet support Python 3, which prevents these scripts from being forward-compatible at this time.

Windows users should be able to download Python and PIL from the above links. Most Linux/Unix varients should be able to install Python and PIL via your package manager of choice; Ubuntu users can install the python and python-imaging libraries. OSX users should already have Python, but you may need to compile PIL yourself via the source download at the PIL website.

The scripts also obviously require Rise of the Triad: Dark War, which can be purchased from either 3D Realms or GOG.com. For the mapping scripts, DARKWAR.WAD must be in the current directory.

Usage

There are three scripts included in the package that are intended to be executed directly. rottmapper.py is the main isometric mapper script, rottdebugmapper.py is a script to generate debug maps containing all the original wall/sprite/info values, and wad.py is a script to extract the complete contents of a ROTT wad file. In addition to the three scripts above, rtl.py can also be run directly to generate a simple black and white pixel image of a level, but this is not its primary purpose.

rottmapper.py

python rottmapper.py [RTL/RTC FILE] ([Level Num])

Generates PNG isometric map images based on the specified ROTT RTL or
RTC file. If [Level Num] is specified, this will only generate a map
for the indicated level. Otherwise, maps for every level in the RTL/RTC
will be generated.

This tool requires DARKWAR.WAD from the registered version of ROTT
to be present in the current directory. Note that on case-sensitive file
systems the file name must also be uppercase.

rottdebugmapper.py

python rottdebugmapper.py [RTL/RTC FILE]…

Generates a debug HTML file for each level in the specified ROTT RTL or
RTC file. Each index in the map is output into a cell in an HTML table
containing the following information:

wad.py

python wad.py [WAD FILE]

Extracts the complete contents of a give ROTT wad file. Currently only
supports DARKWAR.WAD. All images will be written as PNG files,
other data will remain in its original format (e.g. .mid for music,
.voc for SFX). Unidentified data will be written with no extension.

Download

rottmapper.tar.gz (47.6 kB)
rottmapper.zip (49.7 kB)

Comments (4)

Filed under: Maps,Programs/Libraries,Python,Rise of the Triad |

Dungeon Mapper Source Code

Posted on May 7th, 2012 @ 4:53 pm by Zerker

As requested, I have released the source code for Dungeon Mapper under the GPLv3. See the original Dungeon Mapper post for source download link.

Comments (1)

Filed under: Java,Programs/Libraries |

Shuffle by Album Script

Posted on August 14th, 2010 @ 11:16 am by Zerker

So, I started using Banshee as my primary music player, but I noticed that it can shuffle by album, it cannot save a static playlist of the shuffle (so I can pick up where I left off). Since it has very nice M3U import/export capabilities, I decided to create a Python script to shuffle an M3U file by album (well, by directory anyhow). Hopefully this is useful to others.

It’s just a basic command-prompt script, so to use it, simply specify the m3u file as a command-line option:

python ShufflePlaylistByAlbum.py bestmusic.m3u

If your OS/file manager lets you drag+drop on top of Python files, you can run it that way too. It goes without saying that you need Python. It should function fine in both Python 2 and Python 3.

ShufflePlaylistByAlbum.py (4 kb)

Comments (0)

Filed under: Programs/Libraries,Python |

Dungeon Mapper 0.2.1 alpha

Posted on January 10th, 2010 @ 8:59 pm by Zerker

DungeonMapper screenshot

So I’ve been playing a bit of Arcana lately on the SNES, and due to the inadequacies of the built-in automap, I’ve been trying to keep my own map. Unfortunately, the “best” solution I’ve found so far is still grid paper; Dungeon Crawl Map Maker without the Bullshit is pretty close, but it’s far too slow and fidgety with the current mouse interface.

So I’ve decided to start writing something myself. The goal of this program is to be fast, precise and keyboard-driven. The idea is to simply move a cursor around the map and quickly draw walls & floors without constantly switching and clicking all over the place. This is a preview version to get people’s opinions on the idea and control scheme, etc.

(more…)

Comments (15)

Filed under: Java,Programs/Libraries |

GSPlayer/Mort Player/Nitrogen Mod Plugin 1.01

Posted on November 28th, 2009 @ 12:49 pm by Zerker

A Mod Plugin for GS Player or Mort Player. This has been developed with the help of the BASSMod sound library by un4seen developments. If you’ve never heard of Mod Files, just head over to The Mod Archive, where you can download plenty of awesome mod files.

This is version 1.01, which has been updated to support Nitrogen’s quirky way of interacting with plugins. Please comment below if you have any issues.

(more…)

Comments (3)

Filed under: Programs/Libraries,Windows Mobile |

Next Page »