-
Notifications
You must be signed in to change notification settings - Fork 2
Set Definition
Set Definitions are simply xml files that define cards in a specific set of a game.
+ set.xml (Must be named exactly this)
+ cards (Not required. You may include card images in a set, but it is prefered to use [Card Packages](Card package) so your definition isn't to large to download)
| + cardGuid.png (Unique GUID of a card.)
| + cardGuid.altType.png (Unique GUID of the same card, with the image for its 'altType' alternate form corresponding to that alternate's 'type' tag.)
|
+ markers (If any markers come with your set, you could put them here)
We will refer to this package as SetPackage1
. Once you are complete with SetPackage1
, you will need to include it into your [o8g](Game Definition). This is the strucure to do so.
+ definition.xml
+ Sets
| + `SetPackage1` Guid (aka 8384b250-da8b-43cb-aa60-9605a3cc18f8)
| + set.xml
| + cards
| + cardGuid.png (Unique GUID of a card.)
| + cardGuid.altType.png (Unique GUID of a card.)
| + markers (If any markers come with your set, you could put them here)
For an example on how to write a set.xml
, check out the Dominoes set.xml
The root element of a set.xml
is the set
element. These are the attributes(all are required)
-
name
- Name of the set. Can be whatever you like -
id
- GUID of the set. Must not be the same as any other set or any other game. -
gameId
- GUID of the game this set belongs to. -
gameVersion
- Minimum version of your game definition required to use this set. -
version
- Version of this set.
Inside of that you are allowed cards
lists. A cards
list looks like this
<cards>
<card id="50d634aa-9aed-4583-81d6-c3097c090271" name="0 | 0"></card>
<card id="92abea24-1caa-49ee-bfbf-f696d64b20d3" name="0 | 1"></card>
<cards>
Inside of a cards
list are card
's. These are the attributes for a card
(all are required)
-
id
- GUID of the card. Must not be the same as any othercard
. -
name
- Name of the card. Can be anything you like. -
size
- the name of the custom card size used by this card, as defined in the game definition's<game><card><size>
tag
Inside of a card
element, you can have property
's. Here are the required attributes for a property
-
name
- Name of the property. Must have already been defined in the [Game Definition](Game Definition) -
value
- Value of the property. Can be almost anything you like.
Any card
can have alternate property sets(include name) defined in the set xml.
-
name
(required) - Name of the alternate. It can be the same as the original name of the card. -
type
(required) - Type of alternate, kind of like aclass
in css. Used in python to identify and switch between alternates for a card. You can't have two of the same type name on the same card, but you can have multiple cards with the same type names. Only numbers and letters are allowed characters to nameType
.
Here is an example
<cards>
<card id="50d634aa-9aed-4583-81d6-c3097c090271" name="jim" size="Wide Card" >
<property name="fruit" value="banana"/>
<property name="stamina" value="1"/>
</card>
<card id="92abea24-1caa-49ee-bfbf-f696d64b20d3" name="joe">
<property name="fruit" value="pear"/>
<property name="stamina" value="12"/>
<alternate name="joe apple" type="altfruit1">
<property name="fruit" value="apple"/>
</alternate>
<alternate name="joe orange" type="altfruit2">
<property name="fruit" value="orange"/>
<property name="stamina" value="15"/>
</alternate>
</card>
<cards>
So in this example card jim
has a fruit=banana
and stamina=1
. He has no alternative, he's just stuck with that fruit.
joe
on the other hand, has some options. His default values are fruit=pear
and stamina=12
.
If he were to switch to type altfruit1
, his name would change to joe apple
, and his properties would be fruit=apple
and stamina=12
.
If he then changed to altfruit2
his name would be joe orange
and his properties would be fruit=orange
and stamina=15
.