Page 1 of 2

Card generator

PostPosted: 11 Jul 2012, 22:50
by Emashzed
I just coded myself a little card xml generator, I thought I'd share :)

The generated XMLs contain all localized text, casting cost, artists, types, subtypes, power, toughness, placeholder for abilities with their text etc etc.
Basically, one has to fill the scripted logic plus a few extra fields (multiverseId / artId) and the card is good to go !

Saves us from all these long "boring" parts...

Hope it's usefull to someone :)

Re: Card generator

PostPosted: 11 Jul 2012, 22:52
by Emashzed
Here are the XMLs for all of Innistrad/Scars blocs + M12 + M13
(first half)

Re: Card generator

PostPosted: 11 Jul 2012, 22:53
by Emashzed
Second part.

Hope I didn't miss anything silly :oops:

Re: Card generator

PostPosted: 11 Jul 2012, 23:14
by Emashzed
Thought I'd do Zendikar too... :)
All 602 card XMLs in this zip.

Re: Card generator

PostPosted: 11 Jul 2012, 23:32
by RiiakShiNal
Looks like your generator doesn't put in the localization for Korean (ko-KR) and puts in other localizations that DotP 2013 doesn't use (Taiwanese, Chinese). I see your generator also gets the information from magiccards.info and after programmatically extracting information from gatherer I can see why everyone chooses to extract info from there.

Also for anyone interested in downloading the card XMLs be aware that they are the XMLs generated from the program and do not include any of the ability code. All the abilities are just stubs.

Re: Card generator

PostPosted: 11 Jul 2012, 23:50
by Emashzed
Thanks for the comments RiiakShiNal :)

Actually the generator does put ko-KR when available (out of the 2195 cards, only 814 have korean text available).
Not sure if the other cards do not exist or just mtginfo doesn't reference them :)

I'm on the fence about including cn/tw translations. Dotp2013 doesn't use them, but it seems handy at the time to have them for future Dotp, who knows :D

As you're saying, the XMLs are "stubs" and don't include the LUA scripting (because it just can't be done automatically).
The idea is just to gain time for everything else :)

In a future version, I'll try to auto-add scripting for the basic abilities (flying, trample, first strike, etc) + badges/helps
I think this can be done fairly effectively.

In the meantime, I just hope this saves some people some time...

Re: Card generator

PostPosted: 12 Jul 2012, 00:54
by RiiakShiNal
Emashzed wrote:Actually the generator does put ko-KR when available (out of the 2195 cards, only 814 have korean text available).
Not sure if the other cards do not exist or just mtginfo doesn't reference them :)

I'm on the fence about including cn/tw translations. Dotp2013 doesn't use them, but it seems handy at the time to have them for future Dotp, who knows :D

As you're saying, the XMLs are "stubs" and don't include the LUA scripting (because it just can't be done automatically).
The idea is just to gain time for everything else :)

In a future version, I'll try to auto-add scripting for the basic abilities (flying, trample, first strike, etc) + badges/helps
I think this can be done fairly effectively.
Ahh, you're right, I see it (Korean localization) on ACIDIC_SLIME_XXXXX, my mistake.

It might be handy for future versions of DotP or if you modify your generator to spit out stubs for other game engines as well, but for DotP 2013 I think it's probably just wasted space.

I agree even just stubbing things out can save people quite a bit of time when they get to coding which is why when my code can't figure out what an ability needs to do it just stubs it so I can manually add it later. I was mainly saying they were stubs because it wasn't totally clear in your previous posts and I don't think you would want regular users downloading them then reporting that they don't work. I just thought that mentioning that they were stubs might save you and some regular users some hassle.

Auto-scripting some of the basic abilities (Flying, Lifelink, Trample, Deathtouch, Annihilator, Battle Cry, Trample, First Strike, etc...) can most definitely be done fairly effectively (I've been experimenting with it myself) though detecting which ability to auto-add can get tricky (like when they multiple abilities on a single line Mirri, Cat Warrior: "First strike, forestwalk, vigilance" or from abilities where they include the card name in the text like Darksteel Citadel: "Darksteel Citadel is indestructible.").

Re: Card generator

PostPosted: 12 Jul 2012, 08:57
by thefiremind
Emashzed wrote:Actually the generator does put ko-KR when available (out of the 2195 cards, only 814 have korean text available).
As far as I could see, Korean started to be used from Dark Ascension onwards, excluding "special" editions (like Planechase 2012).
If you don't inlcude any text for the missing languages, those who play the game in that language will see cards with no text (or the game could even crash). Maybe it would be better to copy the English text onto the missing languages: my Localised tool does that. And I thought about modifying my tool so that it generates the whole XML rather than only the localised text... but time and will were missing. :lol:

Re: Card generator

PostPosted: 12 Jul 2012, 10:11
by Emashzed
You're very right about this, thefiremind.
I've implemented this behaviour (as well as "proper" ordering of the languages and excluding unused locales)

I also have a first draft of auto scripting of basic characteristics :)

Of course not 100% foolproof, but works nicely already.
"simple" creatures such as Simic Sky Swallower seems generated correctly and only needs art/multiverseId to be complete.

Thanks for the feedback !

Re: Card generator

PostPosted: 12 Jul 2012, 15:26
by Zambooo
Can someone explain me how to use it? :D

Re: Card generator

PostPosted: 10 Sep 2012, 17:33
by Lumitosh
Same than Zambooo ?!

Re: Card generator

PostPosted: 11 Sep 2012, 10:44
by Persee
Could you create a jar file please ?

It's more easy to use :mrgreen:

Re: Card generator

PostPosted: 17 Nov 2012, 10:13
by Lirave
very nice tool, did you create a new version witch also adds multiverse id and features like (flying, haste, ... ) ?
if yes, please chare it, i really like your programming style and want to know what has changed.

Re: Card generator

PostPosted: 09 Feb 2013, 22:11
by Takhen
I can't see any exe or application file I could be able to use...
What I have to do to open and use MTG Generator?

Re: Card generator

PostPosted: 09 Feb 2013, 22:33
by thefiremind
Takhen wrote:I can't see any exe or application file I could be able to use...
What I have to do to open and use MTG Generator?
It's a Java application, you should run it from the command prompt, which would probably lead us to another couple of pages full of questions and answers...
This program does exactly the same thing as pcastellazzi's web application, so I have nothing against Emashzed but why should you complicate your life when you have another application available that doesn't even need to be on your hard disk to work? :wink: