It is currently 18 Apr 2024, 05:35
   
Text Size

[ TUTORIAL ADVANCE ] Coding Your Cards...

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

Moderator: CCGHQ Admins

[ TUTORIAL ADVANCE ] Coding Your Cards...

Postby jacque » 13 Oct 2013, 11:23

INTRO

I have gotten much better at this, thanks to RiiakShiNal, thefiremind and of course MCBrodie... I would love to share this knowledge I have with you guys out there. This tutorial is suitable to both beginners, and also those who have already been coding.

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

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.

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

TABLE OF CONTENTS

1. What do you need?
2. Useful Guidelines
3. The Twin Pillars
4. The Programmer: Working with Codes
5. The Artiste: Dealing with Artwork
6. Sharing your Work
7. Useful Links

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

FINAL NOTES

Enjoy... You'd soon get addicted like me... :P

Love,
Jacque
Last edited by jacque on 14 Oct 2013, 04:10, edited 4 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 Advance ] Coding Your Cards...

Postby jacque » 13 Oct 2013, 11:24

WHAT DO YOU NEED?

    Before you begin, there are a few software and/or tools that you'll need:


1. RIIAK'S DOTP 2014 DECK BUILDER

    - Basically a software that allows you to build your own DOTP2014 Decks based on the downloaded contents that you have, which generates a "card pool" for the deck builder.
    - It also allows you to view the card's code directly without first having to unpack the *.WAD files using Gibbed Tools, and repacking them once you're done.

1.1 DOWNLOAD


1.2 INSTALLATION

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

1.3 CONFIGURATION

    1.3.1 DOTP2014 GAME DIRECTORY | Open
    - You'll need to configure the Deck Builder properly before you begin using it.
    - Locate and define the DotP 2014 game directory.
    Image

    1.3.2 YOUR OWN BLOCK ID | Open
    - Every modder has his/her own Block ID. Please refer to this page to find out more. This is to avoid the cards that you have created clashes with the ones that others have created.
    - Block ID is a number that differentiates your cards from other modders' cards. It is possible that there are more than one modder having worked/working on the same card.
    Image

    1.3.3 CUSTOM DATA FOLDER | Open
    - 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
    - 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:
    ImageImage
    - CARDS - This is where you place all the coded cards in *.XML format
    Image
    - ART_ASSETS > ILLUSTRATIONS - This is where you place all the artwork for the coded cards in *.TDX format.
    Image
    - You can leave the other files alone for now.

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

2. GIBBED TOOLS

    - Basically a tool that allows you to pack/unpack *.WAD files, and also to convert image files into *.TDX and vice-versa.

2.1 DOWNLOAD


2.2 INSTALLATION

    INFO | 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)

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

3. CODING SOFTWARE

    - You don't really need any special software to code the cards. I am only using Notepad. But if you insist on getting something "special" to help you code "easier" (colored tags, etc.), you can try Notepad++

3.1 NOTEPAD++ (FREEWARE)


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

4. GRAPHIC EDITING SOFTWARE

    - Basically a software that allows you to crop artwork from card scans, or from other related websites.

4.1 ADOBE PHOTOSHOP (LICENSED SOFTWARE)


4.2 EASY PAINT TOOL SAI (FREEWARE)

    3.2.1 INFO | Open
    - Easy Paint Tool SAI offers similar functionality to Adobe Photoshop. If you do not have Adobe Photoshop, you can use other Graphic Editing Software, or you can use SAI instead.
    - You can get your copy of Easy Paint Tools SAI HERE.

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

5. DLC FROM OTHER MODDERS

    - You'll definitely need reference sources when you code your cards. The idea: The more references you can refer to, the better it is.
    - Most of the official cards only offer "basic" solutions, that's why you need other DLCs for inspiration.

5.1 MODDER LIST


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

[ - BACK TO TOP ]
Last edited by jacque on 13 Oct 2013, 13:07, edited 34 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 Advance ] Coding Your Cards...

Postby jacque » 13 Oct 2013, 11:24

USEFUL GUIDELINES

    It is good to gather "intel" of your "enemy" before you go into the "war zone"... *nah it's not that bad actually xD*


1. BEST PRACTICES

    - The dos and don'ts.


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

2. CARD PREFIX ID

    - Organizing your cards so that they do not clash with other modders' cards.


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

3. CARD NAME FORMAT

    - How you can name your cards.

    INFO | Open
    - I name my cards according to this structure: "NAME_OF_THE_CARD"_"PREFIX+MULTIVERSEID"
    - Example: SHADOWMAGE_INFILTRATOR_256126333.XML
    Image
    - thefiremind (TFM) has created an online card generator tool to save you the hassle of renaming your card manually (and a lot more). His tool is located HERE.
    Image
    - Please REMEMBER that TFM's online tool DOES NOT provide the full code for the card.
    - What it does is that it just provide the basic structure (there are scenarios you may need to change the structure to suit the card's ability(ies)), all the necessary XML blocks (sections) eg. Card's Name, Casting Cost, Expansion, Flavour Text, Rule Text, etc.
    - Please REMEMBER these as well:
        1. The name of your XML file must match the <FILENAME> tag in that XML file. If your XML is SHADOWMAGE_INFILTRATOR_256126333, the string in the <FILENAME> tag must be <FILENAME text="SHADOWMAGE_INFILTRATOR_256126333" />
        2. You MAY NOT use the same 256126333 for the <ARTID> tag of Shadowmage Infiltrator. BUT, the string you name for the <ARTID> tag MUST BE THE SAME as the name of the corresponding TDX file (the artwork for Shadowmage Infiltrator). Therefore, if in the <ARTID> tag is <ARTID value="A256777888" />, your TDX file MUST BE named A256777888.TDX. HOWEVER, I do advise strongly that u use the SAME card prefix + multiverse across all levels (easier to trace and catalogue).
        XML: SHADOWMAGE_INFILTRATOR_256126333
        <FILENAME> tag: <FILENAME text="SHADOWMAGE_INFILTRATOR_256126333" />
        <ARTID> tag: <ARTID value="A256126333" />
    - Save "SHADOWMAGE_INFILTRATOR_256126333.xml" in the "CARDS" folder under "DATA_DLC_DECK_BUILDER_CUSTOM > DATA_ALL_PLATFORMS" in your DotP 2014 game directory.

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

[ - BACK TO TOP ]
Last edited by jacque on 13 Oct 2013, 13:49, edited 5 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 Advance ] Coding Your Cards...

Postby jacque » 13 Oct 2013, 11:24

THE TWIN PILLARS

    The concept behind card coding is based on two pillars, of which goes hand in hand. Whenever a card is coded, you will need a corresponding artwork for it, vice-versa. Therefore remember, whenever you work on a card, don't forget the artwork to go with it.


1. THE PROGRAMMER: WORKING WITH CODES

    You do not necessarily have to be an experienced programmer to code your cards. What you need are sources of inspiration, basic understanding of logic and the structures that governs them, and determination as well as persistence - don't give up easily, you do not know if you're only a step away to a fully functional card.

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

2. THE ARTISTE: DEALING WITH ARTWORK

    Don't worry you do not need to come out with your own artwork for the cards. All you need is to know where to find them, and how to modify them to suit your needs. I believe in the implementation of Alternate Arts, and artworks should be of high quality.

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

[ - BACK TO TOP ]
Last edited by jacque on 13 Oct 2013, 14:03, edited 2 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 Advance ] Coding Your Cards...

Postby jacque » 13 Oct 2013, 11:25

THE PROGRAMMER: WORKING WITH CODES

    I will be giving two examples, which I believe, should be enough. Don't expect to be spoon-fed; it has been proven that one learns best through self-learning hehehe...


1. MASTERLIST

    I have a masterlist in Excel format, to help me keep track of the cards that I have coded, cards that I have released as Core, cards that are without artworks, cards still need work, etc.

1.1 HOW IT WORKS?

    INFO | Open
    Image
    NO. - Number of the card in the masterlist.
    REL - Date of when the card was released.
    CARD NAME - Name of the card.
    COLOUR - Colour of the card.
    SET - Which set is the card from.
    DATE - Date when the card was coded.
    STATUS - Status of the card. OK - Tested & Working, WIP - Work in Progress, Blank - Not Tested.
    VER - Card used in which version of DotP. 2014 - DotP2014.
    ART - Which artwork was used for the card. New - New dimension of 512 x 376 DPI.
    REMARK - Only for cards that are marked WIP.

1.2 DOWNLOAD



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

2. STEP-BY-STEP: WHAT'S FIRST?

    This is what I usually do. Again, it may or may not apply to you.

2.1 IDENTIFYING A CARD


2.2 GETTING CARD STRUCTURE

    INFO | Open
    - Next we obtain Captain of the Watch's card structure from TFM's Online Card Generator: TFM'S ONLINE CARD GENERATOR LINK.
    - Fill in the necessary fields. For this example, we'll be using 256 as our Block ID; so at the card generator, do this:
    Image
    - You'd be prompted to save CAPTAIN_OF_THE_WATCH_256259716.XML. Don't worry the file is safe. Save it in the CARDS folder under the DATA_DLC_DECK_BUILDER_CUSTOM folder in your DOTP2014 game directory.
    Image

2.3 RECOGNIZING CARD STRUCTURE

    INFO | Open
    - "Right-click" on the XML file, "Open With", "Notepad"... and you'll see this:
    Image
    - As you can see, the basic needful has been done for you with TFM's Online Card Generator.
    - Captain of the Watch has 3 abilities:
        1. <STATIC_ABILITY>
        2. <STATIC_ABILITY>
        3. <TRIGGERED_ABILITY>
      - Each <STATIC_ABILITY> until the first </STATIC_ABILITY> is called a "Block".
      - So there are 3 blocks total we'll be working on.

2.4 CARD TYPES & ABILITIES

    INFO | Open
    - You could easily "predict" the abilities of a particular card.
    - For more information, please refer to THIS LINK.
    INSTANT & SORCERY | Open
    - <SPELL_ABILITY></SPELL_ABILITY>
    CREATURE | Open
    - <STATIC_ABILITY></STATIC_ABILITY>
    - <TRIGGERED_ABILITY></TRIGGERED_ABILITY>
    - <ACTIVATED_ABILITY></ACTIVATED_ABILITY>
    ENCHANTMENT | Open
    - <STATIC_ABILITY></STATIC_ABILITY>
    - <TRIGGERED_ABILITY></TRIGGERED_ABILITY>
    - <ACTIVATED_ABILITY></ACTIVATED_ABILITY>
    ARTIFACT | Open
    - <STATIC_ABILITY></STATIC_ABILITY>
    - <TRIGGERED_ABILITY></TRIGGERED_ABILITY>
    - <ACTIVATED_ABILITY></ACTIVATED_ABILITY>
    LAND | Open
    - <MANA_ABILITY></MANA_ABILITY>
    - <ACTIVATED_ABILITY></ACTIVATED_ABILITY>
    - <TRIGGERED_ABILITY></TRIGGERED_ABILITY>

2.5 WHEN TO USE THEM ABILITIES

    <STATIC_ABILITY> | Open
    - On cards with power toughness boost to creatures, etc. eg.:
    - On creature cards that has a special characteristic eg.:
        Luna Wolves: First Strike
        Black Knight: Protection from White, First Strike
    <ACTIVATED_ABILITY> | Open
    - On cards that requires an "activation" before an ability is granted eg.:
        {T}: Target creature gains Deathtouch until end of the turn.
        {1}: Morphling gets +1/-1 until the end of the turn.
        Sacrifice a creature: Draw a card, then discard a card.
        {T}: Destroy target creature with power 4 or greater.
    <TRIGGERED_ABILITY> | Open
    - On cards that grants an ability when a condition is met, eg.:
        When Captain of the Watch enters the battlefield, put three 1/1 white Soldier creature tokens onto the battlefield.
        Bloodied Ghost enters the battlefield with a -1/-1 counter on it.
        At the beginning of your upkeep, remove a -1/-1 counter from each creature you control.
        Whenever a creature enters the battlefield, untap all creatures.

2.6 CAPTAIN OF THE WATCH: STATIC ABILITY #1

    1ST <STATIC_ABILITY> | Open
    - Normally abilities like this; Vigilance, Indestructible, Deathtouch, Trample, First Strike, etc. are all generated by TFM's Online Card Generator.
    - So for this one, you're all set... =)
      Code: Select all
        <STATIC_ABILITY>
          <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Vigilance]]></LOCALISED_TEXT>
          <INTRINSIC characteristic="CHARACTERISTIC_VIGILANCE" />
        </STATIC_ABILITY>
2.7 CAPTAIN OF THE WATCH: STATIC ABILITY #2

    2ND <STATIC_ABILITY> | Open
    - Abilities that grants power toughness boost are normally entailed by a <FILTER></FILTER> block, then followed by a <CONTINUOUS_ACTION></CONTINUOUS_ACTION> block.
    - The <FILTER> block basically defines the cards that are affected by this ability. In this case, there are a few conditions: Other soldiers & you control.
    - As for CotW's 2nd <STATIC_ABILITY>, you'd be doing this:
      Code: Select all
        <STATIC_ABILITY>
          <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Other Soldier creatures you control get +1/+1 and have vigilance.]]></LOCALISED_TEXT>

          <FILTER filter_id="0">
          local filter = ClearFilter()
          filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource() )
          filter:Add( FE_SUBTYPE, OP_IS, CREATURE_TYPE_SOLDIER )
          filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
          filter:Add( FE_CONTROLLER, OP_IS, EffectController() )   
          </FILTER>

          <CONTINUOUS_ACTION layer="7C" filter_id="0">
          if FilteredCard() ~= nil then
             local characteristics = FilteredCard():GetCurrentCharacteristics()
             characteristics:Power_Add( 1 )
             characteristics:Toughness_Add( 1 )
          end
          </CONTINUOUS_ACTION>
          <CONTINUOUS_ACTION layer="8" filter_id="0">
          if FilteredCard() ~= nil then
             local characteristics = FilteredCard():GetCurrentCharacteristics()
             characteristics:Bool_Set( CHARACTERISTIC_VIGILANCE, 1 )
          end
          </CONTINUOUS_ACTION>
        </STATIC_ABILITY>
    - <FILTER filter_id="0"> you may have more than 1 filter at times. This <FILTER> block is defined as ID 0.
    - FE_CARD_INSTANCE cards that are affected, OP_NOT not, EffectSource() the card that is giving this ability - CotW.
    - FE_SUBTYPE card subtype, OP_IS is, CREATURE_TYPE_SOLDIER a Soldier.
    - FE_TYPE card type, OP_IS is, CARD_TYPE_CREATURE a creature.
    - FE_CONTROLLER these cards belongs to, OP_IS is, EffectController() the controller of CotW.
    - <CONTINUOUS_ACTION layer="7C" filter_id="0"> notice the filter_id="0", matching with <FILTER filter_id="0">? Whatever this <CONTINUOUS_ACTION> block gives only affects what has been defined in the <FILTER> block with the ID 0.
    - I do not really understand the designation of the "layers" but, normally power toughness boost goes under layer="7C".
    - if FilteredCard() ~= nil then, if FilteredCard() if what has been filtered in the <FILTER> block, ~= is not equals, nil none, then
    - local characteristics = FilteredCard():GetCurrentCharacteristics() local characteristics local variable/container named characteristics, FilteredCard():GetCurrentCharacteristics() getting the characteristics of other soldiers.
    - characteristics:Power_Add( 1 ),other Soldiers +1 power.
    - characteristics:Toughness_Add( 1 ), other Soldiers +1 toughness.
    - characteristics:Bool_Set( CHARACTERISTIC_VIGILANCE, 1 ) granting Vigilance to other Soldiers.

2.8 CAPTAIN OF THE WATCH: TRIGGERED ABILITY

    <TRIGGERED_ABILITY> | Open
    - Captain of the Watch's trigger:
      When Captain of the Watch enters the battlefield, put three 1/1 white Soldier creature tokens onto the battlefield.
    - You'd do this for trigger:
      Code: Select all
        <TRIGGERED_ABILITY>
          <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Captain of the Watch enters the battlefield, put three 1/1 white Soldier creature tokens onto the battlefield.]]></LOCALISED_TEXT>
          <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />

          <RESOLUTION_TIME_ACTION>
          MTG():PutTokensOntoBattlefield( "TOKEN_SOLDIER_1_1_W_333000014", 3, EffectController() )
          </RESOLUTION_TIME_ACTION>
        </TRIGGERED_ABILITY>
    - <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />, TRIGGER value="ZONECHANGE_END" when the zone changes (from where this card is from), simple_qualifier="self" this card, to_zone="ZONE_BATTLEFIELD" onto the battlefield.
    - <RESOLUTION_TIME_ACTION></RESOLUTION_TIME_ACTION> block means "What happens then?"
    - MTG():PutTokensOntoBattlefield( "TOKEN_SOLDIER_1_1_W_333000014", 3, EffectController() ), PutTokensOntoBattlefield putting tokens into the battlefield, TOKEN_SOLDIER_1_1_W_256000001 the token's card name, 3 quantity, EffectController() under whose control (in this case CotW's controller).

2.9 CAPTAIN OF THE WATCH: FINISHING THE CARD

    INFO | Open
    - Remember that cards that generates tokens, will need their tokens registered. If you forgot this, using this card would crash the game.
    - Add these two lines at the end of Captain of the Watch's XML, just before the </CARDV2> tag.
      Code: Select all
        <HELP title="MORE_INFO_BADGE_TITLE_13" body="MORE_INFO_BADGE_BODY_13" zone="ZONE_ANY" />
        <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" />
        <TOKEN_REGISTRATION reservation="1" type="TOKEN_SOLDIER_1_1_W_256000001" />
        <AI_BASE_SCORE score="900" zone="ZONE_BATTLEFIELD" />
      </CARD_V2>
    - <AI_BASE_SCORE score="900" zone="ZONE_BATTLEFIELD" /> how well will AI respond to this card in the defined zone. The higher the score, the higher the threat imposed to the AI. I'd go on this rule for cards with abilities (you may/may not use this guideline):
        Mythic Cards: 1200
        Rare Cards: 900
        Uncommon Cards: 600
        Common Cards: 300

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

3. NEW CARDS WITH RIIAKSHINAL'S DECK BUILDER

    RiiakShiNal's DotP 2014 Deck Builder is a very convenient tool when it comes to looking for card references.

3.1 IDENTIFYING A CARD


3.2 GETTING CARD STRUCTURE

    INFO | Open
    - Next we obtain Endless Wurm's card structure from TFM's Online Card Generator: TFM'S ONLINE CARD GENERATOR LINK.
    - Fill in the necessary fields. For this example, we'll still be using 256 as our Block ID; so at the card generator, do this:
    Image
    - You'd be prompted to save ENDLESS_WURM_256008820.XML. Save it in the CARDS folder under the DATA_DLC_DECK_BUILDER_CUSTOM folder in your DOTP2014 game directory.

3.3 RECOGNIZING CARD STRUCTURE

    INFO | Open
    - "Right-click" on the XML file, "Open With", "Notepad"...
    Image
    - Endless Wurm has 2 abilities:
        1. <STATIC_ABILITY>
        2. <TRIGGERED_ABILITY>
    - There are 2 blocks we'll be working on.

3.4 ENDLESS WURM: STATIC ABILITY

    1ST <STATIC_ABILITY> | Open
    - Just like Captain of the Watch's Vigilance, for this one, you're all set as well... =)
      Code: Select all
        <STATIC_ABILITY>
          <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Trample]]></LOCALISED_TEXT>
          <INTRINSIC characteristic="CHARACTERISTIC_TRAMPLE" />
        </STATIC_ABILITY>
3.5 ENDLESS WURM: TRIGGERED ABILITY

    INFO | Open
    - Remember the thing about triggers, there are two sides to them: a condition and an action. Let's look at Endless Wurm's trigger again:
    - At the beginning of your upkeep, sacrifice Endless Wurm unless you sacrifice an enchantment.
    - CONDITION: At the beginning of your upkeep
    - ACTION: sacrifice Endless Wurm unless you sacrifice an enchantment
    - Run RiiakShiNal's DotP 2014 Deck Builder...
    - Click on "Set Filter"...
    Image
    - Focus on the "Check Abilities" section...
    Image
    - Chances of finding what you want is slimmer if you go for the full phrase. Let's be a little more patient and take it a step at a time. Type in "at the beginning of" like this:
    Image
    - Then click "Apply", and the it will filter ALL CARDS that meets the trigger "at the beginning of". Remember that the more mods you have downloaded, the better the results will be.
    - To make this tutorial user-friendly, bearing in mind that the mods I have may not be similar to what you have, let's focus on results with "Official Cards" instead.
    - Click on "Wad" once, and it'll group the results according to their WADs, in ascending or descending order.
    Image
    - Scroll down the list until you see "DATA_DECKS_D14", these are official cards.
    Image
    - Let's look at "Jinxed Idol", right click on the entry, and then click on "View Card". You will then see its XML in the pop-up window.
    - Highlight and copy the Jinxed Idol's trigger (use your mouse to make the selection, then press Ctrl+C)
    Image
    - Paste the trigger onto Endless Wurm's trigger:
    Image
    - Moving on, repeat from where you clicked "Set Filter"... Focusing still on the Abilities section, type in "your upkeep, sacrifice"...
    - You'd notice this time, the result with DATA_DECKS_D14 returned is limited: Xathrid Demon, which is not what you're looking for best suited for Endless Wurm.
    - I want you now to get references from cards by other modders. If you've downloaded my Core which is LOCATED HERE, from the search results, look for "DATA_DLC_JAC", then look for "Masticore".
    - Right click on Masticore's entry, View Card, and then copy the "RESOLUTION_TIME_ACTION" part like this:
    Image
    - And then paste it onto Endless Wurm like this:
    Image
    - Update the necessary areas like this... Those highlighted in blue, to those in yellow:
    Image
    Image
    - So what you just did was:
        1. At the beginning of the controller of Endless Wurm upkeep, it checks if he/she has any enchantment on the battlefield.
        2. If the number of enchantments on the battlefield (derived from filter:Count()) is more than 0 (meaning there's at least 1 to pay for Endless Wurm's upkeep), then Endless Wurm will create a Multiple Choice Menu for its controller: to pay Endless Wurm's Upkeep, or to sacrifice Endless Wurm.
        3. If there are no enchantments controlled by Endless Wurm's controller at the beginning of his/her upkeep, Endless Wurm automatically gets sacrificed.
    - Now that you've created a "Preliminary Check" and a "Menu", next you'll need an action (another <RESOLUTION_TIME_ACTION> block). Type this:
    Image
    - What you just did back there:
        1. You obtained the controller's response to the menu from effectController:GetMultipleChoiceResult()
        2. Then you check what response was it, was it the 1st option to pay upkeep, or was it the 2nd to sacrifice it from if result == 0 then
        3. If it was the 1st option (starts with result == 0), then you allowed the controller to choose which enchantment he/she controls to sacrifice (in the event he/she controls more than 1 enchantment, safer)
        4. And you saved the controller's choice of which enchantment to sacrifice using EffectDC():Make_Targets(1). The number assigned to Make_Targets must be the same as the number used for Get_Targets() later, in this case Get_Targets(1).
        5. If the 2nd option was chosen, Endless Wurm is sacrificed.
    - Then you need another action for the enchantment that was chosen, it needs to be sacrificed in order for Endless Wurm's upkeep condition to be fulfilled. So, you'll need yet another <RESOLUTION_TIME_ACTION> block. Type this:
    Image
    - Lastly, what you just did:
        1. You retrieved the target enchantment to be sacrificed using EffectDC():Get_Targets(1):Get_CardPtr(0).
        2. Then the enchantment is sacrificed through this: EffectController():Sacrifice(enchantment)

3.6 ENDLESS WURM: FINISHING THE CARD

    INFO | Open
    - As we're about to be done with the card, add in this line right at the bottom, before the </CARD_V2> tag
    - <AI_BASE_SCORE score="900" zone="ZONE_BATTLEFIELD" />
    - That's about it... You've got a functioning Endless Wurm (I know cause I've tested it hehehe...)

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

[ - BACK TO TOP ]
Last edited by jacque on 06 Feb 2014, 08:41, edited 23 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 Advance ] Coding Your Cards...

Postby jacque » 13 Oct 2013, 11:25

THE ARTISTE: DEALING WITH ARTWORK



1. ARTWORK POOL

    You'll need to have a source where you can get High Quality images of the cards you are working on. I get very upset whenever I come across card artworks that are unclear or blurry.

1.1 SOURCES

    MAGICVILLE | Open
    - If you have been following this tutorial, after generating Captain of the Watch's card structure with TFM's Online Card Generator, you should be able to see this:
    Image
    - Click on MagicVille (somehow the link is broken, CLICK HERE instead. Usually it works though.)
    - Save the best picture.
    MEDIAFIRE | Open
    - This is where I get my Artworks from. It's someone's private folder on Mediafire.
    - Click on HERE.
    - Download "M13 Magic 2013 Fulls.zip" under "Advanced Level Core Sets".
    - Look for Captain of the Watch.

2. CROPPING STENCIL

    Card artworks are best displayed in game based on 512 x 376 Px (pixels) PNGs converted into TDXs. It also irritates me to see card artworks that are distorted, not resized proportionly.

2.1 DIFFERENT SETS, DIFFERENT DIMENSIONS

    INFO | Open
    - You should realize by now that the dimensions for card artwork has evolved over the years. As you would be getting your artwork from various sources, you will need to resize them (most of the time you do) so that they appear "nicely" on the cards that you have just made.
    STENCIL DOWNLOAD | Open
    - For the benefit of others who are not as vain as I am, you can download the crop stencil I made from THIS LINK.
    - You may have already noticed that the stencil's dimension is a tad smaller 422 x 310 Px instead of 512 x 376 DPI. Don't sweat. The reason for this is because I am using card artwork from card scans from the second source that I have provided under 1.1 SOURCES.
    - As I was saying, card artwork scans from Limited Edition Alpha right until Scourge has a slightly taller and narrower dimension, compared to the later sets. Therefore, you will probably need resizing card artworks from these sets. Those thereafter normally you can just drag and drop the stencil over.
    USING THE STENCIL | Open
    - I'll be using Adobe Photoshop as the referencing Graphic Editing Software in this tutorial. *the crop stencil is a *.PSD file, so yea...*
    - Open the crop stencil and any card artwork side by side (referring to the MEDIAFIRE card scans) and I'm assuming that you'd have some prior knowledge using Adobe Photoshop *sorry*.
    Image
    - Drag and drop the stencil onto the card scan. Adjust the stencil over the card until you get as much the card artwork as possible.
    Image
    - Have the stencil layer selected, then click on the Magic Wand Tool (shortcut key: W), and then click on the artwork area. A selection of the artwork would be made like this:
    Image
    Image
    - Under the "Layers" panel, click on Background layer (the card scan), then copy the selection (press Ctrl + C).
    Image
    - Go to the menu, click on "File", then "New" (shortcut key: Ctrl + N). You'll see this pop-up window. Don't ask why, but I love working on 600DPI. You'd notice the size of the selection is smaller (422 x 310 Px).
    Image
    - Paste the selection in (shortcut key: Ctrl + V).
    Image
    - Now we have to resize it... Click on "Image" on the menu bar, then "Image Size" (shortcut key: Ctrl + Alt + I).
    Image
    - Key in "512" under for width, and you'd realize 422 x 310 will be resized to 512 x 376 (that's what we want).
    Image
    - Save it, click on "File" on the menu bar, click "Save As".
    Image
    - Select "PNG" under the pull-down list under "Format". Since we worked on Endless Wurm, recollect its prefix+multiverse ID, and use it as the file name: 256008820.PNG
    Image
    Image
    - You will be prompted: PNG OPTIONS and you'd get a selection of None or Interlaced... Choose None. Interlaced is for images that you want to preserve the transparency of it.

3. CONVERSION

    Now you'll need to convert the PNG file(s) into TDX file(s) respectively so that both the deck builder and DotP2014 could recognize the artwork for the corresponding card(s).

    INFO | Open
    - You'd notice that Gibbed Tools has also included a TDXConverter named: Gibbed.Duels.TdxConvert, which we ARE NOT going to use that, it doesn't compress your PNGs.

4. CONVERSION & COMPRESSION USING RSN'S CONVERTER

    We would want the card artwork size to be as small as possible, at the same time maintaining its clarity as well.

    CONVERTER USAGE | Open
    - To get the compressed card artwork, drag and drop 256008820.PNG onto RSNTDXConverter.bat and your TDX will be generated: 256008820.TDX.
    - Copy the TDX file and paste it into the ILLUSTRATIONS folder under ART_ASSETS.
    - DATA_DLC_DECK_BUILDER_CUSTOM > DATA_ALL_PLATFORMS > ART_ASSETS > ILLUSTRATIONS
    OTHER CONVERTERS | Open
    - There are different level of conversion. You can read about them and they are LOCATED HERE.

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

[ - BACK TO TOP ]
Last edited by jacque on 17 Oct 2013, 05:03, edited 14 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 Advance ] Coding Your Cards...

Postby jacque » 13 Oct 2013, 11:25

SHARING YOUR WORK

    Give yourself a pat on your back for making it this far. You're only a few steps away then you're "officially" done...


1. CREATING YOUR OWN CORE

    Sharing is caring. We learn faster, when there are others who are willing to take time and share their knowledge. I guess that's what communities are for.

1.1 REFRESH DECK BUILDER CARD POOL

    INFO | Open
    - The card(s) that you've just coded will not be updated and appear automatically in the deck builder (if you have the deck builder open when you were working on your cards.
    - Click on "Tools" on the deck builder's menu bar, then click on "Refresh Data".
    Image

1.2 CREATING THE CORE

    INFO | Open
    - Click on "Tools" on the deck builder's menu bar, then click on "Create Core Wad from Custom Data ...".
    Image
    - Save it as DATA_DLC_<anything_you_want_here>.
    - "Refresh Data" again, you'll be able to see the cards in your Core showing up in the deck builder now.

1.3 SHARING THE CORE

    | Open
    - There are many ways you can share your Core. You can be using Google Drive like me, you can also upload it to a free online hoster eg. MediaFire, FileFront, etc.

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

[ - BACK TO TOP ]
Last edited by jacque on 15 Oct 2013, 02:42, edited 4 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 Advance ] Coding Your Cards...

Postby jacque » 13 Oct 2013, 11:25

USEFUL LINKS

    Some good references that may come in handy...


1. XML TAGS


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

2. LOL CONTENTS - CRITERIAS, ETC.


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

3. FUNCTIONS


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

[ - BACK TO TOP ]
Last edited by jacque on 14 Oct 2013, 04:13, edited 2 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 ADVANCE ] Coding Your Cards...

Postby RiiakShiNal » 13 Oct 2013, 13:37

Wouldn't this be easier to write on the Wiki as it will keep track of the table of contents automatically and you shouldn't need to worry about post size limits.

I don't know if you can do spoilers on the wiki, but horizontal lines, headers, bolding, images, code blocks, etc... can all be done (though the way you do the formatting is somewhat different, the wiki doesn't use BBCode).
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: [ TUTORIAL ADVANCE ] Coding Your Cards...

Postby jacque » 14 Oct 2013, 04:17

Prob is Riiak, I am used to this, and not familiar at all with Wiki... =(

The tutorial is now complete... Hope I've covered enough areas...
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 ADVANCE ] Coding Your Cards...

Postby RiiakShiNal » 14 Oct 2013, 12:32

With compressing artwork, the 2 main compression modes that should be used are DXT1 and DXT5.

DXT1 offers the best compression, but does not support transparency. This is what we use for card images as card images do not need or use transparency. At 512x376 compressed with DXT1 you should get 126 KB every time.

DXT5 offers good compression with full transparency support. This is used for AI Personality images (other than the full image) and Deck Box images as they all have variable alpha in the images. A deck box image at the standard 512x512 compressed with DXT5 should come up to about 257 KB.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: [ TUTORIAL ADVANCE ] Coding Your Cards...

Postby jacque » 14 Oct 2013, 16:14

RiiakShiNal wrote:With compressing artwork, the 2 main compression modes that should be used are DXT1 and DXT5.

DXT1 offers the best compression, but does not support transparency. This is what we use for card images as card images do not need or use transparency. At 512x376 compressed with DXT1 you should get 126 KB every time.

DXT5 offers good compression with full transparency support. This is used for AI Personality images (other than the full image) and Deck Box images as they all have variable alpha in the images. A deck box image at the standard 512x512 compressed with DXT5 should come up to about 257 KB.
Aaa... now I understanddd... =) Thanks again... updated the tutorial as well... Thanks Riiak!!! =)
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 ADVANCE ] Coding Your Cards...

Postby jacque » 16 Oct 2013, 23:25

I might add a section: "Troubleshooting" when I have the time later...

Please gimme your feedback on this... If it has been helpful, not, improvements, etc...
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 ADVANCE ] Coding Your Cards...

Postby BloodReyvyn » 11 Feb 2014, 10:24

Wow, awesome tutorial. Obviously, I can code cards, but this would have made awesome reading when I first started. Thanks a million. :)
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
User avatar
BloodReyvyn
 
Posts: 421
Joined: 19 May 2013, 13:29
Has thanked: 53 times
Been thanked: 40 times

Re: [ TUTORIAL ADVANCE ] Coding Your Cards...

Postby braquio » 18 Feb 2014, 18:17

Hi!
I'm starting coding cards, and this tutorial is great!!
i coded my first card: Goblin Bombardment
Works perfectly but i only have 1 problem, when i use dxt1 or dxt5 converters didnt work, i dont know why, im used the gibbed converter and its ok with the only problem of the size of the image. .tdx size is 753kb
____________________________________________________________________________________________________________________________
Braquio Dotp2014 DLC
Alternative Sealed Campaigns for DotP 2014
User avatar
braquio
 
Posts: 143
Joined: 16 Feb 2014, 19:21
Has thanked: 15 times
Been thanked: 9 times

Next

Return to New MTG Cards and Decks (2010, 2012, 2013, 2014, 2015, Magic Duels)

Who is online

Users browsing this forum: No registered users and 14 guests


Who is online

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

Login Form