Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Utilities



DOTP 2012 - Deck Editor Revised
Moderator: CCGHQ Admins
Re: DOTP 2012 - Deck Editor Revised
by jstauffer » 31 May 2012, 22:11
Now pulling in all localised text ( i.e. languages ) for TITLE and FLAVOURTEXT
On the Card Info form, double clicking on the "Title" or "Flavour Text" labels will bring up a form so you can enter localised text for all languages
Fixed issue with localised text of card abilities having additional spaces before the "<![CDATA" when saving
Update has been posted.
On the Card Info form, double clicking on the "Title" or "Flavour Text" labels will bring up a form so you can enter localised text for all languages
Fixed issue with localised text of card abilities having additional spaces before the "<![CDATA" when saving
Update has been posted.
Re: DOTP 2012 - Deck Editor Revised
by thefiremind » 31 May 2012, 22:44
On Notepad I usually do two things:jstauffer wrote:You also mentioned earlier that you "touch up" a few things in notepad after using Deck Editor Revised. What exactly are you doing? Is this something I could implement so you wouldn't have to?
- Add the localised text for all languages (I made an application that extracts it from magiccards.info and presents it in a way that lets me just copy and paste it into the XML, it's not error-proof though, and sometimes it needs some manual editing)
- Write the real code on the card, because I find it easier to do it inside an environment with a fixed width font. This would be a nice improvement to the ability editor: using a font like Courier New or something else with fixed width.
I just thought about another thing. Are the unlock_key and foil_key tags useful inside each deck's XML, or maybe it's just another thing left from old DotP? I think that those numbers are checked only inside _PREPPED_APPID_LINKING and APPID_LINKING by the game, for two reasons: first, I didn't see those tags when I opened the Magic_2012 executable looking for readable parts in the code; second, if I edit the 2 TXT files manually and substitute the zeroes with codes without touching each deck's XML, I can suppress all the uncommons, rares and mythic rares being foil (a thing I always do because having the most part of the deck foiled is ugly). The problem is that this editing is reversed by the Deck Editor because it checks for the presence of unlock_key and foil_key inside the deck's XML, and if they aren't here, it writes 0 in the 2 TXT files (actually, the last time I checked it edited only _PREPPED_APPID_LINKING and not APPID_LINKING, that's something else to look into).
So, in short: if unlock_key and foil_key aren't read by DotP2012 inside the deck's XML files, can you modify the editor so that it reads/writes those codes only from/to _PREPPED_APPID_LINKING and APPID_LINKING, without looking into the deck's XML?
Just tested the update by trying to edit an existing card. Strangely enough, the indentation was all perfect except for the first ability, which had that "\r\n" new-line problem again... I don't know how only 1 of the abilities could still have that bug, I hope you can find the cause. Another thing I noticed is that the editor moves the abilities around when saving the card, trying to sort them out according to the type (I think). That's quite annoying if I want to keep the order written on the original paper card.jstauffer wrote:Update has been posted.
Please take your time: I write the problems as soon as I find them, but I don't want to make you rush in any way.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: DOTP 2012 - Deck Editor Revised
by jstauffer » 31 May 2012, 23:39
I really appreciate the feedback. I just so happen to have some extra time atm is why I'm able to get to things as quickly as I have been. I doubt it lasts much longer though. It was Eglin who prompted a number of the new changes and I figured while I was at at ...
I can definitely change the font ...
The application actually writes the "keys" you see at attributes in core node of the deck XML. I did this so I'd know what to write to the LINKING files. It didn't seem to make a difference whether or not you set a value for these so I kind of just gave up messing with it. So exactly what should be written if you don't want cards unlocked or foils unlocked? I guess I don't really understand this.
Will check out why it wouldn't be writing to both files though because it should.
Indentation issue w/ first ability of every card? Or just a specific ability? I'll see if I can find out what could be causing it.
You're right about the order. It basically sorts all abilities in the following order: ACTIVATED, SPELL, STATIC, TRIGGERED, UTILITY and "OTHER" ( which is simply any ability that is not one of the 5 previously mentioned; afaik MANA is the only one but I set it up this way in case others were added so they would be accommodated for ). It's my personal preference to have them sorted this way regardless of what the original card had but can definitely make that an option.
I can definitely change the font ...
The application actually writes the "keys" you see at attributes in core node of the deck XML. I did this so I'd know what to write to the LINKING files. It didn't seem to make a difference whether or not you set a value for these so I kind of just gave up messing with it. So exactly what should be written if you don't want cards unlocked or foils unlocked? I guess I don't really understand this.
Will check out why it wouldn't be writing to both files though because it should.
Indentation issue w/ first ability of every card? Or just a specific ability? I'll see if I can find out what could be causing it.
You're right about the order. It basically sorts all abilities in the following order: ACTIVATED, SPELL, STATIC, TRIGGERED, UTILITY and "OTHER" ( which is simply any ability that is not one of the 5 previously mentioned; afaik MANA is the only one but I set it up this way in case others were added so they would be accommodated for ). It's my personal preference to have them sorted this way regardless of what the original card had but can definitely make that an option.
Re: DOTP 2012 - Deck Editor Revised
by agentx » 01 Jun 2012, 04:54
I can't get the import content to work.
I choose a wad file then it just says
"Invalid Source Content" followed by "Successfully imported content"
Then nothing shows up in the editor.
I choose a wad file then it just says
"Invalid Source Content" followed by "Successfully imported content"
Then nothing shows up in the editor.
- agentx
- Posts: 12
- Joined: 08 May 2012, 06:22
- Has thanked: 0 time
- Been thanked: 0 time
Re: DOTP 2012 - Deck Editor Revised
by thefiremind » 01 Jun 2012, 08:41
It happened to me, too, but figured out the reason by myself: you need to give an ID to the DLC in the DATA_ALL_PLATFORMS\DATA_REQUIRED\INFO.XML.agentx wrote:I can't get the import content to work.
I choose a wad file then it just says
"Invalid Source Content" followed by "Successfully imported content"
Then nothing shows up in the editor.
- Code: Select all
<ContentPack UID="0">
You don't need to write something specific: any code works, except for 0 (I use existing codes just to be sure). What I'd like to see is:jstauffer wrote:The application actually writes the "keys" you see at attributes in core node of the deck XML. I did this so I'd know what to write to the LINKING files. It didn't seem to make a difference whether or not you set a value for these so I kind of just gave up messing with it. So exactly what should be written if you don't want cards unlocked or foils unlocked? I guess I don't really understand this.
- I open the Deck Info and write codes in Unlock content and Unlock foils, then save the deck --> the deck editor writes those codes in the LINKING files without bothering the deck's XML.
- I open a deck that has the codes already set in the LINKING files --> the codes are read and I see them inside Deck Info.
I tested only with 1 card (Deity of Scars). That ability happened to be ACTIVATED (because of your sorting), I don't know if this information can be useful.jstauffer wrote:Indentation issue w/ first ability of every card? Or just a specific ability? I'll see if I can find out what could be causing it.
Having that as an option would be great... different ordering prevents that "feeling" of playing with original cards, in my opinion.jstauffer wrote:You're right about the order. It basically sorts all abilities in the following order: ACTIVATED, SPELL, STATIC, TRIGGERED, UTILITY and "OTHER" ( which is simply any ability that is not one of the 5 previously mentioned; afaik MANA is the only one but I set it up this way in case others were added so they would be accommodated for ). It's my personal preference to have them sorted this way regardless of what the original card had but can definitely make that an option.
There's also another thing I do with Notepad and I totally forgot about it in the previous post. It's something that has no relevance if you play the game in English, but gives problems while playing the game in a different language.
Each supertype, type and sub-type of a card has 5 tags that tell the game in which order those words should be shown in the different languages. For example, it's "Artifact Creature" in English, but it's written as "Creatura Artefatto" in Italian because it feels more natural. The "order" tags achieve this, by giving ordered numbers to what's on the left side of the "—" (supertypes and types together) and to what's on the right side (sub-types).
If those tags are all set to 0, for example for the sub-types, playing in a language that is not English shows the first sub-type correctly, but the second is shown as "[CARD_SUBTYPE_]".
By looking at the cards, I noticed that there's an ordering that is OK 99% of the times, and so it could be automatized so that the Deck Editor writes it automatically. I'll try to explain this order with an example (there aren't cards with so many entries, but it's just an example):
- Code: Select all
<SUPERTYPE metaname="FirstSupertype" order_de-DE="0" order_es-ES="2" order_fr-FR="2" order_it-IT="2" order_jp-JA="0" />
<TYPE metaname="FirstType" order_de-DE="1" order_es-ES="1" order_fr-FR="1" order_it-IT="1" order_jp-JA="0" />
<TYPE metaname="SecondType" order_de-DE="2" order_es-ES="0" order_fr-FR="0" order_it-IT="0" order_jp-JA="0" />
<SUB_TYPE metaname="FirstSubType" order_de-DE="0" order_es-ES="2" order_fr-FR="0" order_it-IT="2" order_jp-JA="0" />
<SUB_TYPE metaname="SecondSubType" order_de-DE="1" order_es-ES="1" order_fr-FR="1" order_it-IT="1" order_jp-JA="1" />
<SUB_TYPE metaname="ThirdSubType" order_de-DE="2" order_es-ES="0" order_fr-FR="2" order_it-IT="0" order_jp-JA="2" />
Could you make the Deck Editor write those tags with the correct numbers according to how many supertypes/types/sub-types the card has?
EDIT: Found two other little (not critical) bugs:
- If I make a new card, and then another new one, the old title and flavour text persist inside the multiple languages form. That form needs a total reset when making a new card.
- When saving a card, there should be a check that avoids adding the <FLAVOURTEXT>...</FLAVOURTEXT> block when the flavour text is empty for all the languages. At the moment, it adds that block anyway.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: DOTP 2012 - Deck Editor Revised
by jstauffer » 01 Jun 2012, 18:04
If flavour text is not empty for at least 1 of the languages should I write all language nodes or just the ones that aren't empty?
Re: DOTP 2012 - Deck Editor Revised
by thefiremind » 01 Jun 2012, 21:33
I'd say all nodes, but it's really not important, choose what you prefer and/or what is easier to implement.jstauffer wrote:If flavour text is not empty for at least 1 of the languages should I write all language nodes or just the ones that aren't empty?

< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: DOTP 2012 - Deck Editor Revised
by jstauffer » 03 Jun 2012, 15:34
New update has been posted:
- Ability ordering is preserved when reading / writing card XML ... this might affect cards saved previous to this change since they will already have abilities ordered in the old method ( mainly w/ the displayed card "image" and ability ordering ) ...
- XML Formatting on Ability form is now customizable and settings are saved ( including Edited Text Color and Edited Back Color which were previously able to be set; also now including font )
- New button on the Ability form that opens a separate form to set the XML formatting
- Removed check during Import Content that the source content is valid
- Fixed issue with Import Content reporting success even if it failed
- Fixed issue with Title and Flavour Text not resetting properly
- Added check if there is any language with flavour text and will not write the FLAVOURTEXT node if none found when saving a card
- Unlock / foil keys are now read from the APPID_LINKING file ( basically the keys are not needed in the deck XML any longer ) ... still writes to this APPID_LINKING / _PREPPED_APPID_LINKING when a deck is saved although any time a deck is saved ( or deleted ) all decks in the content are checked are re-written as well
- Deleting content will now check if the WAD file exists in the default "Dotp" directory before asking if it should be deleted as well
Content cleanup will now just remove the custom attribute and not touch the rest of the card XML - Removed setting all decks to ALWAYS_AVAILABLE from content cleanup
- Changed font size of inner card text ( displayed card "image" ) to 10pt to accomodate cards with alot of text
- You can now switch what language card info is displayed in ( does not work with supertypes, types and subtypes right now ) which can be found in the Help menu
Re: DOTP 2012 - Deck Editor Revised
by thefiremind » 03 Jun 2012, 16:53
In the changelog you forgot to mention that you also implemented the automatic order assignment for supertypes, types and sub-types... I tried it and it works great! 
The only bug I found now is just in appearance: in the ability editor, when I load an ability from another card, the indentation has the problem we talked about the first time (it needs those 2-space shifts), but it's saved correctly on the file, so it's not a big deal... I wanted to inform you anyway.
There's a thing I talked about with Eglin some time ago but I totally forgot it, and I don't know if you can do something (maybe it's .NET's fault). If I save a card that doesn't contain any special character (no Japanese characters, no "graceful" apostrophe and double commas, etc...), the deck editor saves it with ANSI encoding instead of UTF-8, and sometimes this makes it unreadable by the game. Can you prevent this?

The only bug I found now is just in appearance: in the ability editor, when I load an ability from another card, the indentation has the problem we talked about the first time (it needs those 2-space shifts), but it's saved correctly on the file, so it's not a big deal... I wanted to inform you anyway.
There's a thing I talked about with Eglin some time ago but I totally forgot it, and I don't know if you can do something (maybe it's .NET's fault). If I save a card that doesn't contain any special character (no Japanese characters, no "graceful" apostrophe and double commas, etc...), the deck editor saves it with ANSI encoding instead of UTF-8, and sometimes this makes it unreadable by the game. Can you prevent this?
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: DOTP 2012 - Deck Editor Revised
by jstauffer » 03 Jun 2012, 18:32
Thanks for mentioning the order assignment on types. Thought I was missing something ...
I'll look at that formatting issue. It's the .NET XML formatter doing it. If I had the time if probably write my own since I couldn't seem to find anything else out there that would work the way I wanted.
I can force UTF-8 encoding. I'll need to test that this will work. UTF-8 doesn't work for the LINKING files ( cause game to crash ) so had to use BigEndian ( I think; will have to double check; tried several different encodings until it worked ). Not sure if this is a .NET issue or not.
I'll look at that formatting issue. It's the .NET XML formatter doing it. If I had the time if probably write my own since I couldn't seem to find anything else out there that would work the way I wanted.
I can force UTF-8 encoding. I'll need to test that this will work. UTF-8 doesn't work for the LINKING files ( cause game to crash ) so had to use BigEndian ( I think; will have to double check; tried several different encodings until it worked ). Not sure if this is a .NET issue or not.
Re: DOTP 2012 - Deck Editor Revised
by thefiremind » 03 Jun 2012, 19:13
The ANSI issue is just for the card files, you can leave the encoding of the other files (such as LINKING) the way they are managed now.jstauffer wrote:I can force UTF-8 encoding. I'll need to test that this will work. UTF-8 doesn't work for the LINKING files ( cause game to crash ) so had to use BigEndian ( I think; will have to double check; tried several different encodings until it worked ). Not sure if this is a .NET issue or not.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: DOTP 2012 - Deck Editor Revised
by pcastellazzi » 03 Jun 2012, 23:48
I believe (because i am no tested every single file) the encoding for the XML files in the games is UTF-8 without BOM. The "without BOM" part is important because the first 128 code points are shared between ASCII, UTF-8, and ANSI. In other words you will no notice any difference unless you use an international character (like a tilde, copyright mark, trade mark, kanji, etc).thefiremind wrote:The ANSI issue is just for the card files, you can leave the encoding of the other files (such as LINKING) the way they are managed now.jstauffer wrote:I can force UTF-8 encoding. I'll need to test that this will work. UTF-8 doesn't work for the LINKING files ( cause game to crash ) so had to use BigEndian ( I think; will have to double check; tried several different encodings until it worked ). Not sure if this is a .NET issue or not.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
— Ben Kuchera, Mordern Warfare 3 review.
-
pcastellazzi - Posts: 184
- Joined: 25 Apr 2012, 00:40
- Location: Montevideo, Uruguay
- Has thanked: 11 times
- Been thanked: 30 times
Re: DOTP 2012 - Deck Editor Revised
by jstauffer » 04 Jun 2012, 17:27
Checking the files from an unpacked Data_Core.wad and using Notepad++:
CARDS are in UTF-8 without BOM
DECKS/UNLOCKS are in ANSI
APPID_LINKING.TXT / _PREPPED_APPID_LINKING.TXT are in ANSI
When using the StreamWriter in .NET, you can specify an encoding or not. By not specifying an encoding it will use the default, which is based on the operating system's current ANSI code page. Besides with the LINKING files, which I only recently changed, when using the StreamWriter I had not been specifying an encoding.
I've tried to create the LINKING files with and without BOM in UTF-8, ANSI and several others but the only one that worked and didn't change the data in the file was BigEndianUnicode ( aka UCS-2 Big Endian ). UTF-8, with or without BOM, and ANSI caused the game to crash. Since the LINKING files in the unpacked Data_Core.wad are in ANSI I figured it may have been a .NET issue. Strangely enough, if you copied over the LINKING files from the unpacked Data_Core.wad and just let Deck Editor Revised "overwrite" these files everything worked fine. When you create new content from within Deck Editor Revised it ends up creating the LINKING "from scratch" and this is where the issue presented itself ( until I changed the encoding ).
Since the CARDS in the unpacked Data_Core.wad are in UTF-8 without BOM I'll use this encoding when saving cards in Deck Editor Revised ( thefiremind: this should take care of the issue you were describing? ).
Since DECKS/UNLOCKS in the unpacked Data_Core.wad are in ANSI and since I'm already using the default for these ( and this seems to be working fine as is ) I won't change how DECKS/UNLOCKS are being written.
CARDS are in UTF-8 without BOM
DECKS/UNLOCKS are in ANSI
APPID_LINKING.TXT / _PREPPED_APPID_LINKING.TXT are in ANSI
When using the StreamWriter in .NET, you can specify an encoding or not. By not specifying an encoding it will use the default, which is based on the operating system's current ANSI code page. Besides with the LINKING files, which I only recently changed, when using the StreamWriter I had not been specifying an encoding.
I've tried to create the LINKING files with and without BOM in UTF-8, ANSI and several others but the only one that worked and didn't change the data in the file was BigEndianUnicode ( aka UCS-2 Big Endian ). UTF-8, with or without BOM, and ANSI caused the game to crash. Since the LINKING files in the unpacked Data_Core.wad are in ANSI I figured it may have been a .NET issue. Strangely enough, if you copied over the LINKING files from the unpacked Data_Core.wad and just let Deck Editor Revised "overwrite" these files everything worked fine. When you create new content from within Deck Editor Revised it ends up creating the LINKING "from scratch" and this is where the issue presented itself ( until I changed the encoding ).
Since the CARDS in the unpacked Data_Core.wad are in UTF-8 without BOM I'll use this encoding when saving cards in Deck Editor Revised ( thefiremind: this should take care of the issue you were describing? ).
Since DECKS/UNLOCKS in the unpacked Data_Core.wad are in ANSI and since I'm already using the default for these ( and this seems to be working fine as is ) I won't change how DECKS/UNLOCKS are being written.
Re: DOTP 2012 - Deck Editor Revised
by jstauffer » 04 Jun 2012, 18:54
Question:
The Card List now appends the contents name before the card title ( e.g. "[DLC_1111] - CustomCard1" ).
Do you like this or not?
The Card List now appends the contents name before the card title ( e.g. "[DLC_1111] - CustomCard1" ).
Do you like this or not?
Re: DOTP 2012 - Deck Editor Revised
by thefiremind » 04 Jun 2012, 20:34
I'd suggest to make it as an option, if possible, or remove it totally. Without it, it was possible to press a key to scroll the list to the pressed letter.jstauffer wrote:Question:
The Card List now appends the contents name before the card title ( e.g. "[DLC_1111] - CustomCard1" ).
Do you like this or not?
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Who is online
Users browsing this forum: No registered users and 7 guests