The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::Web::VPKBuilder - Mix & match Source engine game mods

SYNOPSIS

  use Plack::Builder;
  use App::Web::VPKBuilder;
  builder {
    enable ...;
    enable ...;
    App::Web::VPKBuilder->new->to_app
  }

DESCRIPTION

App::Web::VPKBuilder is a simple web service for building Source engine game VPK packages. It presents a list of mods sorted into (sub)categories. The user can choose a mod from each category and will get a VPK containing all of the selected packages.

CONFIGURATION

APP::Web::VPKBuilder is configured via YAML files in the cfg directory. The recommended layout is to have an options.yml file with the global options, and one file for each source mod (original mod that may be split into more mods).

Global options

readme

A string representing the contents of the readme.txt file included with the package.

sort_order

An array of strings representing the sort order of (sub)categories. (sub)categories appear in this order. (sub)categories that are not listed appear in alphabetical order after those listed.

dir

A string representing the directory in which the packages are built. Must be on the same filesystem as the package directory (pkg/). Is created if it does not exist (but its parents must exist).

vpk

A string representing the program that makes a package out of a folder. Must behave like the vpk program included with Source engine games: that is, when called like vpk path/to/folder it should create a file path/to/folder.ext, where ext is given by the next option. Defaults to 'vpk' (requires a script named vpk in the PATH).

vpk_extension

The extension of a package. Defaults to vpk

Example:

  ---
  readme: "Place the .vpk file in your custom directory (<steam root>/SteamApps/common/Team Fortress 2/tf/custom/)"
  sort_order: [Scout, Soldier, Pyro, Demoman, Heavy, Engineer, Medic, Sniper, Spy, Sounds, Model]
  dir: work
  vpk: ./vpk
  vpk_extension: vpk

Mods

Each source mod is composed of one or more directories (mods) in the pkg/ directory and a config file. Each config file should contain a hash named pkgs. For each directory the hash should contain an entry with the directory name as key. Mod directory names may only contain the characters a-zA-Z0-9_-.

Mod options:

name

A string representing the (human readable) name of the mod.

path

A comma-delimited string of the form category,subcategory,subcategory,...,item. There can be any number of subcategories, but the default stylesheet is made for two-element paths (category,item).

If multiple mods have the same path, the user will be allowed to choose at most one of them.

default

A boolean which, if true, marks this mod as the default mod for its path.

deps

A comma-delimited string representing a list of mods that must be included in the final package if this mod is included. The pkgs hash need not contain an entry for the dependencies.

For example, if two mods share a large part of their contents, then the shared part could be split into a third mod, and both of the original mods should depend on it. This third mod should not be included in the hash, as it shouldn't need to be manually selected by the user.

Example:

  ---
  pkgs:
    mymod-basher:
      name: MyMod
      path: "Scout,Boston Basher"
      default: true
      deps: mymod-base
    mymod-sandman:
      name: MyMod
      path: "Scout,Sandman"
      default: true
      deps: mymod-base

TODO

For 0.001: * Tests * More/Clearer documentation * Nicer user interface

AUTHOR

Marius Gavrilescu, <marius@ieval.ro>

COPYRIGHT AND LICENSE

Copyright (C) 2014 by Marius Gavrilescu

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.18.2 or, at your option, any later version of Perl 5 you may have available.