It is currently 09 Jun 2024, 00:20
   
Text Size

Exporting and merging of merged SPEC data

Moderator: CCGHQ Admins

Exporting and merging of merged SPEC data

Postby PhilistineAu » 06 Jul 2016, 03:36

Hi,

So I am trying to create some custom cards and would like to use new creature sub-types. From doing some reading around the place, it looks like the deckbuilder can export custom SPEC and LOL data. I tried this, but the sub-types I coded don't appear in the CREATURES_TYPE.TXT file (unpacked the WAD using gibbed tools and then opened the text file). For example, if I wanted the custom subtype "SPIKEY" or "ECHIDNA" (these are only an example - the actual subtypes I want to create are different but I don't want to share them just yet until I have finished more of the cards to share with the group).

My question: right now the card is just an XML file in the DATA_DLC_DECK_BUILDER_CUSTOM\DATA_ALL_PLATFORMS\CARDS folder. It has these text lines that look something like this in the file (again, just an example, not the actual subtypes I want to create):
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Spikey" />
<SUB_TYPE metaname="Echidna" />

Do I need to create a custom card WAD? The cards work in game with just the deck WAD, but the sub-type text doesn't display at all. I guess the next step is to create a core WAD and then export the SPEC data and see if that works.

...maybe I just answered my own question.
PhilistineAu
 
Posts: 22
Joined: 29 Sep 2012, 19:37
Has thanked: 0 time
Been thanked: 1 time

Re: Exporting and merging of merged SPEC data

Postby PhilistineAu » 06 Jul 2016, 03:58

Nope, that didn't work. The test deck works fine - the cards will tap for mana, will let you sacrifice them to draw a card and they have the right name and the creature type. However, they won't display the sub-type I want.

What I really want to do is to be able to use this sub-type and then have other cards fetch based on this sub-type. For example: "{T}, sacrifice, search your deck for an Echidna card and place it on the battlefield tapped". I can just do it based on creatures and limit the deck, but I'd like to be able to do it based on the subtype.

If that won't work, does anyone know if you can fetch based on part of the card name e.g. "Search for a card with Echidna in the name from your deck", when you have cards Echidna Warrior, Echidna Archer, Echidna Knight in said deck?
PhilistineAu
 
Posts: 22
Joined: 29 Sep 2012, 19:37
Has thanked: 0 time
Been thanked: 1 time

Re: Exporting and merging of merged SPEC data

Postby PhilistineAu » 06 Jul 2016, 04:00

...ok so I manually added the subtype to the CREATURES_TYPE.TXT file, and then the LOL file. I then repacked the Data_DLC_Combined_Spec_Data.WAD file and copied it into the game directory.

Now the cards display the subtype, but as something like "[CREATURE_TYPE_ECHIDNA]" instead of just "Echidna".

Any suggestions on what I need to do would be GREATLY appreciated.

Thanks!!!
PhilistineAu
 
Posts: 22
Joined: 29 Sep 2012, 19:37
Has thanked: 0 time
Been thanked: 1 time

Re: Exporting and merging of merged SPEC data

Postby RiiakShiNal » 06 Jul 2016, 12:06

The Deck Builder's "Combine SPEC Data" is for merging SPEC data properly from multiple mods that each define their own custom SPEC data. The reason for the feature is so that if multiple mod authors create their own sub-types, users can easily merge the data from the mods they have installed and have the sub-types work as the mod authors intended (without conflicting with other mods that add sub-types). What you seem to be asking for is some way to Pull the sub-types from the cards themselves and create all the necessary data (which could only partially be done, because the cards don't have all the necessary data).

Adding a custom Sub-Type has 3 parts:
  1. An entry in the appropriate SPEC file. If missing the sub-type can't be used in game.
  2. A matching constant in a LOL file (so the sub-type can be referenced by the constant in card scripts). If missing you can't refer to the type by a constant and must know which number the sub-type refers to (though if the order or positioning of the sub-type in the SPEC changes so does the number).
  3. A TEXT_PERMANENT entry which defines the translations to use for each language. If missing then the sub-type will show up in game as "[<Type>_TYPE_<Sub-Type>]".

The Deck Builder's "Combine SPEC Data" will merge all of the SPEC defined in different installed mods and then generate a LOL file with appropriately set constants for each of the SPEC entries. However, the Deck Builder can't translate the sub-types so it relies on the TEXT_PERMANENT entries provided by the original mod authors.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Exporting and merging of merged SPEC data

Postby PhilistineAu » 06 Jul 2016, 23:37

RiiakShiNal you glorious fish! Thank you sir!

I am so close... so this TEXT_PERMANENT entry...

I unpacked the community mod and found 63 entries that appear to be excel files in XML format. When I open them in excel, I see the columns:

Ident Comment Master Text French Spanish German Italian Japanese Korean Russian Portuguese (Brazil) Chinese (Simplified) Chinese (Trad)


What I find interesting is that some of the XML files that seem to define the translations are in conflict. For example, in NEO_CREATURE_TYPE_TEXT.XML, you have this entry (first 3 cells only):
CARD_QUERY_CREATURE_TYPE_231 CARD_SUBTYPE_DIVINITY Divinity

Whereas in the file CREATURE_TYPE_TEXT0062.XML, we have:
CARD_QUERY_CREATURE_TYPE_231 CARD_SUBTYPE_NAGA Naga

In the first file, Naga is now creature type 240. Do these not conflict?

Could I just add my creature type in as 241 in a new file, with the same headers and a single line with the required information for my new subtype, and call it "CREATURE_TYPE_TEXT603.XML"?
PhilistineAu
 
Posts: 22
Joined: 29 Sep 2012, 19:37
Has thanked: 0 time
Been thanked: 1 time

Re: Exporting and merging of merged SPEC data

Postby RiiakShiNal » 07 Jul 2016, 00:20

PhilistineAu wrote:What I find interesting is that some of the XML files that seem to define the translations are in conflict. For example, in NEO_CREATURE_TYPE_TEXT.XML, you have this entry (first 3 cells only):
CARD_QUERY_CREATURE_TYPE_231 CARD_SUBTYPE_DIVINITY Divinity

Whereas in the file CREATURE_TYPE_TEXT0062.XML, we have:
CARD_QUERY_CREATURE_TYPE_231 CARD_SUBTYPE_NAGA Naga

In the first file, Naga is now creature type 240. Do these not conflict?
The DotP engine doesn't look for the TEXT_PERMANENT entries by ID, it looks for them by sub-type name. When the game looks for Naga it will look for "CARD_SUBTYPE_NAGA" (Note: This should be the same thing you see in-game on the type line for types without a TEXT_PERMANENT entry, minus the square brackets).

The CARD_QUERY_CREATURE_TYPE_* entries are probably for code that was written to allow the user to select a creature sub-type for some card abilities (such as Adaptive Automaton, limitations in what could be coded at the time led to using the numeric types instead of the actual string look-ups). The Deck Builder unfortunately doesn't account for custom card code (as there could be multiple implementations) and thus doesn't know enough to write a new file with the appropriately numbered entries. Granted if there is a single standard implementation then the Deck Builder could be updated to automatically write the appropriate entries using the data from the entries the game will use coupled with the merged SPEC data it already generates.

In the case of conflicts mods that have a higher order take precedence over mods with a lower order number (The Deck Builder uses order 3 for creating decks, and order 99 for the combined SPEC data wad). If the mods have the same order number then alphabetic order of the file names is then used to resolve conflicts.

PhilistineAu wrote:Could I just add my creature type in as 241 in a new file, with the same headers and a single line with the required information for my new subtype, and call it "CREATURE_TYPE_TEXT603.XML"?
Yes, it is actually preferred to have your added information in a new XML file (with the appropriate headers) rather than changing/overriding a file or including all already defined entries (the SPEC files themselves are special and must be overridden and contain everything to work properly). Though as stated before the entry you actually need to add (at least if you want it to show up on the card in the type line) is CARD_SUBTYPE_<*> where <*> is the name of the Sub-Type you wish to add (in ALL CAPS even though you don't use all caps for the metaname). If you need examples of properly made entries you will find the base game creature type entries in SYSTEM_TEXT0000.XML in DATA_CORE.wad.

Edit:
Technically, there is one other piece to adding sub-types, but you only really need to mess with it if the sub-types don't show up in the right places on the type line (when compared with other sub-types). That is Sub-Type Ordering, in the SPEC directory there is a SUBTYPEORDERINGDATA_<LangCode>.TXT file for each language and in that file it lists some of the sub-types (typically those that co-exist with other sub-types) and a number (typically from 1 to 5). If you need to adjust where a specific type shows up on the type line you can give it a priority relative to the other types it coexists with. Lower priority numbers are actually higher priority. So 1 should always come first, and 5 should always come last. These files are like the SPEC files and must be overridden and contain everything if you want changes to them to take effect (though the Deck Builder will also rebuild these when you tell it to Combine SPEC Data).
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times


Return to 2014

Who is online

Users browsing this forum: No registered users and 29 guests


Who is online

In total there are 29 users online :: 0 registered, 0 hidden and 29 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 29 guests

Login Form