Zerk Zone

Pages for the Creations of Ryan Armstrong

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 |

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 |