It is currently 23 Jul 2019, 11:04
   
Text Size

Help with a card

Moderators: Xander9009, CCGHQ Admins

Help with a card

Postby Thran75 » 26 Feb 2013, 21:52

I don't understand why this card doesn't work can someone can give me an hand?

<CARD_V2>
<FILENAME text="AURA_FRACTURE_24560" />
<CARDNAME text="AURA_FRACTURE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Frattura dell'aura]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Aura Fracture]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="24560" />
<ARTID value="24560" />
<ARTIST name="Rebecca Guay" />
<CASTING_COST cost="{2}{W}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[«Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds. »]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“‘Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[„Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.“]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA["I maghi ristici di Jamuraa trattano la magia come il loro giardino estirpando le magie indesiderate come fossero erbacce fastidiose."]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[”Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds.”]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[«Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds».]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“Jamuraa's rhystic mages treat magic as their garden, uprooting unwanted spells as bothersome weeds”]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Enchantment" />
<EXPANSION value="DPG" />
<RARITY metaname="C" />
<ACTIVATED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sacrifica una Terra : Distruggi un incantesimo bersaglio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
<COST type="Sacrifice">
<TARGET_DEFINITION id="6">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_LAND )
filter:SetPlayer( EffectController() )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(6)
</TARGET_DETERMINATION>
<PLAYTIME>
EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_LAND_TO_SACRIFICE", EffectDC():Make_Targets(0) )
</PLAYTIME></COST>
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_ENCHANTMENT )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_ENCHANTMENT_TO_DESTROY", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION ignore_filter="1">
local target = EffectDC():Get_Targets(0):Get_NthCardPtr(0)
if target ~= nil then
target:Destroy()


end
</RESOLUTION_TIME_ACTION>
Thank to every kind soul willing to help me.
Thran75
 
Posts: 21
Joined: 24 Feb 2013, 11:38
Has thanked: 7 times
Been thanked: 0 time

Re: Help with a card

Postby RiiakShiNal » 26 Feb 2013, 22:10

It helps if you use the [ code ] [ /code ] tags (without the extra spaces) as it makes reading the card easier.

As for what is wrong with the card I don't see the closing tags for the ability or for the card, also for picking the enchantment to destroy you may want to use chest 1 instead of 0 because you used chest 0 for sacrificing the land essentially making that part like this:
Code: Select all
  <ACTIVATED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Sacrifica una Terra : Distruggi un incantesimo bersaglio.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Sacrifice a Land: Destroy target enchantment.]]></LOCALISED_TEXT>
    <COST type="Sacrifice">
      <TARGET_DEFINITION id="6">
        local filter = Object():GetFilter()
        filter:Clear()
        filter:AddCardType( CARD_TYPE_LAND )
        filter:SetPlayer( EffectController() )
        filter:SetZone( ZONE_IN_PLAY )
        filter:SetHint( HINT_ENEMY, EffectController() )
        filter:NotTargetted()
      </TARGET_DEFINITION>
      <TARGET_DETERMINATION>
        return AtLeastOneTargetFromDefinition(6)
      </TARGET_DETERMINATION>
      <PLAYTIME>
        EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_LAND_TO_SACRIFICE", EffectDC():Make_Targets(0) )
      </PLAYTIME>
    </COST>
    <TARGET_DEFINITION id="0">
      local filter = Object():GetFilter()
      filter:Clear()
      filter:AddCardType( CARD_TYPE_ENCHANTMENT )
      filter:SetZone( ZONE_IN_PLAY )
      filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
    </TARGET_DEFINITION>
    <TARGET_DETERMINATION>
      return AtLeastOneTargetFromDefinition(0)
    </TARGET_DETERMINATION>
    <PLAY_TIME_ACTION target_choosing="1">
      EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_ENCHANTMENT_TO_DESTROY", EffectDC():Make_Targets(1) )
    </PLAY_TIME_ACTION>
    <RESOLUTION_TIME_ACTION ignore_filter="1">
      local target = EffectDC():Get_Targets(1):Get_NthCardPtr(0)
      if target ~= nil then
        target:Destroy()
      end
    </RESOLUTION_TIME_ACTION>
  </ACTIVATED_ABILITY>
</CARD_V2>
Problems with base game cards: DotP 2014 Core Fixes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
RiiakShiNal
Programmer
 
Posts: 2120
Joined: 16 May 2011, 21:37
Has thanked: 73 times
Been thanked: 471 times

Re: Help with a card

Postby Thran75 » 26 Feb 2013, 22:30

ops i missed last part of the card on the post... but yes you had right about the other part. Now it work perfectly. Thank you a lot.
Thran75
 
Posts: 21
Joined: 24 Feb 2013, 11:38
Has thanked: 7 times
Been thanked: 0 time

Re: Help with a card

Postby thefiremind » 26 Feb 2013, 22:44

To say it in other words, never reuse the same EffectDC register inside the same ability, not even for storing different kinds of data.
You call EffectDC():Make_Targets(0), then register 0 is "wasted". No more EffectDC():Make_Targets(0), EffectDC():Set_Int(0, ...), or whatever.

(Actually, the FreeCompartment function is used in some cards to be sure that ObjectDC registers are clean before using them, so it would probably be able to make a register usable again, but nobody does that for EffectDC, so just use different register numbers and forget about this last thing. :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: 717 times

Re: Help with a card

Postby Thran75 » 27 Feb 2013, 19:24

Thank again! By the way i am trying to find out how affect only non basic lands with spells and abilities do you know where i could look?
Thran75
 
Posts: 21
Joined: 24 Feb 2013, 11:38
Has thanked: 7 times
Been thanked: 0 time

Re: Help with a card

Postby thefiremind » 27 Feb 2013, 19:44

"Basic" is a supertype, so if you want to filter nonbasic for targetting you'll write
Code: Select all
local filter = Object():GetFilter()
-- ...other filtering for zone, card type, etc.
filter:AddSupertype( SUPERTYPE_BASIC )
filter:AddExtra( FILTER_EXTRA_FLIP_SUPER_TYPES )
while if you need to check a card (for example FilteredCard) for not having the basic supertype you'll write
Code: Select all
FilteredCard():GetSupertype():Test( SUPERTYPE_BASIC ) == 0
same goes for other supertypes (like legendary or snow).
< 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: 717 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 287 on 31 Mar 2019, 04:11

Users browsing this forum: No registered users and 1 guest

Login Form