Oracle Text In cards.txt Files
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
62 posts
• Page 1 of 5 • 1, 2, 3, 4, 5
Oracle Text In cards.txt Files
by friarsol » 24 Jun 2011, 18:45
Alright, so I'm updating the setInfo script to also check for (and update) Oracle text. I've done a few random batches of cards and they all look right. Right now I'm stripping out any curly braces around Tap and Mana Symbols. I'm also handling spacing between consecutive Mana symbols as well as Hybrid Mana since that's generally how our system reads.
Does anyone have any specific cards that might be have tricky Oracle descriptions that I should specifically test? Is there any other text handling cases I need to be on the look out for?
Does anyone have any specific cards that might be have tricky Oracle descriptions that I should specifically test? Is there any other text handling cases I need to be on the look out for?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Oracle Text In cards.txt Files
by Rob Cashwalker » 24 Jun 2011, 20:40
Are you replacing the current Text field or adding the extra field?
You should also consider how to update oracle text for cards that already have it.
You should also consider how to update oracle text for cards that already have it.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Oracle Text In cards.txt Files
by friarsol » 24 Jun 2011, 21:05
I was adding a new field.
Should I be replacing the name of the card with CARDNAME?
Yea I was thinking about updating Oracle text, but I think that's going to have to happen similarly to the reprintSetInfo script since we don't want to be asking for every single card. Maybe the next time there's an Oracle update we can look into how to get the updated cards into a parseable format and just purge/regrab this Oracle texts.
- Architects of Will | Open
- Name:Architects of Will
ManaCost:2 U B
Types:Artifact Creature Human Wizard
Text:no text
PT:3/3
K:Cycling:UB
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigRearrange | TriggerDescription$ When CARDNAME enters the battlefield, look at the top three cards of target player's library, then put them back in any order.
SVar:TrigRearrange:AB$RearrangeTopOfLibrary | Cost$ 0 | ValidTgts$ Player | TgtPrompt$ Choose target player. | NumCards$ 3
SVar:RemRandomDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/architects_of_will.jpg
Oracle:When Architects of Will enters the battlefield, look at the top three cards of target player's library, then put them back in any order.\nCycling UB (UB, Discard this card: Draw a card.)
SetInfo:ARB|Common|http://magiccards.info/scans/en/arb/17.jpg
End
Should I be replacing the name of the card with CARDNAME?
Yea I was thinking about updating Oracle text, but I think that's going to have to happen similarly to the reprintSetInfo script since we don't want to be asking for every single card. Maybe the next time there's an Oracle update we can look into how to get the updated cards into a parseable format and just purge/regrab this Oracle texts.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Oracle Text In cards.txt Files
by Braids » 25 Jun 2011, 01:41
B.F.M. (Big Furry Monster)friarsol wrote:Is there any other text handling cases I need to be on the look out for?
... just kidding, that's a nightmarish card from one of the Un-Sets.
seriously, i think if you can handle the symbols for tap, untap, hybrid colored mana, hybrid colored/colorless mana, and phyrexian mana, that about covers it.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
naming convention of cards.txt files
by Braids » 25 Jun 2011, 01:48
on a related note, is it safe to assume the following:
name field inside txt file = Oracle name, converted from Unicode to imperfect ASCII ('AE' to two characters, removal of accent marks from vowels)
and
name of txt file itself = name field, all punctuation removed, spaces replaced with underscores, and converted to all lower-case + ".txt"
are these always true? if so, i plan to write code that assumes so.
(or should i post a new topic?)
name field inside txt file = Oracle name, converted from Unicode to imperfect ASCII ('AE' to two characters, removal of accent marks from vowels)
and
name of txt file itself = name field, all punctuation removed, spaces replaced with underscores, and converted to all lower-case + ".txt"
are these always true? if so, i plan to write code that assumes so.
(or should i post a new topic?)
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Oracle Text In cards.txt Files
by Hellfish » 25 Jun 2011, 02:00
That is strived for, but I just noticed some Lim-Dûl cards and Khabál Ghoul were incorrect. I'll fix them, but I don't know if there are more.
EDIT:Of course, that'll make finding them in the deck editor a bit cumbersome.
EDIT:Of course, that'll make finding them in the deck editor a bit cumbersome.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Oracle Text In cards.txt Files
by friarsol » 25 Jun 2011, 02:45
Ah I just tested some of the special character cards.
Braids, hyphens and spaces are converted to underscores, commas and apostrophes are removed (I'm not sure if there are any other punctuation used).
- Code: Select all
Oracle:Whenever a creature enters the battlefield, Æther Flash deals 2 damage to it.
- Code: Select all
Oracle:Whenever Lim-Dûl's Cohort blocks or becomes blocked by a creature, that creature can't be regenerated this turn.
Braids, hyphens and spaces are converted to underscores, commas and apostrophes are removed (I'm not sure if there are any other punctuation used).
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Oracle Text In cards.txt Files
by Hellfish » 25 Jun 2011, 12:27
Alright, the special characters å,ä,ö,â,û and Æ are now present in Forge on the same cards as on Gatherer, but you can still search for their simplified form in the deck editor (a,o,u,ae)
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Oracle Text In cards.txt Files
by friarsol » 25 Jun 2011, 13:10
Looks like cardforge.org isn't playing nice with the new card names. We probably need to simplify the characters there before requesting them when downloading set pics.Hellfish wrote:Alright, the special characters å,ä,ö,â,û and Æ are now present in Forge on the same cards as on Gatherer, but you can still search for their simplified form in the deck editor (a,o,u,ae)
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Oracle Text In cards.txt Files
by Hellfish » 25 Jun 2011, 13:52
On it. Shouldn't be too terrible 

So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Oracle Text In cards.txt Files
by friarsol » 25 Jun 2011, 14:06
Also, existing decks aren't translating in the same manner. I posted on the commit, but not sure if you see those. One Quest Opponent was using Dandan and I couldn't play him because of it.Hellfish wrote:On it. Shouldn't be too terrible
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Oracle Text In cards.txt Files
by Hellfish » 25 Jun 2011, 14:08
Yeah, I saw that, and have changed all quest opponents already. Download Set LQ Pictures now also simplifies the name before requesting the card. Just questData remaining.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Oracle Text In cards.txt Files
by friarsol » 25 Jun 2011, 15:04
The AI just played a Legions of Lim-Dul and the font is all messed up. We should probably get that fixed up if we are going to be displaying accented characters and the like.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Oracle Text In cards.txt Files
by Hellfish » 25 Jun 2011, 15:23
That's odd, it doesn't do that here. Which Look & Feel are you using? Where is the font messed up?
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Oracle Text In cards.txt Files
by friarsol » 25 Jun 2011, 15:37
Not sure, maybe Windows Classic?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
62 posts
• Page 1 of 5 • 1, 2, 3, 4, 5
Who is online
Users browsing this forum: No registered users and 26 guests