Cockatrice export

Login or register to post comments
Wed, 2012-04-04 18:16

Someone know how to export the card with the image into cockatrice???

Wed, 2012-04-04 18:35

i want to know this too

Im a monkey that talks
If you want to help me with my own set please click on this:

Wed, 2012-04-04 19:27
Jéské Couriano
Jéské Couriano's picture

It would help if we knew what Cockatrice was.

Ceterum censeo Bolasinem esse delendam.
Accepting new types for S:tC!
Custom Keywords!

Wed, 2012-04-04 19:29

Cockatrice it's a free program similar to magic work station

Wed, 2012-04-04 20:13
Sewn-Eye's picture

There's a tutorial online. Try googling "Cockatrice custom set" or something. You need to edit the cards.xml file and basically manually type in the new cards. It's time-consuming, but it's the only way.

"Too wary to charge, too prudent to serve. Not anymore."
—Sedris, the Traitor King

Wed, 2012-04-04 20:17

Do you have a link?

Wed, 2012-04-04 20:43
eomund's picture


If you have any experience in a scripting language (such as Python), it should be pretty easy to write a program that will turn the MWS exported file from MSE into something that you can just copy and paste into the Cockatrice set.xml file. I may even do this myself once finals end ... if I do, I'll be sure to post the code somewhere.

In fact, this could be a useful feature for MSE to have included; I personally like Cockatrice a whole lot more than MWS, and based on the number of people using Cockatrice, I'm not alone. How difficult would something like this be to include? I'd be happy to do it myself (again, once finals end), assuming it's not beyond my abilities.

Wed, 2012-04-04 21:19

So you can do it? Really? If you can do it it will be really cool!!!!

Wed, 2012-04-04 21:49
Sewn-Eye's picture

Yes, I've done it before. However, don't forget that the people you play with will have to have the same cards.xml file as you, otherwise they won't be able to see your cards.

"Too wary to charge, too prudent to serve. Not anymore."
—Sedris, the Traitor King

Wed, 2012-04-04 21:55

Yes, i know... But it's okay cause i want to play just with some of my friends... So If you can do it can you put that here?

Fri, 2012-04-06 19:23


Fri, 2012-04-06 21:45
eomund's picture

As I said, I don't have it written, and won't be working on it until finals end in a couple of weeks. Rereading Sewn-Eye's comment, it sounds like he had a script to do it, but doesn't now. So be patient.

Fri, 2012-04-06 21:54
Sewn-Eye's picture

Wait, what? I'm lost.

You just need to follow the instructions here.

"Too wary to charge, too prudent to serve. Not anymore."
—Sedris, the Traitor King

Fri, 2012-04-06 21:55

Wait Sorry, my problem is that sometimes i don't undestand cause i'm italian and my english isn't perfect... So, let me undestand... You two are working to do that?

Fri, 2012-04-06 22:08
eomund's picture

Sewn-Eye, did you import your entire set manually? If so, I am humbled by your patience.

denunzio, sometime this month I will write a script to make importing into Cockatrice easier, but it won't be until the 16th at the earliest.

Fri, 2012-04-06 22:12

Ok now i'm undestand thanks to you and for your work, now i will attempt some news about your work on 16th A happy smile thanks you again

Fri, 2012-04-06 22:14
Sewn-Eye's picture

Manually, yes. It was a very small set (thank God), so it only took one-and-a-half hours.

It's very, very time consuming, unfortunately, but as far as I'm aware, it's the only way to do it.

"Too wary to charge, too prudent to serve. Not anymore."
—Sedris, the Traitor King

Mon, 2012-04-09 15:09
Tahazzar's picture

This is something I used to test purple set for a while in Cockatrice. wrong one
EDIT: right one -

The problem with the images is that they have to located in somewhere. They could perhaps be local files if each player downloads each pic and puts them into the same path (or edits the path themselves)... The text in the file that currently is "http://***/***.jpg" was something like ""+link_repl(".jpg\" (a site which is down now). This template also exports every image. I used this then uploaded the images to this site of mine. I made this "link_repl" function (or whatever these are in this 'language') to change the card names so that they would link right - some characters needed to be changed or something... I really don't remember that well - it was a long time ago...

"The only limit to my freedom is the inevitable closure of the universe, as inevitable as your own last breath. And yet, there remains time to create, to create, and escape. Escape will make me God."

Sat, 2012-04-07 16:41

how can i use the program you linked?

Mon, 2012-04-09 10:56
Tahazzar's picture

Put it into the "data" -folder with the other MSE templates/styles. Then open MSE and go to "File->Export->HTML..." and you should see the Cockatrice symbol in there with MWS and LackeyCCG.

"The only limit to my freedom is the inevitable closure of the universe, as inevitable as your own last breath. And yet, there remains time to create, to create, and escape. Escape will make me God."

Mon, 2012-04-09 11:02

yes ok and after that? how i have to use the file created with the export?

Mon, 2012-04-09 11:42
Tahazzar's picture

Click "OK" then give a name and place where to save (I don't even know if the 'Entire Set' or 'Custom Selection' options work here). It creates a text file with that name which basically is the .xmhl file or whatever it was in the Cockatrice and then a folder with the same name with all the pics in it.

EDIT: This .txt file you created with the export is now the "cards.xml" (obviously make a backup of cards.xml then change the extension[?] or replace all the text in it with the text of the txt file you made). However, to get the pics work you should edit the code to match the place where you place or upload the pics.

"The only limit to my freedom is the inevitable closure of the universe, as inevitable as your own last breath. And yet, there remains time to create, to create, and escape. Escape will make me God."

Mon, 2012-04-09 11:35


Mon, 2012-04-09 11:41
Tahazzar's picture

You checked the edit? I think this how it works if I remember correctly...

"The only limit to my freedom is the inevitable closure of the universe, as inevitable as your own last breath. And yet, there remains time to create, to create, and escape. Escape will make me God."

Mon, 2012-04-09 11:52

no it doesn't work...
if i undestand i do this:
-I use the export of MSE to Cockatrice, ok now i have two file one with the image and a txt file
-Then i change the extension of the .txt on .xml
-I put it on cockatrice in sostituion of the older card.xml

But it doesn't function...

Mon, 2012-04-09 15:08
Tahazzar's picture

*Ahem*, yes, this was indeed one of my html_code/web exporters not Cockatrice exporter *face palm* - let's try again - use this instead (remove or replace the wrong one):

Then export the set, and EDIT the cards.xml file (be careful, it's so big that at least my computer starts getting tricky). Remove the "Spoiler List" from the beginning of the export file then copy everything from it to the "cards.xml" after the <cards> tag (you may need to "create" you own set between the set tags - dunno / can't remember). Replace everything expect the for the "</cards></cockatrice_carddatabase>" tags at the very end of the file.

"The only limit to my freedom is the inevitable closure of the universe, as inevitable as your own last breath. And yet, there remains time to create, to create, and escape. Escape will make me God."

Sat, 2012-08-11 03:04

I just wanted to say that I love you, Tahazzar. This saved me SO much trouble. May your descendants be many and your land be bountiful.

It worked marvelously! I used Find and Replace to fix the image links and set name etc. Notepad++ is the best. Although I don't understand why the commas turned to spaces in the links and into nothing in the card names. Oh well, can't complain. What did you write the program in and what could be used to edit it?

Sun, 2012-08-26 21:54
Tahazzar's picture

If I recall correctly, I just edited the MWS exporter from MSE. So nothing more than Notepad++ was used Big smile
The "code" isn't really that hard to understand; it's full of "replace" -function calls and construction of strings.

"The only limit to my freedom is the inevitable closure of the universe, as inevitable as your own last breath. And yet, there remains time to create, to create, and escape. Escape will make me God."

Sun, 2012-09-16 00:40
agentelrond's picture

Sorry for bumping a semi-inactive thread, but as it hasn't been inactive for over a month, I figured this would be better than starting a new thread.

I'm having some problems with the exporter that I'm hoping someone can help me iron out. I've been able to get it to successfully export, but when I load it up I get several issues that I can't seem to resolve.

First, the text versions of the cards (in Cockatrice) have multiple instances of '%' in them, typically in the mana costs. I see in the exporter where this is being added in using the replace function, but if I rem it out or remove it altogether, the export just gives me a blank file. I'd edit the file and do a mass replace, except there are instances of % where it's necessary.

Second, and more importantly, any card with an apostrophe in the name won't display. I've tried multiple ways of doing it, and no matter what I do, the image won't come up. Thoughts?

EDIT: Fixed the second issue. Now just need a way to get rid of all those %'s

Sun, 2012-09-16 01:38

It would be great if you could share your findings just in case anyone else (read: me) might be having the same issues!

Fri, 2012-12-14 16:12

old but gold thread - but i post here my little programm

maybe someone needs it


crated with - VBA
tested with - word 2002

what does it:

converts the MWS file in cockatrice cards.xml code

where to get:

Wed, 2013-01-09 21:55
kjoppy's picture

I have recently started a project with the following goals

  • Create a universal format for custom card sets
  • Create a public repository for people to upload their sets in this format
  • Write a program to convert card data between all popular MtG oriented applications, including MSE, Magic Workstation, and Cockatrice.

Here is a link to a Magic Salvation Forum thread discussing the project. I've got the Cockatrice dev on board and people are showing general interest.

I have already written a first pass at the converter program in Python. It works well, making getting your cards from MSE to Cockatrice extremely easy. I am very dedicated to fixing bugs and will be actively developing it indefinitely. It is currently released to a few people for testing. If anyone here would like to try it out, let me know via PM and I'll give you a link to the Source Forge page. I expect to release the program publicly very soon.

Once the program is in public distribution I will use Source Forge tickets to deal with bugs etc.

Mon, 2013-01-28 11:52

Howdy folks. I've made an export template script for just this purpose!

You can find it here:

Mirrors: The text -, the icon -

To install it, unzip the contexts and move the folder named "magic-cockatrice.mse-export-template" into the "data" folder of the installation you have for MSE (for windows, it's usually located at "C:\Program Files\Magic Set Editor 2\data").

To use, within MSE go to File > Export > HTML and select Cockatrice. Remember to put in a setcode and longname for the set. The setcode will be the name of the folder that your cards images will be put into within the Cockatrice installation.

Export your set and name it what you want. Cockatrice names its database "cards.xml" and if you want to include you set among the rest of those within your current database of cards, you can copy and past the contents as follows:

<?xml version="1.0" encoding="UTF-8"?>
<cockatrice_carddatabase version="2">
<longname>Fifth Edition</longname>
<longname>Urza's Saga</longname>


The database can be found in *either* "C:\Users\\[USER]\AppData\Local\Cockatrice\Cockatrice" or "C:\Program Files\Cockatrice"

For the card images, you will need to create a folder named the same as your cards' setcode is in the corresponding "\pics\downloadedPics" folder of the Cockatrice folder.

When you export the card images, in MSE go to File > Export > All Card Images and have "{}.full.jpg" in the format field, as this is how Cockatrice refers to card images itself. Save the images in the set's card images folder.

I've based the code off of the forum export template that comes with MSE, so you'll have to forgive some odd inclusions in the code, as it's mostly a cut and paste job and I'm always noticing new mistakes.

A friend of mine has really enjoyed using MSE and wanted a way to export to Cockatrice so we could play games using their cards. The code works with exporting most cards including planeswalkers, flip, split and leveller cards.

Issues: I've had trouble with cards that include commas and apostrophes not showing their card images within Cockatrice, but show up within the list shown. Some looking into the problem has shown that while Cockatrice uses commas and apostrophes as a part of the card's name, MSE doesn't export them. I'm not sure if this is an option that can be changed, or if it can otherwise be easily fixed.

Mon, 2013-01-28 21:00
kjoppy's picture


We should join forces immediately. Your template combined with my program would be an awesome tool. My program is essentially a set of python scripts for manipulating sets of cards, eg. merging two sets together and dealing intelligently with duplicated card names. In addition there are modules for importing and exporting to and from Cockatrice database files and Magic Workstation files.

The reason I included a MWS import module was so that people could get their MSE sets into my program. The original idea was to export with MWS target and then import to my program. From there you can combine your custom cards with the main Cockatrice database and export for use in Cockatrice games. Exporting from MSE to Cockatrice compliant xml as you're doing is much better because the set names are included, unlike with the MWS format. Since I already have a Cockatrice import module my program can already interface with your script's output!

The nice thing about my program is that there is no cut/paste necessary by the user. When it imports cards from a file it creates internal representations of the sets and cards. When it exports, it combines these objects into a single set and then writes cards.xml to the correct location.

Now here's the best part: I've been talking with the Cockatrice dev and he agrees that Cockatrice should be able to load multiple set database files rather than only one as it does now. This would allow people to use your tool to export their sets and not have to combine the output with the main database in cards.xml. This is all in preparation for use with a public custom set repository that we will build in the near future. The idea is that people can browse the public repository, download other people's sets in a standard format (probably some kid of JSON dat), and then use my program as a centralized tool for exporting the data to whatever other program they want to use, be it MSE, Cockatrice, or whatever else.

You really should come by the thread I posted above and see what's going on.

EDIT: If you'd like to test my converter program please PM me and I'll give you a link. I really need testers right now, as coding is finished and it works great on my own machine.

Thu, 2013-02-07 11:36
gamez7's picture

Thanks for telling me. I'll be sure to never go there. Ever.


Wed, 2013-02-20 16:52
Sgt Failure
Sgt Failure's picture

LtEntropy: I used your exported, and it worked out perfectly with a couple of minor problems, listed below.

  • MSE and Cockatrice uses different variants of hyphens. Cockatrice uses the normal "-" while MSE uses an actual hyphen. Exporting with the current script renders cockatrice unable to see what is a card type and what is a creature type, leading to a very very long search menu.
  • Your exporter currently does not include colors when exporting, something some people might find problematic.
  • The Image Exporter of MSE does not export names with commas, apostrophes and other special signs. This is the reason some cards can't be shown from start. Some other special signs also follows this rule, and some languages incorporating special letters support those locally, but other computers does not (AE / Æ being the most common occurance)
All this can be fixed normally with some patience, but I just wanted to let you know.

Thanks alot for all the help!

A card a day keeps the goyf away!

Sun, 2013-03-17 04:24
Nemo Oceansoul
Nemo Oceansoul's picture

ill be watching for this, im working on a set and i find it a lot easier to be able to play cards and have others play those cards so that i can figure out what is wrong with them and change them.
i hope that this is finished soon, the main server for cockatrice just received a Cease and Desist order, might not be to long now until all the servers are shut down.

EDIT: Good News: as far as i can tell all the severs, except for the main are still up.

Tue, 2013-03-19 12:41
kjoppy's picture

The program has been done for some time. Search magicHack on sourceforge.

I want to make a few notes here

1. I will be actively developing this project indefinitely.

2. If Cockatrice goes down, I intend to form a replacement specifically aimed at using user defined cards. I believe this will circumvent any unwanted legal attention.

Direct link:

P.S. If you find bugs, please make a ticket on the sourcefoge page. I check it regularly.

Sun, 2013-05-05 20:11
Plane Maker

Hello all

I found another method and tested it. It works so far. I have to test the custom cards in gameplay and online play.

Please see my post for further information

In the beginning Plane Maker created heavens and the earth.

Thu, 2013-05-16 04:32

Hi im new to the forums but im still having trouble getting the images of the cards to appear in cockatrice. i have the folder with all the card jpegs in it and i have cockatrice leading the card information not just the pictures. my guess is that i dont have the folder in the right place or it is named something incorrect. also i cant find the pics folder in cockatrice, this might cause my problem as well. thnx for anyone who might be able to help me out.

Thu, 2013-05-16 10:25

hi i'm using your program to help me produce a custom set so i can have a great tool for testing a card game i'm deving. i'm currently stuck with the problem of card art not being applied to more than the first card in the set. but 1 of the cards is getting art and everything else is a tundra kavu. if you have time please respond. thnx a ton besides this drawback the program worked very well just took my a while to figure everything out. A happy smile

Fri, 2013-06-28 02:02
Nemo Oceansoul
Nemo Oceansoul's picture

for those keeping up w/ cockatrice it is now being recreated anew into a new program called "The Lotus Project". if anyone know anyone working w/ them on it maybe request a way to direct export from MSE into Lotus. that would be very very nice. especially considering what its trying to do.

Thu, 2014-11-06 23:02
IceMetalPunk's picture

For those who are bothered by the way MSE removes commas, apostrophes, etc. I made a PHP script (and a batch script to run it) that takes a directory (where all the card images have been exported to), an MSE Set file (the source of those images), and a suffix/exension (so .png, .jpg, .full.jpg, etc.), and then automatically fixes the filenames so that they contain all path-valid characters, including commas, apostrophes, etc.

The download is below, but PLEASE READ THE REST OF THIS POST before running anything!

Important Notes! (And a Little Setup.)
Firstly, this only works on Windows machines unless you know what you're doing (because batch script).

Secondly, before running anything, you should open the MSE_Filename_Fixer.php file in a simple text editor like Notepad or Notepad++. At the top there is a comment telling you to change a path to your own MSE installation path--this should be the path where your mse.exe is located. Make sure you only change that path, nothing else--leave the rest of the line, including quotes, as-is. Then save the changes.

Thirdly, you will need PHP installed to run this. This comes with most server stacks, but you can download a standalone version here. It needs to be in your system's PATH as well; see the spoiler below for how to set that up if you don't know.

Adding PHP to your PATH

To add PHP to your system's PATH variable, follow these steps.

1) Open the Control Panel. If you have a newer version of Windows, you can search here for Environment Variables and click Edit the System Environment Variables. Otherwise, find System->System Properties->Advanced tab.

2) Click the Environment Variables button.

3) The bottom box should be labeled System Variables. Scroll through there until you find the variable named Path (it's in alphabetical order). Select it and click Edit.

4) At the end of the textbox, add a semicolon (that's a ; character) followed by the full path to where you extracted PHP's main files (specifically, it's where php.exe is). Don't add spaces anywhere.

5) Click OK on all the dialog boxes. You're done!

Running the Filename Fixer
Now you can run the MSE_Filename_Fixer.bat file--but to avoid issues, be sure to run it as an administrator. That means don't double-click it; right-click it and choose Run As Administrator.

When the MSE_Filename_Fixer.bat file opens, it'll ask you for three things: the full path of the exported images directory, the full path of the MSE Set file, and a suffix/extension. You can right-click and paste this information in. Make sure all your paths are complete, including drive (i.e. C:\Users\Me\Documents\Exports, not just \Users\Me\Documents\Exports). Do NOT put any quotes around them.

When the info is entered, it'll tell you how many files were matched with their card names and set properly. If that's less than the total number of files, it will also output a list of files it couldn't match, so you can manually edit them if you need to.

I hope this helps some people! I also would like to post a topic for this, since it's more generic than just the Cockatrice exporting, but I don't know which forum it fits in...

Battle Board Stats:

Black mana symbol Blue mana symbol | CMC: 3 | Mastery: Creature, Instant | Multicolor: 1 | Keywords: Persist | Perks: Tainted | Skill: 0 | Aid: M10-M15 | Skill & Valor: See Post