It is currently 25 Apr 2024, 17:00
   
Text Size

Echo ability, do not work

Moderator: CCGHQ Admins

Echo ability, do not work

Postby JorUge » 11 Jan 2014, 02:10

Hello, everyone, when I think that my first wad is read to launch I find other problem.

I coded Bone Shredder for Magic 2014, and was Ok to put When Bone Shredder enters the battlefield, destroy target nonartifact, nonblack creature. to work, the problem was that seem to be the easiest part, was the big problem.

How to put Echo to work?

I still searching solutions in the others WADs, but I doing something wrong when I put the code part in my code.


Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="BONE_SHREDDER_JRG209123" />
  <CARDNAME text="BONE_SHREDDER" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Bone Shredder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Bone Shredder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Bone Shredder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bone Shredder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Bone Shredder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[骨砕き]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Bone Shredder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Bone Shredder]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Bone Shredder]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="209123" />
  <ARTID value="JRG209123" />
  <ARTIST name="Ron Spencer" />
  <CASTING_COST cost="{2}{B}" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Minion" />
  <EXPANSION value="DDE" />
  <RARITY metaname="U" />
  <POWER value="1" />
  <TOUGHNESS value="1" />
  <STATIC_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
    <INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
  </STATIC_ABILITY>
      <TRIGGERED_ABILITY commaspace="1" linked_ability_group="1">
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[echo {2}{B}]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[écho {2}{B}]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[eco {2}{B}]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Echo {2}{B}]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[eco {2}{B}]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[エコー {2}{B}]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[echo {2}{B}]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[эхо {2}{B}
]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[eco {2}{B}]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[返响{2}{B}]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[返響{2}{B}]]></LOCALISED_TEXT>
   <TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
    return MTG():GetStep() == STEP_UPKEEP
    </TRIGGER>
    <INTERVENING_IF>
    return LinkedDC():Get_Int(0) == 1
    </INTERVENING_IF>
    <RESOLUTION_TIME_ACTION>
    LinkedDC():Set_Int( 0, 0 )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
      if EffectController():CanPayResourceCost(1) then
        EffectController():BeginNewMultipleChoice()   
        EffectController():AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PAY_ECHO" )   
        EffectController():AddMultipleChoiceAnswer( "CARD_QUERY_INTET_DO_NOT_PAY_MANA" )
        EffectController():AskMultipleChoiceQuestion( "CARD_QUERY_INTET_QUESTION", EffectSource() )
      end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    if EffectSource() ~= nil then
      if EffectController():CanPayResourceCost(1) then
        local result = EffectController():GetMultipleChoiceResult()
        if result == 0 then
          EffectController():PayResourceCost( 1 )
        else
          EffectController():Sacrifice( EffectSource() )
        end
      else
        EffectController():Sacrifice( EffectSource() )
      end
    end
    </RESOLUTION_TIME_ACTION>
    <AUTO_SKIP no_effect_source="1" />
  </TRIGGERED_ABILITY>
    <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Bone Shredder enters the battlefield, destroy target nonartifact, nonblack creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[When Bone Shredder enters the battlefield, destroy target nonartifact, nonblack creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[When Bone Shredder enters the battlefield, destroy target nonartifact, nonblack creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[When Bone Shredder enters the battlefield, destroy target nonartifact, nonblack creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando il Tritaossa entra nel campo di battaglia, distruggi una creatura bersaglio non artefatto e non nera.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[骨砕きが戦場に出たとき、アーティファクトでも黒でもないクリーチャー1体を対象とし、それを破壊する。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[When Bone Shredder enters the battlefield, destroy target nonartifact, nonblack creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[When Bone Shredder enters the battlefield, destroy target nonartifact, nonblack creature.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[When Bone Shredder enters the battlefield, destroy target nonartifact, nonblack creature.]]></LOCALISED_TEXT>
   <TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
      <TARGET tag="CARD_QUERY_CHOOSE_NONARTIFACT_OR_NONBLACKCREATURE_TO_DESTROY" definition="0" compartment="0" count="1" />
      <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_NOT, CARD_TYPE_ARTIFACT )
   filter:Add( FE_COLOUR, OP_NOT, COLOUR_BLACK)
    </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then   
       target:Destroy() 
    end
    </RESOLUTION_TIME_ACTION>
      <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
  </TRIGGERED_ABILITY>
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" 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" />
</CARD_V2>

Thanks for reading and share knowledge.
JorUge
 
Posts: 13
Joined: 31 Dec 2013, 20:29
Has thanked: 15 times
Been thanked: 0 time

Re: Echo ability, do not work

Postby RiiakShiNal » 11 Jan 2014, 03:37

Your Echo ability references LinkedDC():Get_Int(0) == 1, but nowhere do you set that LinkedDC() value to 1. Since this is a permanent and may potentially change control multiple times whenever it changes control you also need to set that LinkedDC() value to 1 (for example if an opponent takes control of it with Act of Treason, when it is returned to your control at your upkeep you will have to pay the Echo cost or sacrifice it).

So more than likely you simply forgot to put the other part(s) of the Echo ability into your code which is why it is not working.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Echo ability, do not work

Postby JorUge » 11 Jan 2014, 10:23

In japanese have a form to treat persons that everyone one need to respect and you are one of them.

Thank Riiak Sensei, I will compare with carefull the base code and will put here the results.

You are one of the ones in This awesome forum. Im glad to receive your words.
JorUge
 
Posts: 13
Joined: 31 Dec 2013, 20:29
Has thanked: 15 times
Been thanked: 0 time

Re: Echo ability, do not work

Postby thefiremind » 11 Jan 2014, 10:38

If you want an example of Echo you can look at my mod. I also provide a Thick-Skinned Goblin that is compatible with my Echo cards.
< 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: Echo ability, do not work

Postby RiiakShiNal » 11 Jan 2014, 13:53

JorUge wrote:In japanese have a form to treat persons that everyone one need to respect and you are one of them.

Thank Riiak Sensei, I will compare with carefull the base code and will put here the results.

You are one of the ones in This awesome forum. Im glad to receive your words.
Thank you (ありがとうございます), though there are several other modders who have also been around quite a while and are also very deserving of such respect (for example rick a.k.a. Gibbed, thefiremind, sumomole, kevlahnota, etc...) and more such modders who make themselves extremely helpful to the community appear every so often (for example NeoAnderson, jacque, Kieran, MC Brodie, etc...). I would also be remiss if I did not mention our great admins/moderators (Goblin Hero, and Huggybaby) as deserving of our respect for providing this great forum and keeping it clean of spam.

We all learn from each other and most of us share what we have learned with everyone else in the community. Who knows in the future we may be referring to you with such respect.

thefiremind wrote:If you want an example of Echo you can look at my mod. I also provide a Thick-Skinned Goblin that is compatible with my Echo cards.
I would second that as implementations of abilities that are more compatible with more cards should almost always be used over less compatible implementations.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 22 guests


Who is online

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

Login Form