Exporting custom set in text form?
Community Rules
‖ Forum rules
Apologies if this has come up before, but I couldn't find any threads about this searching around here. I'm making a custom cube/set with some friends here and it's a great resource, but one thing I noticed that would be extremely useful is a way to export your custom cards/sets in text form. I'd like to take our custom set and implement it in a rules engine, and a basic text spoiler format with the rules text would be much more handy than copy/pasting the text from this site as we go.
Elder Vampire
We can add that. Give me some time, I'll try to work it in.
Elder Vampire
If you have any access level to a set (controlled by owner in the collaboration access management), you'll have the set control menu on the top left.DorkmasterFlek wrote: ↑3 years agoApologies if this has come up before, but I couldn't find any threads about this searching around here. I'm making a custom cube/set with some friends here and it's a great resource, but one thing I noticed that would be extremely useful is a way to export your custom cards/sets in text form. I'd like to take our custom set and implement it in a rules engine, and a basic text spoiler format with the rules text would be much more handy than copy/pasting the text from this site as we go.
That now has an Export option, at the bottom:
For now, we offer two options for exporting:
- Plain text in a .txt file
- A printable PDF in our Playtesting format.
Fantastic! Thanks so much for the work on this, and the rest of the site. 
Hey, the text export feature is awesome, but would it be possible to get this as an xml file export for use in programs such as Cockatrice? I'm looking to create several custom sets here, and it would be really nice to be able to export them as complete xml files that can simply be imported into Cockatrice without needing to write the whole xml file myself.
Hi, if anybody that can make that happen is still reading this thread, I'd humbly second this request. Being able to easily export a custom set to the Cockatrice (and maybe Draftmancer as well? in order to draft custom sets) format would be amazing! I'm working on my custom set myself, and it would be awesome to have the opportunity to playtest the set using the Draftmancer/Cockatrice combo, without having to manually create the input files for the set. If it makes things easier, here are the specs for the file formats for quick reference: I understand this might not be an easy task, so a quick alternative for now would be adding the following info to the current plain text export mode (with set info at the start of the file):CrimsonDemon wrote: ↑2 years agoHey, the text export feature is awesome, but would it be possible to get this as an xml file export for use in programs such as Cockatrice? I'm looking to create several custom sets here, and it would be really nice to be able to export them as complete xml files that can simply be imported into Cockatrice without needing to write the whole xml file myself.
- set: full name
- set: abbreviated name (like KTK)
- card: rarity
- card: URL to the rendered card image*
- card: name of the card on the back (for DFCs)
Thanks in advance for any help on this, and more broadly thanks for all the great work you've done making MTGNexus. Cheers!
*in order to batch download the pictures and save them with appropriate names, to be able to then put them on an image hosting site; or, if that's okay with MTGNexus of course, to use the link directly for the Cockatrice/Draftmancer files
disclaimer: that's my very first post here, so I hope I didn't break any rules (I think I've checked all the pinned posts here describing the rules), but if so, please let me know
Elder Vampire
Apologies, I didn't see this before the tag.
I can definitely add this.
I can definitely add this.
Awesome, thank you!
As for the tool itself, I've been working on it, an the MVP version is done. As of now it can take Cockatrice XML v3 as input, and spit as output Cockatrice XML v3 (fixed and cleaned up as best as it can) and a Draftmancer file for draft/sealed (with classic play booster layout, i.e. 10 common slots +3 uncommon slots + 1 rare/mythic slot (mythic with 1/8 chance); more complex layouts, resembling the modern ones with slots for The List, "special guests" etc., would be much more complicated, but doable I think). I started with Cockatrice v3, as I've found a Star Wars: the Gathering v3 file to use as sample input; it required some manual fixing, and was incomplete, but it was a full set that was somewhat field-tested, so I reckoned it'd be a good sample input that I could then test the results with. Everything seems to be working, with the output provided by the tool I've managed to do a few drafts with a friend on Draftmancer, and the play the results on Cockatrice, with everything going smoothly
I'd be happy to share the tool with anybody interested, both executable and code. Once a version able to handle Cockatrice v3 + v4, Draftmancer format, and MtG Nexus format is ready, I'll make it available to everyone, and before that just let me know if you're interested. Hope it'll be useful to someone
Glad to come back to my comment here and see this! I look forward to seeing how this comes out, as it would save me from learning how to use Magic Set Editor, especially since it doesn't seem to have the card frames that MTGNexus offers, and I like the card frames here.
I would love to have that tool, if you wouldn't mind. If I may ask, does it take specifically text files exported from MTGNexus and convert them into .xml files that Cockatrice can read and use without me having to edit the file itself?hakimstark wrote: ↑2 years agoI'd be happy to share the tool with anybody interested, both executable and code. Once a version able to handle Cockatrice v3 + v4, Draftmancer format, and MtG Nexus format is ready, I'll make it available to everyone, and before that just let me know if you're interested. Hope it'll be useful to someone![]()
Also @Feyd_Ruin, not to rush you, but are there concrete plans to add the Cockatrice xml export feature to MTGNexus? I really don't mean to be a bother, I just want to know if I should bother moving forward with other set editors to make my sets.
Elder Vampire
The idea would be that you hit "export to cockatrice" and it'll create the xml files for you, including the image paths to your rendered cards (I see that it downloads them locally on the first pull, so there's no issue there). It's literally just iterating through the cards and putting them in the right text format. I haven't looked into Draftmancer though, but if it's designed to allow custom sets, it shouldn't be an issue.CrimsonDemon wrote: ↑2 years agoI would love to have that tool, if you wouldn't mind. If I may ask, does it take specifically text files exported from MTGNexus and convert them into .xml files that Cockatrice can read and use without me having to edit the file itself?hakimstark wrote: ↑2 years agoI'd be happy to share the tool with anybody interested, both executable and code. Once a version able to handle Cockatrice v3 + v4, Draftmancer format, and MtG Nexus format is ready, I'll make it available to everyone, and before that just let me know if you're interested. Hope it'll be useful to someone![]()
Also @Feyd_Ruin, not to rush you, but are there concrete plans to add the Cockatrice xml export feature to MTGNexus? I really don't mean to be a bother, I just want to know if I should bother moving forward with other set editors to make my sets.
It's absolutely something on the docket. It's a matter of when, not if.
Ive side quested a little here and there, but I need to finish v2 of the site, which only has a few CCC updates in it, and then CCC will be the next big push. @Legend and @Calvernock have both gaven me a nice list of feature requests recently; I know there's several card templates that we need (adventure and old frame are definitely highly wanted), etc. Exporting for cockatrice will be in that. I should probably go ahead and start a to-do list.
Cool stuff, I've recently started making a game that autotranslates rules text into actual logic, do let us know about your approximate roadmap 
Rare that I reply to an old forum, but...
I made a custom magic set on MTG Design because they have a direct export to Cockatrice. While looking at others' work, I noticed MTG Nexus is by far the more popular site (and alive). But I use Cockatrice to play online with friends.
@hakimstark and @Feyd_Ruin, whatever ended up happening with this?
I made a custom magic set on MTG Design because they have a direct export to Cockatrice. While looking at others' work, I noticed MTG Nexus is by far the more popular site (and alive). But I use Cockatrice to play online with friends.
@hakimstark and @Feyd_Ruin, whatever ended up happening with this?
Elder Vampire
Thanks! Lemme know how it goes. It'd be cool to share my stuff on here while also using Cockatrice.
Elder Vampire
Ok, so my problem now is: I don't have Cockatrice.
I've exported my first set as an xml set: Is there any way you (or anyone reading this with cockatrice) can test and see if this imports correctly?
If so, it'll just take a little more work to get it set up to generate for any set.
Yes, it works! In fact, by linking to the image url, you managed to get the image without requiring me to upload a folder of pngs. So that's actually a step above MTG Design. I managed to confirm this with Nethercraft, Ved of the Underwood, and Perversive Council.Feyd_Ruin wrote: ↑3 weeks agoOk, so my problem now is: I don't have Cockatrice.
I've exported my first set as an xml set:
END.customcards.xml
Is there any way you (or anyone reading this with cockatrice) can test and see if this imports correctly?
If so, it'll just take a little more work to get it set up to generate for any set.
If you can get this rolled out, that'd be enough for me to switch to MTG Nexus. But, that does mean I have to recreate 200 cards from scratch. I don't know what wizardry would be required, but if it's at all feasible to work this in reverse and take a text file and turn it into a base for the card, that'd be incredible. But I bet it'd have troubles around images and artists.
Elder Vampire
It's pushed out.
I *think* I got everything solid with transform, etc.
Cockatrice has front/back listed as separate cards with an "attach" property, so I mimic'd that.
I tried it on one of my sets with several transforms, and it looks right compared to real cards.
Should be good?
I *think* I got everything solid with transform, etc.
Cockatrice has front/back listed as separate cards with an "attach" property, so I mimic'd that.
I tried it on one of my sets with several transforms, and it looks right compared to real cards.
Having some kind of Import function is something I'd love, but formatting custom cards is very non-standardized. I could potentially build something if what you're importing is a real export and not just text, but it would still require uploading art and rendering. (Rendering is done front end, not back end, so it can't be automated ).
Code: Select all
<sets>
<set>
<name>COL</name>
<longname>The Curtain of Light</longname>
<settype>Custom</settype>
<releasedate>2023-01-30</releasedate>
</set>
</sets>
It works! Caveat, I do have to rename it to just "COL", since Cockatrice refers to files by their set abbreviation.
As for importing, I have a Google Doc and image links and stuff. I'm just not looking forwards to copy/pasting each name, type, text, flavor, etc. for 400+ cards. Even a rough draft to go in and edit each one might save time. But if rendering is on the front side, then that's fine. Besides, I would still need to edit each one anyways to make sure the text fits, and I would still need to reupload the art, so it might be best to do each from scratch.
Thanks so much for this upload! I can start re-making the cards in MTG Nexus now.
As for importing, I have a Google Doc and image links and stuff. I'm just not looking forwards to copy/pasting each name, type, text, flavor, etc. for 400+ cards. Even a rough draft to go in and edit each one might save time. But if rendering is on the front side, then that's fine. Besides, I would still need to edit each one anyways to make sure the text fits, and I would still need to reupload the art, so it might be best to do each from scratch.
Thanks so much for this upload! I can start re-making the cards in MTG Nexus now.
- Attachments
-
@Feyd_Ruin
Actually, while I have you here... I've been doing some poking around MTG Nexus, familiarizing myself with how it works. I noticed there is a Custom Cards Search, but not a Custom Set Search. And the card search doesn't let me search by set. I would love to be able to filter through all the sets and see who has sets of 200+ cards, or who else has "RWBY" sets or something.
Also, once inside of a set, I can't search that set for cards. I have to display the whole thing, switch to Oracle view, and Ctrl+F, just to find "Kirby" in a Kirby Set. I know the card types are all just text boxes, but it'd also be nice to be able to see all "Sorcery" or "Legendary" cards in a set. Or even which ones have "{W}" in their mana cost or "Flying" in their text.
This might be a significantly bigger task than just a new export, but are you willing to expand the search and navigation around custom sets?
Actually, while I have you here... I've been doing some poking around MTG Nexus, familiarizing myself with how it works. I noticed there is a Custom Cards Search, but not a Custom Set Search. And the card search doesn't let me search by set. I would love to be able to filter through all the sets and see who has sets of 200+ cards, or who else has "RWBY" sets or something.
Also, once inside of a set, I can't search that set for cards. I have to display the whole thing, switch to Oracle view, and Ctrl+F, just to find "Kirby" in a Kirby Set. I know the card types are all just text boxes, but it'd also be nice to be able to see all "Sorcery" or "Legendary" cards in a set. Or even which ones have "{W}" in their mana cost or "Flying" in their text.
This might be a significantly bigger task than just a new export, but are you willing to expand the search and navigation around custom sets?









