Creating Sources - EvaTheDM/mildly-magical-inspiration GitHub Wiki
You can create sources for Mildly Magical Inspiration in two different ways. Either directly from within Foundry, which is generally advised if you consider yourself simply a consumer or if you know your way around coding a little (not much knowledge about coding itself, more knowledge about which mistakes to avoid when dealing with JSON-data) you can create your sources externally.
If you'd like to know how to create sources from within Foundry check out the Getting Started Guide.
Before Beginning
Before you begin creating your first source be aware of the following things: the module is very picky over which fields to allow and which not. Make sure you set up your file in a way that doesn't cause the module trouble, which is exactly what I'll be explaining here. Second, ids and ownership of cards aren't imported or exported by the module. This is to assure that no issues come up like a deck not being usable due to a card having an owner id set to that of a non-existing player. All other options you can change freely.
Base Template
You can either create your file from scratch or use the base template that you can download here.
Creating a basic setup
A valid source file is nothing more but a simple JSON-file. On the most basic level it consists of three keys: title, author, cards. The author field doesn't have much use at the moment, other than being there but it felt right to include it. The title and author need to be string values while the importer expects the cards value to be an array. If you are writing your template from scratch you could start with something like this:
{
"title": "My Source Title",
"author": "My Name",
"cards": []
}
Card Data
The heart of each source is the card data. The cards variable itself, as you have already learned is an array. Each item in this array consists of its very own object though each of these objects should be set up in a similar (if not to say identical) way. If you enter all possible data that can be entered each of your card objects will (or rather should) look like this:
{
"title": "My Card Title",
"subtitle": "My Card Subtitle",
"include": true,
"cost: [
"1",
"Reaction"
],
"duration": [
"",
"Instantaneous"
],
"description": "My Card Description"
}
Cost and Duration
Cost and duration are both arrays themselves. The first string represents an amount and as such will usually be a number. The second value is also a string. While the module uses Free Action, Action, Reaction and Bonus Action as its standards for cost and a different set of the duration the entries here aren't restricted. You can type in whatever you want, though generally it would be advised to keep these fairly short.
Checking and Sharing Source
Once you've finished your source you should check to make sure it is actually still a valid JSON file. There are many sites that let you validate JSON-data directly online, so be sure to use them. After making sure that your source is a valid JSON-file you should use it to create a source from a file in Foundry with the Mildly Magical Inspiration-module. Once you've made sure everything is as you would like it you can then share it with others or save it for yourself as a backup.
If you wish to share it with other users of this module feel free to contact me either here on github or over discord (Eva#4821). I will then include it in this wiki as available sources for the module and be eternally grateful for your support!