-
Notifications
You must be signed in to change notification settings - Fork 2
Game Definition
The package relationships must link to the XML Game Description. The type of this relationship must be http://schemas.octgn.org/game/definition
The XML definition has relationships to various game media, e.g. card backs, icons, ...
A typical OPC [Content_Types.xml] for an OCTGN game definition looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
<Default Extension="png" ContentType="image/png" />
<Default Extension="jpg" ContentType="image/jpeg" />
<Default Extension="wdp" ContentType="image/vnd.ms-photo" />
<Default Extension="xml" ContentType="text/xml" />
<Default Extension="o8d" ContentType="octgn/deck" />
<Default Extension="py" ContentType="text/x-python" />
<Default Extension="txt" ContentType="text/plain" />
</Types>
The o8g files must contain the following files and folders. When creating the archive it is important to select the files directly and not the folder they are located in. File names (and presumably folder names too) may not contain spaces
+ [Content_Types].xml
+ .xml (XML game description)
+ _rels
. + .rels
. + .xml.rels
Further folders to structure the contents are possible but not required. Often module creators define additional folders like "groups", "counters" and "cards" to hold the respective images. The contents of a "Blue Moon" game module might look like this:
+ [Content_Types].xml
+ bluemoon.xml
+ _rels
| + .rels
| + bluemoon.xml.rels
|
+ cards
| + back.png
|
+ counters
| + crystal.png
| + reddragon.png
| + greendragon.png
| + bluedragon.png
|
+ groups
| + hand.png
| + draw.png
| + discard.png
|
+ scripts
. + actions.py
The Game Definition can define a plain text document to serve as the "Game Rules" and/or "Game Help". These are specialized buttons that appears under the "Help" tab of the in-game ribbon. To include a link to the Game Rules document in a game definition, you must add the following lines:
Under [Content_Types].xml :
<Default Extension="txt" ContentType="text/plain" />
Under _rels/.rels :
<Relationship Target="/rules.txt" Id="rul" Type="http://schemas.octgn.org/game/rules" />
To add a window for Game Help (keyboard shortcuts, faq's, etc.):
<Relationship Target="/help.txt" Id="hlp" Type="http://schemas.octgn.org/game/rules" />
NOTE: The only change for adding a help document is the "Id" & "Target". NOTE: The target text document can be any filename, just make sure it matches the name of the text file!
You can add up to two custom fonts to include with your game definition. One font affects the context menu (right click menu) the other will affect the chat window. To do this include 1 or 2 fonts into the root of the definition directory. Both fonts need to be TrueType (file extension is .ttf). Both fonts can be named anything you want. Preferably they should keep the original filename. In order for the game to see these fonts you must do the following.
Add these lines to the .rels:
<Relationship Target="/Western-Regular.ttf" Id="fnt" Type="http://schemas.octgn.info/game/font" />
<Relationship Target="/visitor1.ttf" Id="chat" Type="http://schemas.octgn.info/game/font" />
Whichever font is to be used for the chat window needs to have Id="Chat". The target names are the original font filenames.
Now we need to add the font mime type to the [Content_Types].xml file.
<Default Extension="ttf" ContentType="application/x-font-ttf" />
Some fonts might only look correct in certain sizes. So specify a size you'll need to add two parameters to the main xml file. Both need to go in the globalvariables element like so:
<globalvariables>
<globalvariable name="globaltags" value="{ }"/>
<globalvariable name="cattach" value="{ }"/>
<globalvariable name="smartmarker" value=""/>
<globalvariable name="fontsize" value="12"/>
<globalvariable name="chatsize" value="10"/>
</globalvariables>
Fontsize is the context menu and chatsize is for the chatwindow.
The game definition can define custom properties for cards.
Some temp notes:
17:30 <brine> I think ignoretext hides it from that little search box in the pile view windows
17:31 <brine> _maybe_ hides it from the deck editor columns, doubt it though
17:32 <brine> and textkind parses the value for the sealed deck editor
17:33 <brine> like if my subtype was Elf Warrior, it would split it apart for the check boxes
17:34 <brine> textKind (FreeText (default)/Tokens/Enum. Helps OCTGN treat String properties correctly. FreeText is any text; 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").)
17:35 <brine> haven't had a chance to test and see if they still work properly
17:41 <brine> yeah still good
17:44 <brine> freetext properties are ignored in the sealed deck editor filter