Wagic/PackCode
From Miki
Contents |
Create Custom Packs!
This is an explanation on how to add your own custom packs to Wagic's shop. This only deals with designing the store's packaging, not the actual cards themselves. For an explanation on how to add new cards, please visit the code documentation. If you have questions, feel free to ask them in our Cards/Sets creation forum.
File Structure
Packs are XML files located in the Res/packs folder. Any file placed in this folder will be checked, and will be loaded into the game if recognized as a valid pack. The standard Wagic distribution should come with several special packs in this directory-- we highly encourage you to open and view one of these files as an example while reading this document.
A pack should, at the very least, contain the following:
<pack name="Example" desc="One random card from any unlocked set.">
<slot>
<random_card></random_card>
</slot>
</pack>
A pack may have as many slots and cards as necessary.
Pack Layout
CARD and RANDOM_CARD
These are the most important part of any pack: the actual cards!
- Both card and random_card can take a "copies" attribute.
- CARD is used to pick a specific card. It works like <card>Birds of Paradise</card> or like <card>12121</card>.
- RANDOM_CARD is used to pick a random card. It must contain a filter describing which cards are appropriate for this slot.
PACK
Every pack file must be wrapped in "<pack>" and "</pack>" elements. These elements may additionally have several attributes:
- Name - The name of the pack, as shown in the shop. For a normal booster, this might be "10E" or "LOR".
- Type - The type of pack, as shown in the shop. Any value will work here, but we suggest things like "Pack", "Booster", or "Starter Deck".
- Price - The base price of the pack. Wagic will modify this price based on the shop's current market values.
- Pool - A filter describing a "pool" of cards from which the pack is assembled. There must be at least as many cards in the pool as the maximum booster size. Additionally, pool takes two prefix values: "all" or "unlocked". By default the system draws this pool only from unlocked sets-- if you'd like to cheat a bit and draw from any set, start your pool with "all ".
- Requires - A filter describing a collection of cards used as an unlock requirement. If this collection is empty, the booster will not show. May be left blank to start unlocked.
- Desc - A description, displayed as the pack's "alternate render".
SLOT
- Copies - How many items to select from the following entries. Selections are independent, meaning that it picks a random entry for each copy.
- Pool - An override for the pack's global pool filter.
Slots are used to set up probability without mucking around with percentages and other math. For example, the following slot would have a 1:8 chance of resulting adding a mythic rare to the player's collection, 7:8 chance of adding a rare.
<slot> <random_card>rarity:m;</random_card> <random_card>rarity:r;</random_card> <random_card>rarity:r;</random_card> <random_card>rarity:r;</random_card> <random_card>rarity:r;</random_card> <random_card>rarity:r;</random_card> <random_card>rarity:r;</random_card> <random_card>rarity:r;</random_card> </slot>
