It is currently 01 Jun 2020, 05:48
   
Text Size

[ TUTORIAL BASIC ] Coding your cards...

User-made mods in DLC (Downloadable Content) form.
Get MTG cards here for your DotP that aren't available anywhere else!

Moderators: Xander9009, CCGHQ Admins

[ TUTORIAL BASIC ] Coding your cards...

Postby jacque » 16 Sep 2013, 10:14

INTRO

I noticed there isn't a "Tutorial" in particular explaining how one could code their cards... Being a newbie, I didn't know what to do, where to start from... And I am sure there are others like me, out there, just like you...

I know how frustrating it could be waiting for some kind soul out there, to code the cards that you like, or are familiar with, specially for you, or coincidentally they have it in their DLC releases.

I hope this "Tutorial" helps you, in some way... It's not thorough, but it should get you by... =)

-------------------------------------------------------------------------------------------------------

DISCLAIMER

The author, Jacque, shall not be held responsible due to any untoward mishaps occurred using this "Tutorial". You will understand that using this tutorial is at your own risk.

-------------------------------------------------------------------------------------------------------

WHAT DO YOU NEED?

You'll need to download a few stuffs before you get started coding your cards.

1. RIIAK'S DOTP 2014 DECK BUILDER

1.1 DOWNLOAD
| Open
http://www.slightlymagic.net/forum/viewtopic.php?f=99&t=10999
Image


1.2 INSTALLATION
| Open
- Extract the contents.
- For me: C:\My Download Files\DOTP2014\ (your own preference, I like keeping my files organized)
Image


1.3 CONFIGURATION
| Open
GAME DIRECTORY
- You'll need to configure the Deck Builder properly before you begin using it.
- Defining the DotP 2014 Game Directory
Image
Image
Image

CUSTOM DATA FOLDER
- In Dotp 2014 Deck Builder, click "Tools", then select "Setup Custom Data Folder". You will be placing all the cards you create under this folder.
Image
Image
- This newly created folder will be found under your DotP 2014 Game Directory named "DATA_DLC_DECK_BUILDER_CUSTOM".
Image
- Under the DATA_DLC_DECK_BUILDER_CUSTOM folder, you will see these:
Image
Image
- ART_ASSETS > ILLUSTRATIONS - This is where you place all the artwork for the coded cards in *.tdx format.
- CARDS - This is where you place all the coded cards in *xml format
- You can leave the other HEADER file alone...


2. GIBBED TOOLS

2.1 DOWNLOAD
| Open
- Download the "Binaries" one.
viewtopic.php?f=99&t=10463


2.2 INSTALLATION
| Open
- Extract the contents somewhere that is easily accessible. I'd suggest you to extract it onto your Desktop, or into a folder on your Root Directory.
- For me: C:\DOTP2014\ (your own preference)
Image


3. DLCs from other Modders

| Open
- Don't recreate what has been created and proven stable.
- Use the cards coded by other modders as a reference to yours, less likely you'll get into trouble coding yours.

- Below a list of modders who knows what they are doing:
RiiakShiNal - viewtopic.php?f=109&t=11079
thefiremind - viewtopic.php?f=109&t=11005
kevlahnota - viewtopic.php?f=109&t=10927
summomole - viewtopic.php?f=109&t=10914
BloodReyvyn - viewtopic.php?f=109&t=11060
gorem2k - viewtopic.php?f=109&t=10963
TFM&G2K - viewtopic.php?f=109&t=11615

- If you're not able to find what you want, you can always "request" or refer them here: viewtopic.php?f=109&t=11010


-------------------------------------------------------------------------------------------------------

GUIDELINES

1.1 BEST PRACTICES
| Open
http://www.slightlymagic.net/wiki/DotP_2014:_Best_Practices


1.2 CARD'S PREFIX ID
| Open
http://www.slightlymagic.net/wiki/DotP_2014:_Prefix/Id_Registry


1.3 CARD'S NAME FORMAT
| Open
- This is how I name my cards:
"NAME_OF_THE_CARD"_"PREFIX""MULTIVERSEID"
- Example: SHADOWMAGE_INFILTRATOR_256126333.xml
- To find the multiversid for the card you are creating, go to: "gatherer.wizards.com", search for the card you want. The last 6 digits you see on the address bar of your browser is the multiverseid for the card.
Image
- Save "SHADOWMAGE_INFILTRATOR_333126333.xml" in the "CARDS" folder under "DATA_DLC_DECK_BUILDER_CUSTOM > DATA_ALL_PLATFORMS" in your DotP 2014 Game Directory.


-------------------------------------------------------------------------------------------------------

YOUR CARD: "HOLY DAY"

- I'll be using "Holy Day" as an example in this tutorial (very basic).

| Open
1. GETTING IDEAS
- Since I am new to this, I don't want to start beating around the bush and end up with nothing. What I'll do, I'll "borrow" ideas from other sources.
- The basic idea is that, if you are working on an "Instant", borrow the idea from another "Instant" card... or a card with a similar ability.
- Holy Day's effect is similar to... Fog... This is how I'll get started:

1.1 Run "DotP 2014 Deck Builder"
- Click on "Set Filters" in the Deck Builder, and then search for "Fog" under the "Card Name" section.
Image
- The program will then return a list of cards matching the filtered criteria.
- Please note that the result you get, is based on the number of DLCs you have downloaded, stored, and identified by the Deck Builder. All downloaded DLCs should be placed in the DotP 2014 Game Directory.
- There are times where there maybe more than one result. Use the official DLC if possible.
- Below is the result, from the filter earlier.
Image
- Take note of the Wad name under the "Wad" column. In this case: "DATA_DECKS_D14".

1.2 Extract "DATA_DECKS_D14.WAD"
- Go to the DotP 2014 Game Directory, copy the "DATA_DECKS_D14.WAD" into the "Modified Gibbed Tools r6_b10 Binaries" directory, and drop it onto "Gibbed.Duels.Unpack".
Image
- A new folder named "DATA_DECKS_D14_unpacked" will be created as the wad is being extracted.
Image

1.3 Look for "Fog"
- Look for the card "Fog" in "DATA_DECKS_D14_unpacked > DATA_DECKS_D14 > DATA_ALL_PLATFORMS > CARDS".
- The card you are looking for should be named: "FOG_345340.xml"
- Copy "FOG_345340.xml" to the "CARDS" folder under "DATA_DLC_DECK_BUILDER_CUSTOM > DATA_ALL_PLATFORMS".
- Rename it to "HOLY_DAY_789129593.xml". Assuming "789" is your unique card prefix ID, and "129593" being the multiverseid from "gatherer.wizards.com".

1.4 Coding "Holy Day"
- This should be fairly easy as "Fog's" ability is the same as "Holy Day's"
- To start "coding", open "HOLY_DAY_789129593.xml" with "Notepad".
Image
- You will then see this:
Image
- Update the following fields:
<FILENAME text="HOLY_DAY_789129593" />
<CARDNAME text="HOLY_DAY" />
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Holy Day]]></LOCALISED_TEXT>
- If you're not as lazy as I am, and able to find Holy Day in other translations, update the rest as well. I'll stick to English only for this tutorial.
<MULTIVERSEID value="789129593" />
<ARTID value="A789129593" />
- "A", simply denotes Artwork.
<ARTIST name="Volkan Baga" />
<CASTING_COST cost="{W}" />
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA["Today there is feasting and peace across our land, but the war has not ended. Tuck away your bloodlust. You'll need it tomorrow."
—Karrim, Samite healer]]></LOCALISED_TEXT>
- Once you're done, save it.
- BUT, you're not quite done yet... Let's work on the "Artwork".

1.5 Finding Artwork for "Holy Day"
- Search for an artwork online, the higher the resolution, the better it is.
- Use any Graphic Editing Software, crop anything that is not needed. You only want the artwork, not the border, etc. and then save it as a *.PNG file. In this case: "HolyDay001.PNG"
- Copy "HolyDay001.PNG" into the "Modified Gibbed Tools r6_b10 Binaries" directory and then drag and drop it onto "Gibbed.Duels.TdxConvert".
Image
- A new file named "HolyDay001.TDX" will be created.
Image
- Copy "HolyDay001.TDX" to the "ILLUSTRATIONS" folder under "DATA_DLC_DECK_BUILDER_CUSTOM > DATA_ALL_PLATFORMS > ART_ASSETS".
- Rename "HolyDay001.TDX" to "A789129593.TDX".


-------------------------------------------------------------------------------------------------------

CREATING YOUR CORE WAD

- You just two steps away from testing, using the card(s) you have just coded. In this case, Holy Day.
- In order to use Holy Day, you'll need to create your own "Core" wad. It'll contain all the new cards that you have coded.

| Open
1. Run "DotP 2014 Deck Builder"
- In Dotp 2014 Deck Builder, click "Tools", then select "Create Core Wad from Custom Data ...".
Image
- You can name your core as you wish: "DATA_DLC_789" or "DATA_DLC_TEST" or anything you like.
- The Deck Builder will freeze for a while, as it compiles the new card(s) that are found in the Custom Data Folder.

2. Reload Data
- One more step to go!!!
- In Dotp 2014 Deck Builder, click "Tools", then select "Refresh Data".
- The Deck Builder will freeze for a while as it reloads all the DLCs...
- "Set Filter", key in "Holy Day", it SHOULD BE there...
- You may also close the Deck Builder and reopen it.


-------------------------------------------------------------------------------------------------------

LET'S PLAY!!!

- Well, what do you know... You've just created a new card of your own, and it's ready for use.
- Please note that it's always good to play-test the new cards yourself, before releasing it to the public.
- Have fun crashing your game!!! Oops, I meant coding... =)

Jacque
Last edited by jacque on 13 Oct 2013, 13:24, edited 6 times in total.
Learn making your own cards today!!!

Click on Image if a post/reply helped you.

I stitch old cards together to make new ones...

~ Jacque, the confused
jacque
 
Posts: 217
Joined: 07 Jun 2013, 20:11
Has thanked: 26 times
Been thanked: 44 times

Re: [Tutorial Basic] Coding your cards...

Postby MC Brodie » 16 Sep 2013, 11:35

Awesome, thanks for putting this together. I have a few tips I'd like to add. Since I'm on my phone I'll make it brief but I can expand later.

-You don't need to unpack wads to view cards! In Riiak's deck builder you can right click the card and hit "View Code" and it will show you the xml file. Probably, the only time you'll need to unpack wads is if you want to see functions, localised text files, or general wad structure.

-As you stated, Riiak's deck builder is very helpful when making cards. It allows you to search the ability text so you can see how similar cards are coded. Sumomole gives an example of this a few days in the formal request thread. See the below for an example.

-A helpful card to use when play testing is TFMs Leyline of Diety. It allows you to take extra turns, tutor for the card you want, play cards for free and more. I suggest including it in your play testing deck. You can find find Leyline of Diety here.

Coding by Searching the Deckbuilder
The easiest way to code a card is extract pieces of code from working cards and compile it into your new card. Riiak's Deck Builder provides an efficient way to search a large library of cards for the code you need. Below is an example on how you can code cards by using the deck builder to search for similar abilities. For the example we'll code Blightcaster, which has the following ability: "Whenever you cast an enchantment spell, you may have target creature get -2/-2 until end of turn."

Step 1: The first step is to use thefiremind's web generator (found here) to set up the basic structure of the card. The web gererator does most of the busy work when creating a card. All you have to do is code the abilities. For Blightcaster, the web generator produces the following code:
Blightcaster Step 1 | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="BLIGHTCASTER_153370761" />
  <CARDNAME text="BLIGHTCASTER" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Blightcaster]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Lancefléau]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Lanzaruina]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fäulnismagier]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Lanciadevastazione]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[荒廃唱え]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[질병술사]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Колдун Злоключений]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Conjurador de Desgraça]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="153370761" />
  <ARTID value="153370761" />
  <ARTIST name="Winona Nelson" />
  <CASTING_COST cost="{3}{B}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Your flesh is unprepared for my gifts.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Ta chair est trop tendre pour recevoir mes faveurs. »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“Tu carne no está preparada para mi don.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Dein Fleisch ist für meine Gaben nicht bereit.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“La tua carne non è pronta per i miei doni.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「お前の肉体では私の贈り物を受け止められんな。」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“네 몸은 아직 내 사랑을 받을 준비가 부족해.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Твоя плоть еще не готова получить мои дары».]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Sua carne não está preparada para minhas dádivas.”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Human" />
  <SUB_TYPE metaname="Wizard" />
  <EXPANSION value="M14" />
  <RARITY metaname="U" />
  <POWER value="2" />
  <TOUGHNESS value="3" />
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever you cast an enchantment spell, you may have target creature get -2/-2 until end of turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que vous lancez un sort d’enchantement, vous pouvez faire qu’une créature ciblée gagne -2/-2 jusqu’à la fin du tour.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que lances un hechizo de encantamiento, puedes hacer que la criatura objetivo obtenga -2/-2 hasta el final del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn du einen Verzauberungszauber wirkst, kannst du eine Kreatur deiner Wahl bis zum Ende des Zuges -2/-2 erhalten lassen.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta lanci una magia incantesimo, puoi far prendere -2/-2 a una creatura bersaglio fino alla fine del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがエンチャント呪文を1つ唱えるたび、クリーチャー1体を対象とする。あなたは「それはターン終了時まで-2/-2の修整を受ける。」を選んでもよい。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[당신이 부여마법 주문을 발동할 때마다, 생물 한 개를 목표로 정한다. 당신은 그 생물이 턴종료까지 -2/-2를 받도록 할 수 있다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда вы разыгрываете заклинание чар, вы можете дать целевому существу -2/-2 до конца хода.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que você conjura uma mágica de encantamento, você pode fazer com que a criatura alvo receba -2/-2 até o final do turno.]]></LOCALISED_TEXT>
  </TRIGGERED_ABILITY>
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>


Step 2: The next step is to break down the card's abilities into simple, searchable pieces. The ability from Blightcaster can be broken up into 3 segments: (1) "Whenever you cast an enchantment spell", (2) "you may have", and "target creature get -2/-2 until end of turn". Open Riiak's Deckbuilder and click on the "Set Advanced Filter" button (I prefer to use the Advanced Filter over the Basic Filter but I think you can use the Basic Filter for the same functions). Under the "String" tab paste in "Whenever you cast an enchantment spell", click "Add Filter" then click "Apply". For this example I'm only using cards that come with the Vanilla game so only two cards meet the criteria: Mesa Enchantress and Sigil of the Empty Throne. Right click Sigil of the Empty Throne and click "View Card". Here is the only tricky part about coding card: identifying the code for the ability you want to mimic. Since we are trying to code the "trigger" part of Blightcaster, find the "<TRIGGER>...</TRIGGER>" block for Sigil of the Empty Throne. Copy that code and paste it into our Blightcaster code inbetween the localised text and </TRIGGERED_ABILITY>.
Blightcaster Step 2 | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="BLIGHTCASTER_153370761" />
  <CARDNAME text="BLIGHTCASTER" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Blightcaster]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Lancefléau]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Lanzaruina]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fäulnismagier]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Lanciadevastazione]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[荒廃唱え]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[질병술사]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Колдун Злоключений]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Conjurador de Desgraça]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="153370761" />
  <ARTID value="153370761" />
  <ARTIST name="Winona Nelson" />
  <CASTING_COST cost="{3}{B}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Your flesh is unprepared for my gifts.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Ta chair est trop tendre pour recevoir mes faveurs. »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“Tu carne no está preparada para mi don.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Dein Fleisch ist für meine Gaben nicht bereit.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“La tua carne non è pronta per i miei doni.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「お前の肉体では私の贈り物を受け止められんな。」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“네 몸은 아직 내 사랑을 받을 준비가 부족해.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Твоя плоть еще не готова получить мои дары».]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Sua carne não está preparada para minhas dádivas.”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Human" />
  <SUB_TYPE metaname="Wizard" />
  <EXPANSION value="M14" />
  <RARITY metaname="U" />
  <POWER value="2" />
  <TOUGHNESS value="3" />
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever you cast an enchantment spell, you may have target creature get -2/-2 until end of turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que vous lancez un sort d’enchantement, vous pouvez faire qu’une créature ciblée gagne -2/-2 jusqu’à la fin du tour.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que lances un hechizo de encantamiento, puedes hacer que la criatura objetivo obtenga -2/-2 hasta el final del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn du einen Verzauberungszauber wirkst, kannst du eine Kreatur deiner Wahl bis zum Ende des Zuges -2/-2 erhalten lassen.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta lanci una magia incantesimo, puoi far prendere -2/-2 a una creatura bersaglio fino alla fine del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがエンチャント呪文を1つ唱えるたび、クリーチャー1体を対象とする。あなたは「それはターン終了時まで-2/-2の修整を受ける。」を選んでもよい。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[당신이 부여마법 주문을 발동할 때마다, 생물 한 개를 목표로 정한다. 당신은 그 생물이 턴종료까지 -2/-2를 받도록 할 수 있다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда вы разыгрываете заклинание чар, вы можете дать целевому существу -2/-2 до конца хода.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que você conjura uma mágica de encantamento, você pode fazer com que a criatura alvo receba -2/-2 até o final do turno.]]></LOCALISED_TEXT>
      <TRIGGER value="SPELL_PLAYED" simple_qualifier="controller">
    return  TriggerObject():GetCardType():Test( CARD_TYPE_ENCHANTMENT )
    </TRIGGER>
  </TRIGGERED_ABILITY>
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>


Step 3: Now we just need to repeat Step 2 for the other 2 segments of Blightcaster's ability. Lets skip to the last segment before we do the 2nd. In Riiak's deckbuilder clear the advanced filter and this time search for "target creature get -2/-2 until end of turn". When you hit apply you'll see that no cards match this search criteria. Now we have to refine our filter. Clear the filter and this time search for "-2/-2 until end of turn". This time we hit some results and the ability for Farbog Bonefinger is essentially the exact same as Blightcaster's. View the code for Farbog Bonefinger and scroll down to the triggered ability. This time we want the action part of the ability including the <TARGET> declaration all the way down to the <AI_SIMPLIFIED_TARGETING>. Copy this code and paste it into our current Blightcaster code in between the <TRIGGER> and </TRIGGERED_ABILITY>. This is what we have so far:
Blightcaster Step 3 | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="BLIGHTCASTER_153370761" />
  <CARDNAME text="BLIGHTCASTER" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Blightcaster]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Lancefléau]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Lanzaruina]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fäulnismagier]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Lanciadevastazione]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[荒廃唱え]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[질병술사]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Колдун Злоключений]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Conjurador de Desgraça]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="153370761" />
  <ARTID value="153370761" />
  <ARTIST name="Winona Nelson" />
  <CASTING_COST cost="{3}{B}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Your flesh is unprepared for my gifts.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Ta chair est trop tendre pour recevoir mes faveurs. »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“Tu carne no está preparada para mi don.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Dein Fleisch ist für meine Gaben nicht bereit.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“La tua carne non è pronta per i miei doni.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「お前の肉体では私の贈り物を受け止められんな。」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“네 몸은 아직 내 사랑을 받을 준비가 부족해.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Твоя плоть еще не готова получить мои дары».]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Sua carne não está preparada para minhas dádivas.”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Human" />
  <SUB_TYPE metaname="Wizard" />
  <EXPANSION value="M14" />
  <RARITY metaname="U" />
  <POWER value="2" />
  <TOUGHNESS value="3" />
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever you cast an enchantment spell, you may have target creature get -2/-2 until end of turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que vous lancez un sort d’enchantement, vous pouvez faire qu’une créature ciblée gagne -2/-2 jusqu’à la fin du tour.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que lances un hechizo de encantamiento, puedes hacer que la criatura objetivo obtenga -2/-2 hasta el final del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn du einen Verzauberungszauber wirkst, kannst du eine Kreatur deiner Wahl bis zum Ende des Zuges -2/-2 erhalten lassen.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta lanci una magia incantesimo, puoi far prendere -2/-2 a una creatura bersaglio fino alla fine del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがエンチャント呪文を1つ唱えるたび、クリーチャー1体を対象とする。あなたは「それはターン終了時まで-2/-2の修整を受ける。」を選んでもよい。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[당신이 부여마법 주문을 발동할 때마다, 생물 한 개를 목표로 정한다. 당신은 그 생물이 턴종료까지 -2/-2를 받도록 할 수 있다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда вы разыгрываете заклинание чар, вы можете дать целевому существу -2/-2 до конца хода.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que você conjura uma mágica de encantamento, você pode fazer com que a criatura alvo receba -2/-2 até o final do turno.]]></LOCALISED_TEXT>
      <TRIGGER value="SPELL_PLAYED" simple_qualifier="controller">
    return  TriggerObject():GetCardType():Test( CARD_TYPE_ENCHANTMENT )
    </TRIGGER>
         <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_LOSE_2_2" definition="0" compartment="0" count="1" />
      <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
      <CONTINUOUS_ACTION layer="7C">
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Power_Add( -2 )
       characteristics:Toughness_Add( -2 )
    end
    </CONTINUOUS_ACTION>
      <DURATION simple_duration="UntilEOT" />
      <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
  </TRIGGERED_ABILITY>
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>


Step 4: Almost there. We just have to add the "you may have" portion. Clear the filters in Riiak's deckbuilder and this time search for "you may have". A handful of options come up but lets just look at Goblin Arsonist. If you scroll down to the triggered ability of Goblin Arsonist you'll notice a "<MAY/>" tag. This iteration Stainless decided to make it easy on us and for "may" abilities, you only have to add this simple tag. Copy the "<MAY/>" and paste it into our Blightcaster code in between the <TARGET> and <TARGET_DEFINITION> tags. Let's look at our final code:
Blightcaster Step 4 | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="BLIGHTCASTER_153370761" />
  <CARDNAME text="BLIGHTCASTER" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Blightcaster]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Lancefléau]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Lanzaruina]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fäulnismagier]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Lanciadevastazione]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[荒廃唱え]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[질병술사]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Колдун Злоключений]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Conjurador de Desgraça]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="153370761" />
  <ARTID value="153370761" />
  <ARTIST name="Winona Nelson" />
  <CASTING_COST cost="{3}{B}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Your flesh is unprepared for my gifts.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[« Ta chair est trop tendre pour recevoir mes faveurs. »]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“Tu carne no está preparada para mi don.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Dein Fleisch ist für meine Gaben nicht bereit.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“La tua carne non è pronta per i miei doni.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「お前の肉体では私の贈り物を受け止められんな。」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“네 몸은 아직 내 사랑을 받을 준비가 부족해.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Твоя плоть еще не готова получить мои дары».]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Sua carne não está preparada para minhas dádivas.”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Human" />
  <SUB_TYPE metaname="Wizard" />
  <EXPANSION value="M14" />
  <RARITY metaname="U" />
  <POWER value="2" />
  <TOUGHNESS value="3" />
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever you cast an enchantment spell, you may have target creature get -2/-2 until end of turn.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que vous lancez un sort d’enchantement, vous pouvez faire qu’une créature ciblée gagne -2/-2 jusqu’à la fin du tour.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que lances un hechizo de encantamiento, puedes hacer que la criatura objetivo obtenga -2/-2 hasta el final del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn du einen Verzauberungszauber wirkst, kannst du eine Kreatur deiner Wahl bis zum Ende des Zuges -2/-2 erhalten lassen.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta lanci una magia incantesimo, puoi far prendere -2/-2 a una creatura bersaglio fino alla fine del turno.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがエンチャント呪文を1つ唱えるたび、クリーチャー1体を対象とする。あなたは「それはターン終了時まで-2/-2の修整を受ける。」を選んでもよい。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[당신이 부여마법 주문을 발동할 때마다, 생물 한 개를 목표로 정한다. 당신은 그 생물이 턴종료까지 -2/-2를 받도록 할 수 있다.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда вы разыгрываете заклинание чар, вы можете дать целевому существу -2/-2 до конца хода.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que você conjura uma mágica de encantamento, você pode fazer com que a criatura alvo receba -2/-2 até o final do turno.]]></LOCALISED_TEXT>
      <TRIGGER value="SPELL_PLAYED" simple_qualifier="controller">
    return  TriggerObject():GetCardType():Test( CARD_TYPE_ENCHANTMENT )
    </TRIGGER>
         <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_LOSE_2_2" definition="0" compartment="0" count="1" />
<MAY/>
      <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
      <CONTINUOUS_ACTION layer="7C">
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Power_Add( -2 )
       characteristics:Toughness_Add( -2 )
    end
    </CONTINUOUS_ACTION>
      <DURATION simple_duration="UntilEOT" />
      <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
  </TRIGGERED_ABILITY>
  <SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
  <SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>


Step 5: That should be it. Save it, pack it, test it then add it to your decks. If you get a big card library, coding cards is as easy as copy and paste. Good luck and don't be afraid to ask questions. Here is a final screenshot of how the code comes together.

I couldn't find an easy way to host the pictures so I'll just attach them.
Attachments
Screenshots.rar
(1.78 MiB) Downloaded 243 times
Last edited by MC Brodie on 17 Sep 2013, 02:01, edited 5 times in total.
-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
MC Brodie
 
Posts: 310
Joined: 01 Jun 2013, 00:10
Has thanked: 44 times
Been thanked: 34 times

Re: [Tutorial Basic] Coding your cards...

Postby RiiakShiNal » 16 Sep 2013, 12:42

Just a few quick comments:
  • Under the Card Prefix you have me listed as using 14/_1404, but I only use RSN/8192 for my prefixes, Scion of Darkness, however, does use 14/1404.
  • The current registered prefixes are available here (This is also where new modders can register their prefixes): Prefix/Id Registry
  • We have a page for Best Practices as we figure out what a best practice is and should be here: Best Practices
  • As stated by MC Brodie you can view code in the Deck Builder by right-clicking and choosing "View Card ..."; you can also export the XML for a card by right-clicking the card and selecting "Export Card XML".
  • A better way to get the basic code for a new card is to use thefirmind's Web Generator to get all the localized text and the proper structure for the card, then you could look at the code of similar cards to get the ability code (for example look at Fog to get the ability code for Holy Day). Direct-Link to Generator
  • Since you have already directed people to get my modified Gibbed Tools you might also want to put into your tutorial how to create compressed TDX files (will save space and prevent the super-shiny-can't-read-card issue that some people have with uncompressed images). For card images (standard size is 512x376) you could use the TDXConvertDXT1.bat batch file (listed in the modified Gibbed Tools thread) since card images don't need transparency.
RiiakShiNal
Programmer
 
Posts: 2135
Joined: 16 May 2011, 21:37
Has thanked: 74 times
Been thanked: 474 times

Re: [Tutorial Basic] Coding your cards...

Postby jacque » 16 Sep 2013, 15:24

MC Brodie wrote:...
Good tips back there... I learnt a thing or two (at least) from what you just posted... Silly me though never bothered to "Right Click" in the Deck Builder before... I'll update the tutorial later. Thanks again!

RiiakShiNal wrote:...
I really appreciate whenever you come in and point me to the correct direction, how to get things done. It saves me, and others a lot of time, tried (and still trying) to figure things out. I've updated some parts of the tutorial up there, and will continue to do so. Thanks a bunch!
Learn making your own cards today!!!

Click on Image if a post/reply helped you.

I stitch old cards together to make new ones...

~ Jacque, the confused
jacque
 
Posts: 217
Joined: 07 Jun 2013, 20:11
Has thanked: 26 times
Been thanked: 44 times

Re: [Tutorial Basic] Coding your cards...

Postby Kieran » 17 Sep 2013, 07:32

This definitely a great starting guide jacque. And I'm sure with constant updates and community input this can possibly become a catchall reference for beginners and veterans alike. Good Job! And thanks!
Kieran
 
Posts: 232
Joined: 03 Nov 2012, 01:09
Has thanked: 21 times
Been thanked: 16 times


Return to New MTG Cards and Decks

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 1371 on 09 Feb 2020, 16:22

Users browsing this forum: No registered users and 1 guest

Login Form