It is currently 27 Apr 2024, 15:17
   
Text Size

Report cards error here

Moderator: CCGHQ Admins

Re: Report cards error here

Postby infernalsham » 07 Jul 2013, 21:53

My Boros Charm keeps giving me minidumps/crash the game whenever I try to start a game to playtest it. Had to mess with the code to try and solve a bug that made the second option trigger when the third option was chosen. Can anyone please point out where my mistake is?

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="BOROS_CHARM_366435" />
  <CARDNAME text="BOROS_CHARM" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Boros Charm]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="366435" />
  <ARTID value="A366435" />
  <ARTIST name="Zoltan Boros" />
  <CASTING_COST cost="{R}{W}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Practice compassion and mercy. But know when they must end.”
—Aurelia]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Instant" />
  <EXPANSION value="GTC" />
  <RARITY metaname="U" />
  <SPELL_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose one — Boros Charm deals 4 damage to target player; or permanents you control are indestructible this turn; or target creature gains double strike until end of turn.]]></LOCALISED_TEXT>
    <SFX text="GLOBAL_MAGMA_PLAY" />
    <MODE_SELECT tag="MODE_CHOOSE_ONE">
      <MODE tag="MODE_BOROS_FLAME" index="1" />
      <MODE tag="MODE_BOROS_DEFENSE" index="2" />
      <MODE tag="MODE_BOROS_FURY" index="3" />
    </MODE_SELECT>
    <TARGET tag="CARD_QUERY_CHOOSE_PLAYER_DEAL_4_DAMAGE" definition="0" compartment="0" mode="1" count="1" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:SetFilterType( FILTER_TYPE_PLAYERS )
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION mode="1">
    local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
    if target_player ~= nil then
       EffectSourceLKI():DealDamageTo( 4, target_player )
    end
    </RESOLUTION_TIME_ACTION>
   <FILTER id="0">
   local filter = ClearFilter()
    filter:Add( FE_IS_PERMANENT, true )
    filter:Add( FE_CONTROLLER, OP_IS, EffectController())
   </FILTER>
    <CONTINUOUS_ACTION layer="6" mode="2" filter_id="0" >
    if FilteredCard() ~= nil then
       local characteristics = FilteredCard():GetCurrentCharacteristics()
       characteristics:Bool_Set( CHARACTERISTIC_INDESTRUCTIBLE, 1 )
    end
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
    <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_GAIN_DOUBLESTRIKE" definition="1" compartment="1" mode="3" count="1" />
    <TARGET_DEFINITION id="1">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    </TARGET_DEFINITION>
    <CONTINUOUS_ACTION layer="6" mode="3">
    local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
    if target ~= nil then
       local characteristics = target:GetCurrentCharacteristics()
       characteristics:Bool_Set( CHARACTERISTIC_DOUBLE_STRIKE, 1 )
    end
    </CONTINUOUS_ACTION>
    <DURATION simple_duration="UntilEOT" />
    <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
    <AI_SIMPLIFIED_TARGETING compartment="1" hint="HINT_ALLIED_ONLY" />
  </SPELL_ABILITY>
  </CARD_V2>
Want to speed up the loading of DotP Magic 2014 when you start it?
Go to: "C:\*\Magic 2014\Movies" and delete Alienware, Stainless and WotC .bik files.
infernalsham
 
Posts: 17
Joined: 27 Jun 2013, 15:54
Has thanked: 3 times
Been thanked: 1 time

Re: Report cards error here

Postby thefiremind » 07 Jul 2013, 22:10

I can't see anything wrong. Maybe you could leave just one DURATION block because I think that the game can't distinguish between the two (the order of blocks at the same "level" should be irrelevant) but I don't think that's the reason for the crash.

Have you checked that you still saved the file with UTF-8 encoding? Without Japanese/Korean/Russian characters, Notepad won't warn you, but the game won't be able to read other special characters (like the “graceful” quotes).
< 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: Report cards error here

Postby infernalsham » 07 Jul 2013, 22:30

thefiremind wrote:I can't see anything wrong. Maybe you could leave just one DURATION block because I think that the game can't distinguish between the two (the order of blocks at the same "level" should be irrelevant) but I don't think that's the reason for the crash.

Have you checked that you still saved the file with UTF-8 encoding? Without Japanese/Korean/Russian characters, Notepad won't warn you, but the game won't be able to read other special characters (like the “graceful” quotes).
Thought the "encoding='UTF-8'" part did that. Will try leaving one duration block.

Edit 2: got it to show up in deck manager again.
Last edited by infernalsham on 07 Jul 2013, 23:00, edited 2 times in total.
Want to speed up the loading of DotP Magic 2014 when you start it?
Go to: "C:\*\Magic 2014\Movies" and delete Alienware, Stainless and WotC .bik files.
infernalsham
 
Posts: 17
Joined: 27 Jun 2013, 15:54
Has thanked: 3 times
Been thanked: 1 time

Re: Report cards error here

Postby thefiremind » 07 Jul 2013, 22:33

infernalsham wrote:Thought the "encoding='UTF-8'" part did that.
No, that's nothing more than a comment. I added it in my generator because I thought it would have been helpful somehow, but it isn't.
< 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: Report cards error here

Postby infernalsham » 07 Jul 2013, 23:09

Redownloaded the xml pasted in the ability code and removed the extra duration block now everything works exactly as it should. Sigh. Thanks a lot for the help thefiremind.
Want to speed up the loading of DotP Magic 2014 when you start it?
Go to: "C:\*\Magic 2014\Movies" and delete Alienware, Stainless and WotC .bik files.
infernalsham
 
Posts: 17
Joined: 27 Jun 2013, 15:54
Has thanked: 3 times
Been thanked: 1 time

Re: Report cards error here

Postby RiiakShiNal » 07 Jul 2013, 23:54

thefiremind wrote:
infernalsham wrote:Thought the "encoding='UTF-8'" part did that.
No, that's nothing more than a comment. I added it in my generator because I thought it would have been helpful somehow, but it isn't.
Actually, it is more than a comment, it tells the XML parser to expect a specific encoding of data in the XML Document. Though, the file is still required to be saved in the appropriate format as thefiremind stated.

If you load a file directly into an XML parser then it will try to guess the encoding until it can read the encoding attribute then uses the encoding present there as the basis on how to read the file. For full information on how an XML parser determines the encoding there is Appendix F of the XML Standard.

From the W3C XML Standard section 4.3.3:
In the absence of information provided by an external transport protocol (e.g. HTTP or MIME), it is a fatal error for an entity including an encoding declaration to be presented to the XML processor in an encoding other than that named in the declaration, or for an entity which begins with neither a Byte Order Mark nor an encoding declaration to use an encoding other than UTF-8. Note that since ASCII is a subset of UTF-8, ordinary ASCII entities do not strictly need an encoding declaration.
Due to the definition here UTF-8 and ASCII do not need to have the encoding attribute specified, but the file does need to be saved properly to preserve the data. So it is more than just a "comment".
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Report cards error here

Postby thefiremind » 08 Jul 2013, 00:13

I should learn to weigh my words more carefully when you are around... :lol: just joking. :wink:
What I meant is that DotP doesn't really seem to care about the encoding declaration: without special characters it accepts both ANSI and UTF-8, otherwise only UTF-8, no matter what we specify at the beginning of the file. So, for what concerns DotP modding, we can treat it as a comment.
< 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: Report cards error here

Postby RiiakShiNal » 08 Jul 2013, 00:52

It also seems to accept UTF-16 with a BOM and no encoding attribute (originally I had not noticed that sumomole (and one or two other modders) used that for a few cards and that showed up as a bug in my Deck Builder on DotP 2013 :oops: ).

ANSI is a subset of UTF-8 and UTF-8 is the default encoding for XML so it doesn't strictly require the encoding attribute so it makes sense that neither of those is required to be specified. Though it did surprise me that it would accept UTF-16 without the encoding attribute.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Report cards error here

Postby GrovyleXShinyCelebi » 08 Jul 2013, 14:51

Alright, so I've decided to take a risk and code in a card with mechanics that are mostly not present in MTG 2014's cards:

The Rack

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="THE_RACK_109725" />
  <CARDNAME text="THE_RACK" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[The Rack]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Chevalet de torture]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El potro]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Streckbank]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La Griglia]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[拷問台]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[The Rack]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Дыба]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[O Ecúleo]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="109725" />
  <ARTID value="109725" />
  <ARTIST name="Richard Thomas" />
  <CASTING_COST cost="{1}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Invented in Mishra’s earlier days, the rack was once his most feared creation.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Inventé pendant la jeunesse de Mishra, le chevalet de torture fut alors sa création la plus redoutée.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El potro, inventado en los primeros días de Mishra, fue en tiempos su creación más temida.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Mishra erfand diese Streckbank in seinen jungen Jahren. Sie war einst seine gefürchtetste Schöpfung.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Inventato durante la giovinezza da Mishra, questo artefatto fu una delle sue invenzioni più temute.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[拷問台は若き日のミシュラが発明したもので、かつては彼の偉業の中でもっとも恐れられていた。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Invented in Mishra’s earlier days, the rack was once his most feared creation.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Дыба, изобретенная в ранние годы Мишры, когда-то была самым страшным его творением.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Inventado nos primórdios de Mishra, o ecúleo já foi sua criação mais temida.]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Artifact" />
  <EXPANSION value="TSB" />
  <RARITY metaname="S" />
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As The Rack enters the battlefield, choose an opponent.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au moment où le Chevalet de torture arrive en jeu, choisissez un adversaire.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[En cuanto El potro entre en juego, elige un oponente.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sowie die Streckbank ins Spiel kommt, bestimme einen Gegner.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mentre la Griglia entra nel campo di battaglia, scegli un avversario.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[拷問台が場に出るに際し、対戦相手を1人選ぶ。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As The Rack enters the battlefield, choose an opponent.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[При входе Дыбы в игру выберите оппонента. ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Conforme O Ecúleo entra em jogo, escolha um oponente]]></LOCALISED_TEXT>
  <TRIGGER value="COMES_INTO_PLAY" simple_qualifier="self" />
  <TARGET tag="CARD_QUERY_CHOOSE_PLAYER" definition="0" compartment="0" count="1" />
  <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:SetFilterType( FILTER_TYPE_PLAYERS )
  </TARGET_DEFINITION>
  <RESOLUTION_TIME_ACTION>
    local queryDC = ObjectDC():Make_Chest(1)
    local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
    if player ~= nil then
        queryDC:Set_PlayerPtr(1, player)
    end
  </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of the chosen player’s upkeep, The Rack deals X damage to that player, where X is 3 minus the number of cards in his or her hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de l’entretien du joueur choisi, le Chevalet de torture inflige X blessures à ce joueur, X étant 3 moins le nombre de cartes dans sa main.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al comienzo del mantenimiento del jugador elegido, El potro hace X puntos de daño a ese jugador, donde X es 3 menos la cantidad de cartas en su mano.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Zu Beginn des Versorgungssegments dieses Gegners fügt die Streckbank diesem Spieler X Schadenspunkte zu, wobei X gleich 3 minus der Anzahl an Karten auf seiner Hand ist.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del mantenimento del giocatore scelto, La Griglia infligge X danni a quel giocatore, dove X è 3 meno il numero di carte nella sua mano.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[選ばれたプレイヤーのアップキープの開始時に、拷問台はそのプレイヤーにX点のダメージを与える。Xは3からそのプレイヤーの手札のカードの枚数を引いた値に等しい。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of the chosen player’s upkeep, The Rack deals X damage to that player, where X is 3 minus the number of cards in his or her hand.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В начале шага поддержки выбранного игрока Дыба наносит Х повреждений этому игроку, где Х равен 3 минус количество карт в его или ее руке.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No início da manutenção do jogador escolhido, O Ecúleo causa X pontos de dano àquele jogador, sendo X igual a 3 menos o número de cards na mão dele.]]></LOCALISED_TEXT>
  <TRIGGER value="BEGINNING_OF_PLAYERS_STEP">
  return MTG():GetStep() == STEP_UPKEEP and TriggerPlayer() = MTG():ObjectDC():Get_PlayerPtr(1)
  </TRIGGER>
  <RESOLUTION_TIME_ACTION>
  local target = MTG():ObjectDC():Get_PlayerPtr(1)
  if target ~= nil then
     local number = target:Hand_Count()
       if ( EffectSourceLKI() ~= nil ) then   
       EffectSourceLKI():DealDamageTo( 8-number,  target )
    end
  end
  </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
</CARD_V2>
The problem, though, is that when I hit up RiiakShiNal's deck editor it doesn't even recognize the card, which means that there's at least one syntax error in there.

Can anyone with more experience help me troubleshoot this? Could it be something with the Object:DC(), cause I thought I read something somewhere that that function is null and void in DotP 2014...

Also, did anyone come up with what was wrong with my Erratic Portal code? I can bounce a creature but the "unless it's owner pays 1" trigger isn't working. It's still stumping me... I'll write it again here:

Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="ERRATIC_PORTAL_6163" />
  <CARDNAME text="ERRATIC_PORTAL" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Erratic Portal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Erratic Portal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Erratic Portal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Erratic Portal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Erratic Portal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Erratic Portal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Erratic Portal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Erratic Portal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Erratic Portal]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="6163" />
  <ARTID value="6163" />
  <ARTIST name="John Matson" />
  <CASTING_COST cost="{4}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“In Barrin’s name” cried Lyna as Hanna’s sword passed through her, “Ertai sends word that the portal is open—but not for long”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[“In Barrin’s name” cried Lyna as Hanna’s sword passed through her, “Ertai sends word that the portal is open—but not for long”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“In Barrin’s name” cried Lyna as Hanna’s sword passed through her, “Ertai sends word that the portal is open—but not for long”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[“In Barrin’s name” cried Lyna as Hanna’s sword passed through her, “Ertai sends word that the portal is open—but not for long”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“In Barrin’s name” cried Lyna as Hanna’s sword passed through her, “Ertai sends word that the portal is open—but not for long”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[“In Barrin’s name” cried Lyna as Hanna’s sword passed through her, “Ertai sends word that the portal is open—but not for long”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“In Barrin’s name” cried Lyna as Hanna’s sword passed through her, “Ertai sends word that the portal is open—but not for long”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“In Barrin’s name” cried Lyna as Hanna’s sword passed through her, “Ertai sends word that the portal is open—but not for long”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“In Barrin’s name” cried Lyna as Hanna’s sword passed through her, “Ertai sends word that the portal is open—but not for long”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <TYPE metaname="Artifact" />
  <EXPANSION value="EX" />
  <RARITY metaname="R" />
  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{1}, {T}: Il proprietario riprende in mano una creatura bersaglio a meno che il suo controllore paghi {1}.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{1}, {T}: Return target creature to its owner’s hand unless its controller pays {1}.]]></LOCALISED_TEXT>
  <COST mana_cost="{1}" type="Mana" />
  <COST type="TapSelf" />
  <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_PUT_INTO_HAND" definition="0" compartment="0" count="1" />
  <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
  </TARGET_DEFINITION>
  <RESOLUTION_TIME_ACTION id="0">
   local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
      local player = target:GetPlayer()
      if player ~= nil then
       if player:CanPayResourceCost(1) then
         player:BeginNewMultipleChoice()
         player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_YES" )
         player:AddMultipleChoiceAnswer( "UI_CONDITIONAL_QUESTION_NO" )
         player:AskMultipleChoiceQuestion( "OPTIONAL_ABILITY_QUESTION" )
       else
         target:PutInHand()
         end
       end
     end
  </RESOLUTION_TIME_ACTION>
  <RESOLUTION_TIME_ACTION id="0">
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
      if target ~= nil then
     local player = target:GetPlayer()
       if player ~= nil then
    local result = player:GetMultipleChoiceResult()
       if result == 0 then
        player:PayResourceCost(1)
       else
         target:PutInHand()
       end
     end
    end
  </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>
</CARD_V2>
Sorry, I'm still a noob at this stuff (I'm not even sure what type of language is this... is it LUA?)

Many thanks!
User avatar
GrovyleXShinyCelebi
 
Posts: 294
Joined: 12 Jun 2013, 18:23
Has thanked: 14 times
Been thanked: 37 times

Re: Report cards error here

Postby thefiremind » 08 Jul 2013, 15:43

GrovyleXShinyCelebi wrote:The problem, though, is that when I hit up RiiakShiNal's deck editor it doesn't even recognize the card, which means that there's at least one syntax error in there.
The only thing I can see is the rarity set to "S" which doesn't exist in DotP. Try to set it to something else... I think The Rack is rare outside the time-shifted cards.
I know that I could change the "S" rarity directly inside my generator, but either I change it to a fixed one, which I don't like, or I look at the rarities in the other expansions and choose the most recent one, which would become an enormous work just for a small amount of cards, so I'm just leaving it as it is. :mrgreen:

GrovyleXShinyCelebi wrote:Can anyone with more experience help me troubleshoot this? Could it be something with the Object:DC(), cause I thought I read something somewhere that that function is null and void in DotP 2014...
This is right, your card won't work like that. The substitute for ObjectDC is LinkedDC now. You need to add the tag linked_ability_group="1" to the abilities that use LinkedDC, then substitute all instances of ObjectDC with LinkedDC (and remove MTG(): before them, that wasn't there in DotP2013 either). I'm not sure if the card will work after that, but it will put you in the right direction. If you need an example, look at Fiend Hunter.

GrovyleXShinyCelebi wrote:Also, did anyone come up with what was wrong with my Erratic Portal code? I can bounce a creature but the "unless it's owner pays 1" trigger isn't working.
Wait a minute... now I see something. You are using a resource cost with ID 1, but you aren't declaring it anywhere. You are missing this ability:
Code: Select all
  <UTILITY_ABILITY resource_id="1">
    <COST mana_cost="{1}" type="Mana" />
  </UTILITY_ABILITY>
You are also missing the CanPayResourceCost check in the second RESOLUTION_TIME_ACTION: since you aren't asking the query when the player can't pay, you shouldn't check for the multiple choice result in the second RESOLUTION_TIME_ACTION when the player can't pay. Look at the official Mentor of the Meek for a good example.
You can also remove id="0" from the RESOLUTION_TIME_ACTIONs, they don't do any harm but they aren't needed there.

Sorry, I'm still a noob at this stuff (I'm not even sure what type of language is this... is it LUA?)
Yes, it's Lua (the "purists" of the language don't want it to be written all in capitals because it's not an acronym, I guess everyone has his own obsessions... :lol:).
< 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: Report cards error here

Postby GrovyleXShinyCelebi » 08 Jul 2013, 15:59

He, thanks! I'll try using them with your suggestions.

By the way, what does the id="0" do, exactly? I put that tag into all my Resolution_Time_Actions because sometimes if I don't put it in there the RTAs don't trigger (I recall it happened in the very first card I coded, I believe it was Bloodpyre Colossus), so I just throw it in there just in case.
User avatar
GrovyleXShinyCelebi
 
Posts: 294
Joined: 12 Jun 2013, 18:23
Has thanked: 14 times
Been thanked: 37 times

Re: Report cards error here

Postby thefiremind » 08 Jul 2013, 16:12

GrovyleXShinyCelebi wrote:By the way, what does the id="0" do, exactly? I put that tag into all my Resolution_Time_Actions because sometimes if I don't put it in there the RTAs don't trigger (I recall it happened in the very first card I coded, I believe it was Bloodpyre Colossus), so I just throw it in there just in case.
In a RESOLUTION_TIME_ACTION, nothing at all. The id is declared in the TARGET_DEFINITIONs so that the TARGET blocks know which definition they need. You are probably confusing it with filter_id which pairs action blocks with FILTER blocks, but you aren't using any of those here.
< 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: Report cards error here

Postby infernalsham » 08 Jul 2013, 16:28

Ash Zealot: I am getting it to trigger its passive. However, it does not deal any damage.

Ash Zealot | Open
Code: Select all
<TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever a player casts a spell from a graveyard, Ash Zealot deals 3 damage to that player.]]></LOCALISED_TEXT>
   <TRIGGER value="ZONECHANGE_END" to_zone="ZONE_ANY" from_zone="ZONE_GRAVEYARD" />
   return TriggerObject():GetCardType():Test(CARD_TYPE_INSTANT) or TriggerObject():GetCardType():Test(CARD_TYPE_SORCERY) or TriggerObject():GetCardType():Test(CARD_TYPE_CREATURE)   
   </TRIGGER>
   <RESOLUTION_TIME_ACTION>
   DealDamageTo( 3,  TriggerPlayer() )
   </RESOLUTION_TIME_ACTION>
   <SFX text="GLOBAL_MAGMA_PLAY" />
  </TRIGGERED_ABILITY>
Want to speed up the loading of DotP Magic 2014 when you start it?
Go to: "C:\*\Magic 2014\Movies" and delete Alienware, Stainless and WotC .bik files.
infernalsham
 
Posts: 17
Joined: 27 Jun 2013, 15:54
Has thanked: 3 times
Been thanked: 1 time

Re: Report cards error here

Postby thefiremind » 08 Jul 2013, 18:18

There are mainly 3 problems:
  1. You are closing the TRIGGER block twice: once with /> after "ZONE_GRAVEYARD" and once with </TRIGGER>. This is an XML structure error so I'm surprised if you could play with this card at all.
  2. DealDamageTo is a function that needs to be called from the source of the damage.
  3. You don't need a zone change trigger here, what you need is a SPELL_PLAYED trigger that checks where the spell was before going to the stack.
This should work:
Ash Zealot | Open
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever a player casts a spell from a graveyard, Ash Zealot deals 3 damage to that player.]]></LOCALISED_TEXT>
    <TRIGGER value="SPELL_PLAYED">
    return TriggerObject():GetErstwhileZone() == ZONE_GRAVEYARD
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    if TriggerPlayer() ~= nil then
       EffectSourceLKI():DealDamageTo( 3,  TriggerPlayer() )
    end
    </RESOLUTION_TIME_ACTION>
    <SFX text="GLOBAL_MAGMA_PLAY" />
  </TRIGGERED_ABILITY>
< 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: Report cards error here

Postby infernalsham » 08 Jul 2013, 20:30

thefiremind wrote:There are mainly 3 problems:
  1. You are closing the TRIGGER block twice: once with /> after "ZONE_GRAVEYARD" and once with </TRIGGER>. This is an XML structure error so I'm surprised if you could play with this card at all.
  2. DealDamageTo is a function that needs to be called from the source of the damage.
  3. You don't need a zone change trigger here, what you need is a SPELL_PLAYED trigger that checks where the spell was before going to the stack.
This should work:
Ash Zealot | Open
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever a player casts a spell from a graveyard, Ash Zealot deals 3 damage to that player.]]></LOCALISED_TEXT>
    <TRIGGER value="SPELL_PLAYED">
    return TriggerObject():GetErstwhileZone() == ZONE_GRAVEYARD
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    if TriggerPlayer() ~= nil then
       EffectSourceLKI():DealDamageTo( 3,  TriggerPlayer() )
    end
    </RESOLUTION_TIME_ACTION>
    <SFX text="GLOBAL_MAGMA_PLAY" />
  </TRIGGERED_ABILITY>
Ah, I see. Thanks for point it out. Still new to coding cards. :oops:
Want to speed up the loading of DotP Magic 2014 when you start it?
Go to: "C:\*\Magic 2014\Movies" and delete Alienware, Stainless and WotC .bik files.
infernalsham
 
Posts: 17
Joined: 27 Jun 2013, 15:54
Has thanked: 3 times
Been thanked: 1 time

PreviousNext

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 25 guests


Who is online

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

Login Form