Page 2 of 6

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 30 Dec 2008, 18:13
by Chris H.
Chris H. wrote:
DennisBergkamp wrote:Awesome, thanks for your efforts, Gando :)
I'll download these and replace my current versions
I am now in the process of adding the data from your new 61 cards to the five files and I will leave an attachment here when I am finished. That will give us a total of 1091 cards. =D>
I guess that you will want to add the code for RegenerateMe. Some of the creatures included in the set of five files require this keyword. Without the code addition these cards will display the Keyword command as a text string but the cards will not regenerate.

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 30 Dec 2008, 18:17
by DennisBergkamp
Ahhh hahaha, I thought you used some special tool to do this!

I am now in the process of adding the data from your new 61 cards to the five files and I will leave an attachment here when I am finished. That will give us a total of 1091 cards. =D>
Awesome! So does this mean you're also updating Gando's files, since he added 87 and fixed a bunch of cards?

This reminds me, for Winnower Patrol I just add 1 to both power and toughness whenever it triggers... I should actually do this the right way and keep track of +1/+1 counters separately.

EDIT: Yes, I will add RegenerateMe, although it might already be in... I just remember not adding in all the cards in cards.txt.

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 30 Dec 2008, 18:42
by GandoTheBard
"it was fun but tedious" - for me it was just tedious. Also annoying since the built in updater doesnt actually work properly.

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 30 Dec 2008, 19:15
by Incantus
I don't know if you guys know this, but there is a way to automatically generate the card image url from the name of the card:

http://www.wizards.com/global/images/magic/general/[imagename].jpg

If anybody is familiar with python, this is the conversion I use to go from the official card name to the imagename variable above:

imagename = name.replace(" ", "_").replace("-", "_").replace("'","").replace(",","")

Basically, remove all apostrophes and commas, and replace spaces and dashes with underscores. With these 2 lines you don't need to hardcode the location of the card image (from the url, it seems MTGForge is using the images that are found in gatherer, while these urls comes from images used in the daily magic articles).

For example:

http://www.wizards.com/global/images/ma ... _Guard.jpg
http://www.wizards.com/global/images/ma ... Errant.jpg

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 30 Dec 2008, 20:34
by Rob Cashwalker
Good find on the URL hack, but I wonder if it really has ALL cards ever, or just ones that have been used in articles.... There is one reason to stick with the gatherer-based urls - we can pick the printing we like better, if appropriate.

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 30 Dec 2008, 21:01
by Incantus
Well, it's worked for all 1500 cards I've ever tried to access (I suspect it includes all cards ever made). But you are correct - you basically get the most recent printing of that card. One other option is to use magiccards.info - they have structured urls for each card/expansion. Why do something by hand when you can write a program to figure it out ;)

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 30 Dec 2008, 21:42
by DennisBergkamp
I'd love to switch over to images from magiccards.info, they're much higher res and quality.
GUI code would need some changes though (since the card image will be larger) the pane would either have to be enlarged, or the image itself resized (made smaller).

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 30 Dec 2008, 22:52
by Chris H.
DennisBergkamp wrote:Awesome! So does this mean you're also updating Gando's files, since he added 87 and fixed a bunch of cards?

EDIT: Yes, I will add RegenerateMe, although it might already be in... I just remember not adding in all the cards in cards.txt.
I'm the person who updated and posted the five data files which gives us the additional 87 cards. If Gando has additional material to contribute to the cause, then that would be awesome. My repairs were to the data files only and do not include any coding work.

Do you have the code for the planeswalkers and do you have the correction for Necropotence?

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 30 Dec 2008, 23:01
by Chris H.
incantus1 wrote:I don't know if you guys know this, but there is a way to automatically generate the card image url from the name of the card:

http://www.wizards.com/global/images/magic/general/[imagename].jpg

If anybody is familiar with python, this is the conversion I use to go from the official card name to the imagename variable above:

imagename = name.replace(" ", "_").replace("-", "_").replace("'","").replace(",","")

Basically, remove all apostrophes and commas, and replace spaces and dashes with underscores. With these 2 lines you don't need to hardcode the location of the card image (from the url, it seems MTGForge is using the images that are found in gatherer, while these urls comes from images used in the daily magic articles).

For example:

http://www.wizards.com/global/images/ma ... _Guard.jpg
http://www.wizards.com/global/images/ma ... Errant.jpg
When I updated the "card-pictures.txt" file that is part of the Forge package I used the http://www.wizards.com/global/images url for most of the pictures. This worked for most of the cards that were needed. Some cards required me to use the http://www.magickartenmarkt.de/ url.

In version 2 Rares hopes to use individual plain text files for separate magic cards. I image that he may want to include your formula at that time.

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 30 Dec 2008, 23:29
by DennisBergkamp
I did put in the land fix for Necropotence.

Not sure about the planeswalker code? I got a bunch of planeswalkers in there Forge put in, so I think so.

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 31 Dec 2008, 00:32
by GandoTheBard
I totally missed the whole miscrediting part of this thread :P Chris did the posting of the files etc...I did make a version of the card-pictures.txt file but did not upload it. Also my various versions of MTG Forge are a bit confuseled about which cards are actually in them. So I am afraid I wont be much use in that regard.

Re Incantus's solution: That works great if you are interested in using code to do that. Not saying its a bad idea but you can't expect lay people to want to even think about doing that. Much less grasp HOW to do it. Also I agree with Rob on why not to use alternatives to Gatherer...I for one am partial to older version art for the most part. I am not putting down the current string of art directors but I think some of the "upgrades" were just hideous. Of course art taste is a matter of opinion. Which is why it is great there are choices.

As far as I know there are only 4 Planeswalkers coded into MTG Forge...if there is a version with more Id like to have the url for it please. :) I really wanted the blue ones but meh. :)

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 31 Dec 2008, 02:19
by Chris H.
DennisBergkamp wrote:I did put in the land fix for Necropotence.

Not sure about the planeswalker code? I got a bunch of planeswalkers in there Forge put in, so I think so.
When looking at the deck editor I could not find Ajani Goldmane listed in your beta version.

EDIT I took a second look and found that you have the other three planeswalkers.

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 31 Dec 2008, 02:23
by Chris H.
GandoTheBard wrote:As far as I know there are only 4 Planeswalkers coded into MTG Forge...if there is a version with more Id like to have the url for it please. :) I really wanted the blue ones but meh. :)
I think that we all agree on this point. :D

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 31 Dec 2008, 02:29
by Chris H.
Chris H. wrote:I am now in the process of adding the data from your new 61 cards to the five files and I will leave an attachment here when I am finished. That will give us a total of 1091 cards. =D>
I have added the first nine cards. This is taking a little more time than I had first imagined. I will need a few more days or so to finish.

Re: MTGForge 12/29 (unofficial BETA) version

PostPosted: 31 Dec 2008, 03:46
by DennisBergkamp
I'm the person who updated and posted the five data files which gives us the additional 87 cards. If Gando has additional material to contribute to the cause, then that would be awesome. My repairs were to the data files only and do not include any coding work.
Pffffft, I'm sorry, I totally spaced out. Alright, it all makes sense now. Thanks Chris :)

RegenerateMe seems to be in my code also:
At the beginning of CardFactory.java:
//Check for self-regenerate ability
private final int shouldRegenerateMe(Card c)
{
ArrayList a = c.getKeyword();
for (int i = 0; i < a.size(); i++)
if (a.get(i).toString().startsWith("RegenerateMe"))
return i;

return -1;
}
Is that all of it ?

As far as Ajani Goldmane goes, it's in the CardFactory source, so I think it just must've gotten deleted somehow in from cards.txt. Not sure why.

Speaking of Planeswalkers, I started coding Elspeth, Knight-Errant by the way. And I'll probably make Sarkhan Vol + Tezzeret the Seeker sometime too.