LoganBarnett / armycalc-twr-builder

Library used to build TWR files for use with ArmyCalc

Home Page:http://semmons99.github.com/armycalc-twr-builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

This library is used to build TWR files for use with ArmyCalc

Requirements

This program requires Ruby and the following gems:

haml
archive-tar-minitar
fastercsv

Ruby needs to be run with the -rubygems argument, add RUBYOPT=-rubygems to your environment to do this.

set RUBYOPT=-rubygems; export RUBYOPT

Usage

There are two ‘rake’ commands you can use

rake generate CONFIG=
rake build CONFIG=

The first creates the necessary XML files based on the data provided in the specified config file.

The second runs generate and then packs the resulting files into a TWR file.

The following command can be used to clean up temporary files.

rake clean

Config File Layout

The config file is a standard YAML file; below is an example.

---
ruleset: Sample Ruleset
name: Sample Army
revision: 1
author:  U R Namehere (you@example.com)
defaultArmyName: My Army
units: units.csv
bonuses: bonuses.csv
validator: validator.lua
attrs: dexterity strength agility life
hiddenattrs: field1 field2
media: media

‘ruleset’ is the unique name of your rule system. Example ‘WH40K 5E’ ‘WFB 7E’

‘name’ is the name of the army. Examples ‘Space Wolves’ ‘Dwarves’

‘revision’ is the revision number of the rule system. Increment this each time you change the files so that ArmyCalc can differentiate between versions of your file.

‘author’ is optional.

‘defaultArmyName’ is optional. Examples ‘The Sons of Russ’ ‘Spudz Crew’

‘units’ is the name and relative location of the units CSV.

‘bonuses’ is the name and relative location of the bonuses CSV.

‘validator’ is the file name and relative location of the lua code file that implements the validation rules for your army.

‘attrs’ is a space separated list of the attributes to display in the unit’s stat line in ArmyCalc. These fields should be included in both CSVs.

‘hiddenattrs’ is a space separated list of the attributes to include in unit stats that will NOT be displayed in the stat line in ArmyCalc. These fields should be included in both CSVs.

‘media’ is the relative location to look for thumbnail unit image files.

CSV Layout

Units CSV

The following columns are required in the units CSV. You also need to include a column for each item in the ‘attrs’ list in the config file.

name,description,category,min,max,baseCost,costPer,thumbnail

‘name’ is the unique name of the unit. Examples ‘Blood Claw Pack’ ‘Cannon’

‘description’ is the unit description.

‘category’ is the category of the unit. Examples ‘Troop’ ‘Core’ ‘Hero’

‘min’ is the minimum number allowed when a unit is taken.

‘max’ is the maximum number allowed when a unit is taken.

‘baseCost’ is the base cost of the unit when taken if applicable.

‘costPer’ is the cost per model when the unit is taken if applicable.

‘thumbnail’ is the file name (case sensitive) of a picture that represents the unit. This file should be located in the folder named in ‘media’ in the config file.

‘attrs’ and ‘hiddenattrs’ can be left blank when they do not apply to a unit.

Bonuses CSV

The following columns are required in the bonuses CSV. You also need to include ‘attrs’ from the config file.

name,description,min,max,baseCost,costPer,owner

‘name’ is the name of your bonus and needs to be unique for the owner only. Examples ‘Power Sword’ ‘Amulet of Power’

‘description’ is the bonus description.

‘min’ is the minimum number allowed when a bonus is taken.

‘max’ is the maximum number allowed when a bonus is taken.

‘baseCost’ is the base cost of the bonus when taken if applicable.

‘costPer’ is the cost per model when the bonus is taken if applicable.

‘owner’ is the owner of the bonus. There are two possibilities here, the bonus can either be owned by unit, in which place the owner is the name of the unit. The other possibility is the bonus is owned by another bonus, in which case the owner is “unit name/bonus name” for example “Blood Claw Pack/Transport”.

‘attrs’ and ‘hiddenattrs’ can be left blank when they do not apply to a unit.

Resources

About

Library used to build TWR files for use with ArmyCalc

http://semmons99.github.com/armycalc-twr-builder

License:MIT License