Xml Game Description - Gravecorp/OCTGN GitHub Wiki

The game description is expressed in XML. The corresponding XML schema definition is available here: game.xsd

File Structure

One can load several Python files. Function that are declared inside those files can then be used by game actions (see Action Definition).

Scripts are referenced inside a scripts tag, which contains a collection of script tags. Each tag has the following attributes:

  • src (The id of the relationship defined in game.xml.rels pointing to the Python script file.)

A relationship to a Python script should have the http://schemas.octgn.org/script type. Here's an example of a correct relationship:

<Relationship Target="/scripts/actions.py" Id="r10" Type="http://schemas.octgn.org/script" />

This is used to assign initial conditions to the global variables are readable and writable by all players. The variables are referenced in globalvariable tags, and are written as such:

<globalvariables>
    <globalvariable name="dealer" value="1" /> 
</globalvariables>

NOTE: The global variables are always stored as a string, and must be converted via python if you wish to treat them as another variable type such as a dictionary.

The tag defines the appearance and content fields of the game cards. The following attributes are available:

  • back (An image resource for the card back)
  • front (An image resource for the default card front)
  • width (The width in mm of the card)
  • height (The height in mm of the card)
  • cornerRadius (The rounded corners radius of the card, in mm. Optional and defaults to 0 - square corners)

The content fields which contain information like cost to play, rules, rarity, or anything else the game needs are defined by tags. A field "name" is always implicitly defined by OCTGN. The following attributes are available:

  • name (The name of the property. ie "Cost", "Rules" etc..) (#Note: Valid name characters are in the ranges: a-zA-Z0-9 - _)
  • type (The data type of the property. Known values are "String" and "Integer".
  • ignoreText (Boolean: true/false, defaults to false and applies only to String types. Indicates whether this field is ignored when during non-specific searches, e.g. filter inside a group window.)
  • textKind (FreeText (default)/Tokens/Enum. Helps OCTGN treat String properties correctly. FreeText is any text, and will not appear as a filter in the sealed deck editor; Tokens means that the property contains space-separated values (e.g. card type may be "Beastfolk Warrior", or color may be "Blue Yellow"); Enum means the string is a restricted set of possible values (e.g. rarity is "Rare", "Common" or "Uncommon").)

The table tag defines the characteristics of the virtual card table and the actions that are available from it. The following attributes are available:

  • visibility (The default visibility of cards in this group. Usually "undefined")
  • ordered (True if the order of the cards in the group is important, false otherwise.)
  • width (The width of the group in mm.)
  • height (The height of the group in mm.)
  • hidden (When true, this property should never be displayed to the user. Isn't 100% working right now, e.g. it still appears in the deck builder.)

Defining the Group and Card actions is explained in the Action Definition article.

The tag defines the Hand, Counters, player-specific Global Variables and Groups available to each individual player. For details on Counter definitions, consult the Counter Definitionarticle.

The player specific Global Variables are used to set initial values to the player's personal set of global variables. These are writable only by the player but are still readable to other players. They are defined as such:

<globalvariable name="standing" value="1" /> 

The details on the Hand and Group definitions are explained in the Group Definition article. It also accepts the following attribute:

  • summary which describes the key indicators displayed inside the player tabs. Text is free, but {#name} placeholders are replaced by either the card count or the counter value of the corresponding object. E.g. {#Score}/{#Hand} may display 5/2 meaning a score of 5 and a hand count of 2 (if the Score counter and the Hand group are defined).

The tag defines common elements all players share among each other. It contains Counter Definition and Group Definition.

The tag defines the deck format. It consists of one or more

child-tags that structure the deck into multiple parts like "Main Deck" and "Side Deck". The tags require the following attributes:
  • name (The name of the deck section.)
  • group (The name of the group into which the sections should be moved when a deck is loaded.)

The tag uses exactly the same format as the tag.

⚠️ **GitHub.com Fallback** ⚠️