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

Was wondering if I could get help with programing cards

Moderator: CCGHQ Admins

Was wondering if I could get help with programing cards

Postby xxd34thx » 10 Nov 2013, 11:23

Hello there, I know I am new and may be asking too much for a noobie. I was wondering if someone could help me program cards for magic the gathering duels of the planeswalkers 2014 for pc. I have all the tools required but my game either freezes when I use the custom cards or the game skips over them meaning when I go to the custom deck I have made my card is not in the main deck or pool any help would be appreciated thank you for your time and have a nice day.
User avatar
xxd34thx
 
Posts: 17
Joined: 08 Nov 2013, 18:41
Has thanked: 0 time
Been thanked: 0 time

Re: Was wondering if I could get help with programing cards

Postby thefiremind » 10 Nov 2013, 12:06

I think I couldn't explain it any better than how jacque did in these 2 tutorials:
viewtopic.php?f=64&t=11752
viewtopic.php?f=64&t=12167
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Was wondering if I could get help with programing cards

Postby xxd34thx » 13 Nov 2013, 00:45

Also looking for someone that can help out with the suspend ability. Is it static or activated? How do I add time counters without making them +1/+1 counters? Also how can I change all my instants sorceries to give them suspend upon their removal from the field. Like that malstorm card from 2013 through a perminents effect?
User avatar
xxd34thx
 
Posts: 17
Joined: 08 Nov 2013, 18:41
Has thanked: 0 time
Been thanked: 0 time

Re: Was wondering if I could get help with programing cards

Postby MC Brodie » 13 Nov 2013, 01:49

Suspend is probably one of the more complicated abilities to code in DotP. I'm not sure if jaque explained it in those tutorials but one of the most helpful things when modding is seeing how other people have coded cards. If you haven't yet, download Riiak's deckbuilder then download a bunch of the card wads on the forums. Off the top of my head, thefiremind and sumomole have both coded suspend cards so I suggest checking them out.

As to your specific questions, to add a time counter you have to first define what a time counter is:
Code: Select all
<COUNTER_REGISTRATION name="Time" proliferate="11" />
then to add time counters, you can use something like:
Code: Select all
EffectSource():AddCounters( MTG():GetCountersType("Time"), 3 )
I'm not quite clear on your 2nd question. Do you want all instants and your sorceries in your graveyard to have "Suspend X"? Or do you want to be able to suspend any instant or sorcery as it enters your graveyard? If the answer is the former you would grant an activated to instants and sorceries in your graveyard to be able to "cast" suspend. If the answer is the latter then you would use a triggered ability that would ask you if you'd like to suspend this card as it is put into the graveyard.

Whichever you choose, I'd still stress downloading thefiremind's and sumomole's cards and looking at how they did suspend. That will probabyl answer most if not all of your questions.
-----------------------------------------------------------------------
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: Was wondering if I could get help with programing cards

Postby thefiremind » 13 Nov 2013, 09:50

xxd34thx wrote:Is it static or activated?
If we could code it properly it would translate to a UTILITY_ABILITY that gives an alternate casting cost, but since the game freezes if you exile the card while trying to cast it, it must be coded as an activated ability.

xxd34thx wrote:how can I change all my instants sorceries to give them suspend upon their removal from the field.
This confuses me... instants and sorceries never enter the battlefield, so either you make instants and sorceries gain suspend after resolving, or you make permanents gain suspend after dying. If you are interested in instants/sorceries you can see how I coded Arc Blade, while if you are interested in permanents you can see how I coded Epochrasite. The difference is that you want another card to grant suspend to those cards, so you might need to take a look at my Jhoira of the Ghitu as well.

You haven't chosen something very easy to begin with... :wink:
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: Was wondering if I could get help with programing cards

Postby xxd34thx » 13 Nov 2013, 17:02

I just like the concept of a time traveler deck my friend called it. He was using it in casual play in real life and wanted to recreate that deck. A lot of his cards gained suspend upon leaving the field or resolving. I know that instants and sorceries dont enter the battlefield but I didnt know how else to explain it in a way that others could be sure what I was talking about. My second question is about making an enchantment give all cards suspend upon entering the graveyard kind of like Maelstrom Nexus sorry to confuse yall I a lot of the time I am not sure how my mind even works. Thank you all for the help and I appreciate you guys putting up with my lack of understanding when it comes to coding these cards. I know there was a tutorial but my question is after you code the cards how do you link the card art to the card. I have converted my card art to tdx format and my card image still does not appear even though I put it in the images folder of the deck editor. Can anyone help?
User avatar
xxd34thx
 
Posts: 17
Joined: 08 Nov 2013, 18:41
Has thanked: 0 time
Been thanked: 0 time

Re: Was wondering if I could get help with programing cards

Postby xxd34thx » 13 Nov 2013, 17:08

I have followed coding for undying on another tutorial and when I run the game with my card the game crashes upon opening the deck up here is my code for the card.

<?xml version="1.0"?>
<CARD_V2 ExportVersion="1">
<FILENAME text="FIENDLIKE_DEMON_1000000" />
<CARDNAME text="FIENDLIKE_DEMON" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[Fiendlike Demon]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000000" />
<ARTID value="1000000" />
<ARTIST name="xxd34thx" />
<CASTING_COST cost="{1}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[“The hunger grows everyday as death smiles upon me.”
—xxd34thx]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Demon" />
<EXPANSION value="DPI" />
<RARITY metaname="R" />
<POWER value="10" />
<TOUGHNESS value="10" />
<TRIGGERED_ABILITY badge="BADGE_UNDYING" active_zone="ZONE_BATTLEFIELD">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Undying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Undying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Undying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Undying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Undying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Undying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Undying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Undying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Undying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[Undying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[Undying]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="self" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIELD" />
<INTERVENING_IF ignore_resolution_check="1">
return TriggerObject():CountCounters( MTG():PlusOnePlusOneCounters() ) == 0
</INTERVENING_IF>
<RESOLUTION_TIME_ACTION>
if TriggerObject() ~= nil then
TriggerObject():PutOntoBattlefield( TriggerObject():GetOwner() )
TriggerObject():AddCounters( MTG():PlusOnePlusOneCounters(), 1 )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Fiendlike Demon enters the battlefield, you may search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library.]]></LOCALISED_TEXT>

<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
local effectController = EffectController()
filter:Add( FE_SUPERTYPE, OP_IS, SUPERTYPE_BASIC )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_LAND )
filter:SetZone( ZONE_LIBRARY, effectController )
effectController:ChooseItem( "CARD_QUERY_CHOOSE_LAND_TO_PUT_ONTO_THE_BATTLEFIELD_TAPPED", EffectDC():Make_Targets(0) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
target:PutOntoBattlefieldTapped( EffectController() )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
EffectController():ShuffleLibrary()
</RESOLUTION_TIME_ACTION>
<MAY />
</TRIGGERED_ABILITY>
<HELP title="MORE_INFO_BADGE_TITLE_34" body="MORE_INFO_BADGE_BODY_34" zone="ZONE_ANY" />
<SFX text="COMBAT_PLASMA_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_PLASMA_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
<AI_BASE_SCORE score="300" zone="ZONE_HAND" />
</CARD_V2>
Last edited by xxd34thx on 13 Nov 2013, 17:35, edited 1 time in total.
User avatar
xxd34thx
 
Posts: 17
Joined: 08 Nov 2013, 18:41
Has thanked: 0 time
Been thanked: 0 time

Re: Was wondering if I could get help with programing cards

Postby xxd34thx » 13 Nov 2013, 17:10

I know the power and toughness are high I was making a better version of the final bosses deck.
User avatar
xxd34thx
 
Posts: 17
Joined: 08 Nov 2013, 18:41
Has thanked: 0 time
Been thanked: 0 time

Re: Was wondering if I could get help with programing cards

Postby MC Brodie » 13 Nov 2013, 23:42

No worries. We are just trying to figure out what you mean as well. Do you mean an ability like this (or a variation of this):

"Whenever an instant or sorcery is put into the graveyard, the owner may choose to exile that card. If a card is exiled this way put four time counters on it and if the exiled card doesn't have suspend, it gains suspend".

Or are you referring to something like Knowledge Pool but adapted to suspend the cards?

As for your art problems, I can think of a few things that could be causing that. Most of these are solved by using the TDXConvert that comes with Rick's .dll but I'll list them anyway incase you are generating TDX files a different way. Some may be simple but it is good to check:
- Does the art ID in creature XML match the .TDX filename?
- Is your TDX file in the correct folder (\\DATA_ALL_PLATFORMS\ART_ASSETS\ILLUSTRATIONS)
- Is the TDX in your filename extension capitalized?
- Does your card have dimensions that are a multiple of 4 (needed in order for the game to read them)?
- A good resource for creating card art is this thread. Although it was created for an older version of DotP, the majority of the principles are the same.

As for your Fiendlike Demon, I don't see anything wrong with it from a quick glance. I'd suggest putting any future code in a code block. That way it maintains the indentation and doesn't take up the whole screen. Since it will be easier to look people will be more willing to help out. For issues like this refer to this page on the wiki as a first step. I'm guessing you didn't save the xml with UTF-8 encoding and this is causing the game to crash since it can't find your card. This is just a guess though.
-----------------------------------------------------------------------
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: Was wondering if I could get help with programing cards

Postby RiiakShiNal » 14 Nov 2013, 02:32

xxd34thx wrote:I just like the concept of a time traveler deck my friend called it. He was using it in casual play in real life and wanted to recreate that deck. A lot of his cards gained suspend upon leaving the field or resolving. I know that instants and sorceries dont enter the battlefield but I didnt know how else to explain it in a way that others could be sure what I was talking about. My second question is about making an enchantment give all cards suspend upon entering the graveyard kind of like Maelstrom Nexus sorry to confuse yall I a lot of the time I am not sure how my mind even works.
Since you said your friend was using that concept in a deck IRL then I assume he was using real cards in which case knowing the cards that you are trying to code abilities for would be helpful as without the exact text of the card it is difficult to determine exactly what is needed. Even small differences in wording can make a big difference.

As for your "Fiendlike Demon", I'm not seeing any XML syntax errors (though the code is extremely difficult to read as it is not in a [code] block). Is your filename "FIENDLIKE_DEMON_1000000.XML"? If not then than would explain why the game is crashing. If it is then are you sure the XML is in the correct folder, "DATA_ALL_PLATFORMs\CARDS", of a valid wad with a valid header (or directory set up as a wad with a valid HEADER.XML)?
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: Was wondering if I could get help with programing cards

Postby xxd34thx » 21 Nov 2013, 16:29

cards like riftwing cloudskate, arc blade, Aeon Chronicler,jhoria's Timebug,Reality Strobe and "Whenever an instant or sorcery is put into the graveyard, the owner may choose to exile that card. If a card is exiled this way put four time counters on it and if the exiled card doesn't have suspend, it gains suspend". is pertty much what I am looking for and my card name is exactly what is Fiendlike_Demon_1000000.xml also I dont know how to post code up in the boxes like you guys do I appoligize in advanced for being a noob
User avatar
xxd34thx
 
Posts: 17
Joined: 08 Nov 2013, 18:41
Has thanked: 0 time
Been thanked: 0 time

Re: Was wondering if I could get help with programing cards

Postby xxd34thx » 21 Nov 2013, 16:36

Im new to the deck editor how do you convert files to tdx also what are the dimensions I can use for a tdx is there a program like paint where I can crop images once they are tdx? I got the step by step tutorial but am still having issues getting my cards to run in the game. Not sure if its a coding flaw or what... I only have fiendlike demon as of right now, I want to make a new subtype or new ability where time counters are put on creatures while they survive on the field then after certain turns they "evolve" could anyone help me with that?
User avatar
xxd34thx
 
Posts: 17
Joined: 08 Nov 2013, 18:41
Has thanked: 0 time
Been thanked: 0 time

Re: Was wondering if I could get help with programing cards

Postby RiiakShiNal » 21 Nov 2013, 20:37

xxd34thx wrote:cards like Riftwing Cloudskate, Arc Blade, Aeon Chronicler, Jhoria's Timebug, Reality Strobe
These cards have Suspend, they do not give suspend to other cards. Some may have already been coded by either thefiremind or by sumomole as they are the two modders who have worked the most with the Suspend mechanic.

xxd34thx wrote:"Whenever an instant or sorcery is put into the graveyard, the owner may choose to exile that card. If a card is exiled this way put four time counters on it and if the exiled card doesn't have suspend, it gains suspend".
There is no card that has this so it is highly unlikely that your friend was using this in his deck. That being said I see no reason why this ability couldn't be coded on a Permanent. You would first need to figure out which implementation of the Suspend mechanic (sumomole's of thefiremind's) you want to use first and then work from there.

This is definitely a step in the right direction though as you now have provided exact wording that you want, though there is still the matter of how to code it because coding it for a permanent will differ from that of coding it for an Instant or Sorcery.

xxd34thx wrote:is pertty much what I am looking for and my card name is exactly what is Fiendlike_Demon_1000000.xml
The reason I thought of asking the file name is because if you use the card in a deck then the file name must match in 3 places (actual file name, FILENAME tag, and CARD name in the deck) or the game won't be able to find the card and will cause a crash. It is one of the easiest places to make a mistake and get a crash, though since you say it matches then your crash problem is elsewhere.

xxd34thx wrote:also I dont know how to post code up in the boxes like you guys do
As for posting code, it's pretty easy. You can either click the "Code" button above the text entry box when composing a post in the "Post a reply" screen or you can manually post the code by typing [code]This text will be in the code box.[/code] Which displays like this:
Code: Select all
This text will be in the code box.
xxd34thx wrote:Im new to the deck editor how do you convert files to tdx also what are the dimensions I can use for a tdx is there a program like paint where I can crop images once they are tdx?
As far as I know there is no "Deck Editor" for DotP 2014. I made a Deck Builder, but it does no editing.

TDX files are created using Gibbed Tools TdxConvert (Gibbed.Duels.TdxConvert.exe), you can either simply drag an image file onto the TdxConvert program to create uncompressed TDX files or if you are using my modified version of the tools you can use the command line parameters --dxt1 or --dxt5 to create compressed TDX files. For uncompressed TDX you can use images of any dimension, for compressed TDX you will want to stick to dimensions in multiples of 4 (standard for card images is 512x376 compressed with DXT1 which has a files size of 126 KB).

You can't crop images once they are TDX, but you can convert them back to PNG do any cropping you need using just about any image editor save then convert back to TDX.

xxd34thx wrote:I got the step by step tutorial but am still having issues getting my cards to run in the game. Not sure if its a coding flaw or what... I only have fiendlike demon as of right now
Which is why posting and asking for help is usually the fastest way to get help, but we need detailed information to figure out exactly what the problem is and how to fix it. Honestly, I don't think the problem is with your encoding as the code you posted previously doesn't have any characters in it that should pose a problem if saved in ASCII versus the appropriate UTF-8.

xxd34thx wrote:I want to make a new subtype or new ability where time counters are put on creatures while they survive on the field then after certain turns they "evolve" could anyone help me with that?
Making a new sub-type currently has several problems linked to it including:
  • Needing to change several files including: SPECS\CREATURE_TYPES.TXT (to actually define the type), a TEXT_PERMANENT file with the text to display for the type, a LOL file with the constant to define for the type so that code can refer to it.
  • It will conflict with all mods that add a new type.
Also sub-types do not convey abilities they are merely data which can be used by abilities (they do nothing on their own).

An ability would be much easier in this case (and a lot more compatible) though the exact details of how to code it will still vary on what card it is put on and exactly how it is worded. For example if the time counters are added at end of turn then the TRIGGER would test for STEP_END_OF_TURN, but if it says at the beginning of your upkeep the TRIGGER would test for STEP_UPKEEP also whether it only happens during your turn(s) or during all players turns will vary as well as what to actually do when the creature "evolves" (in quotes as it is separate from the Evolve keyword).

On a side note, rather than posting several consecutive posts you could just edit your previous post as this will help keep the forum clean and easy to read as well. Double- and/or Multi-posting is generally considered bad form if not much time has passed (exceptions are generally accepted when considerable time has passed such as a day or more).
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 24 guests


Who is online

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

Login Form