It is currently 27 Apr 2024, 16:07
   
Text Size

Adding a new sub type.

Moderator: CCGHQ Admins

Adding a new sub type.

Postby BETenner » 15 Oct 2013, 16:51

Can anyone post a detailed tutorial on how to add new sub types?
I tried to add a new sub type, I added all I can think of:
SPECS\CREATURE_TYPES.TXT
FUNCTIONS\CONSTANTS.LOL
TEXT_PERMANENT\CARD_UI_TEXT.XML
of course I also added it in the creature card xml file. (<SUB_TYPE metaname="Newtype"/>)
but the game just "ignored" my new type, it didn't show up on the card.
e.g. I added two types: <SUB_TYPE metaname="Newtype"/> and <SUB_TYPE metaname="Human"/>
Only "Human" is shown.
Did I do something wrong?
BETenner
 
Posts: 36
Joined: 07 Mar 2013, 14:20
Has thanked: 7 times
Been thanked: 4 times

Re: Adding a new sub type.

Postby RiiakShiNal » 15 Oct 2013, 17:02

It's probably not that you did something wrong as it is some other mod is overriding your new added type.

The LOL entry and the text permanent entry can be prevented from being overridden by putting them into files unique to your mod for example:
  • FUNCTIONS\BET_CONSTANTS.LOL
  • TEXT_PERMANENT\BET_CARD_UI_TEXT.XML

However, the same can't be said of the CREATURE_TYPES.TXT entry as any mod that overrides that file will conflict with any other mod that also has a CREATURE_TYPES.TXT file. I know that my mods do not contain that file, but other mods (especially those that contain certain Theros cards due to the sub-types added in that set) will have that file. The game will select one and only one CREATURE_TYPES.TXT file to load, if it doesn't choose your file then it won't have your new sub-type. You can test this by removing all mods except for yours and see if your added type shows up (or you could go through each and every mod looking for that file).

Sub-types should be added sparingly due to the problem with the file being overridden by other mods.

Edit: Though this does give me an idea for another enhancement to the Deck Builder:
  • The ability to merge spec files and generate a new LOL file with updated constants for those sub-types.

Though there are a couple of issues with that either modders would need to use a naming standard for sub-type constants (which the Deck Builder would follow when merging specs) or would need to create a file with information about the sub-type which the Deck Builder would then parse and process (think an XML file that would define the sub-type and the desired constant to use for it).

Also the Deck Builder would have to generate one or more extra constant(s) so that modders can determine how many sub-types are actually present. This could include something like _CREATURE_TYPE_COUNT which just says how many types are defined or could even generate constants like CREATURE_TYPE_FIRST and CREATURE_TYPE_LAST which would be the values of the first (1000) and last creature respectfully. It would be necessary to use constants in code for sub-types (which I think most modders already do) as the actual values of added types could vary depending on which mod would be scanned first for added types.

Granted if this feature is added and modders make use of it, regular users would need to also get the Deck Builder and run it to actually "Merge Specs" so that sub-types from the mods they have would get updated into a single spot and set with high priority to make sure it is used above all others.
Last edited by RiiakShiNal on 15 Oct 2013, 17:25, edited 1 time in total.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Adding a new sub type.

Postby BETenner » 15 Oct 2013, 17:21

Thanks, that's the reason.
And also, I found that the game will choose the CREATURE_TYPES.TXT from the LAST mod, so I just changed my mod file's names (adding Z to the first letter maybe) to solve the problem.
BETenner
 
Posts: 36
Joined: 07 Mar 2013, 14:20
Has thanked: 7 times
Been thanked: 4 times

Re: Adding a new sub type.

Postby RiiakShiNal » 15 Oct 2013, 17:26

Glad it was something simple and you got it figured out.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 21 guests


Who is online

In total there are 21 users online :: 0 registered, 0 hidden and 21 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 21 guests

Login Form