Ruleset - Data Files

Ruleset Data Files

Rulesets are composed of a base.xml file, as well as any additional XML files, Lua script files, graphic files (PNG, JPG), font files (TTF, FGF), and token files (PNG, JPG).

base.xml

Every valid ruleset must have a base.xml file in the root of the ruleset folder or zip file (.pak). The name of the ruleset is always the folder or zip file name, where the base.xml is stored.

The base.xml file consists of the following tags:

Root Element

 

Root Element

 

<root>

The main root node contains all the meta-data for module definition files.

Root Attributes

 

version

The string matching the version number of the FG client version that uses this ruleset format (Ex: "3.3") This can also affect the behavior of certain interface elements for backward compatiblity. See the Ruleset API Reference for more information.

release

The string matching the release number of the ruleset that is used for saving data.

logo

The path of the logo graphic to use for this ruleset, usually logo.png. The logo is always displayed at 70x70 pixels.

Root Sub-Elements

 

See the Assets and Settings section of the Ruleset API Reference for all valid child tags.

Additional XML Files Format

Additional XML files can be defined in the ruleset using the "includefile" child tag with a "source" attribute equal to the file path of the XML file within the ruleset folder/file. Any additional XML files share the same file format as the base.xml file.

Lua Script Files Format

Lua script files can be defined using the "script" child tag. The Lua script code can be included between the script tags (i.e. script block), or a script file can be specified using a "file" attribute. If the "file" attribute is specified, then the full path of the script file within the ruleset folder/file needs to be specified. If the script tag is defined as a child of the root element of an XML format, then it is considered a "global" script, and requires a "name" attribute. Script tags can also be defined for a window class asset, a template asset, or a window control definition within a window class asset.

Graphic Asset and Font Files

FG supports most common graphic image file formats, but PNG is primarily used for ruleset graphics, due to the need for transparency to be supported by the graphic asset.

The following tags will define graphic assets: font, framedef, and icon. For more information on defining these assets, see the Assets and Settings section of the Ruleset API Reference. Any file name referenced by the tags must include the full path of the graphic asset file within the ruleset folder/file.

Token Files

Any graphic files that are included in the "tokens" subfolder of a ruleset folder/file are automatically added to the GM token bag as token assets with the same folder structure as they are included in the tokens subfolder..

File Location Conventions

In the CoreRPG ruleset (and many others), the following folder and file conventions are followed.

First, the base.xml, license.html, and logo.png are included in the base of the ruleset, as well as a gameelements.xml file for global settings tags and dice asset definitions.

Next, there are a number of subfolders that are set up within the ruleset to organize different uses

Folder

Type of Files

Folder

Type of Files

campaign

Templates and windows for standard record types and custom campaign lists

common

Common templates

ct

Combat tracker templates and windows

desktop

Desktop panels, templates and windows

graphics

Graphical assets (frames, fonts, icons)
(usually stored in subfolders by buttons, decals, fonts, frames, icons, portraits, radial, sidebar, tabs and toolbar)

ps

Party sheet templates and windows

ref

Templates and windows for the reference manual window and other standard reference windows

scripts

Global script files

strings

String assets

tokens

Included token files

utility

Templates and windows for any remaining tools (calendar, color, options, ...)

If there are any script files tied to specific templates, window classes or window controls, then another subfolder called scripts is typically included within each of the subfolders above.