It is currently 27 Apr 2024, 21:49
   
Text Size

Some card issues I'm having

Moderator: CCGHQ Admins

Re: Some card issues I'm having

Postby gorem2k » 07 Aug 2014, 06:54

Here's my take on Brago trigger:

| Open
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
    <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_TO_EXILE" definition="0" compartment="1" any_number_of="1" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    TFM_FilterNonlandPermanents(filter)
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION>
    local count = EffectDC():Get_Targets(1):Count()
    EffectDC():Set_Int(2, count)
    if count &gt; 0 then
       for i=0,(count-1) do
          local target = EffectDC():Get_Targets(1):Get_CardPtr(i)
          if target ~= nil and target:IsToken() == false then
             local delayDC = EffectDC():Make_Chest(i+10)
             delayDC:Set_CardPtr(0, target)
             delayDC:Protect_CardPtr(0)
             MTG():CreateDelayedTrigger(1, delayDC)
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target_array = {}
    local count = EffectDC():Get_Int(2)
    if count &gt; 0 then
       for i=0,(count-1) do
          target_array[i] = EffectDC():Get_Targets(1):Get_CardPtr(i)
       end
       for i=0,(count-1) do
          if target_array[i] ~= nil then
             target_array[i]:Exile()
          end
       end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    MTG():RemoveDelayedTrigger(1)
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
  <TRIGGERED_ABILITY replacement_effect="1" resource_id="1">
    <CLEANUP fire_once="1" />
    <TRIGGER value="ZONECHANGE_END" to_zone="ZONE_EXILE" from_zone="ZONE_BATTLEFIELD">
    return TriggerObject() == EffectDC():Get_CardPtr(0)
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    if TriggerObject() ~= nil then
       TriggerObject():PutOntoBattlefield( TriggerObject():GetOwner() )
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
I use TFM filter function, so if you don't have his mod then you can remove this line here,
Code: Select all
TFM_FilterNonlandPermanents(filter)
Basically, it's an adaptation from Sorin, Lord of Innistrad 3rd ability. I've tested and it works.

Upon reading about Brago, King Eternal --- I've found an interesting way to combo this with Rafiq of the Many. If it has double strike you can double 'flickering' on Primeval Titan and such. Also possible with Ajani, Caller of the Pride (remove 3 counters, give double strike to Brago, exile Ajani, get all the loyalty counters back). This card is way too OP! Got plenty of new ideas now.. :P
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: Some card issues I'm having

Postby RiiakShiNal » 07 Aug 2014, 10:39

volrathxp wrote:The last one I got is Brago. He's ticking me off. I swear every time I think it's right, it's not. Right now he tells me I'm trying to index a nil value.

Brago | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="BRAGO_KING_ETERNAL_1000382221" />
  <CARDNAME text="BRAGO_KING_ETERNAL" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[永遠王、ブレイゴ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="1000382221" />
  <ARTID value="1000382221" />
  <ARTIST name="Karla Ortiz" />
  <CASTING_COST cost="{2}{W}{U}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「我の統治は、死の後も続く。」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <SUPERTYPE metaname="Legendary" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Spirit" />
  <EXPANSION value="CNS" />
  <RARITY metaname="R" />
  <POWER value="2" />
  <TOUGHNESS value="4" />
  <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>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[永遠王、ブレイゴがプレイヤー1人に戦闘ダメージを与えるたび、あなたがコントロールする土地でないパーマネントを望む数だけ対象とし、それらを追放する。その後、それらのカードをそれぞれのオーナーのコントロール下で戦場に戻す。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
   <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_FLICKER" definition="0" compartment="0" any_number_of="1" />
   <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add(FE_TYPE, OP_NOT, CARD_TYPE_LAND)
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Targets(0) ~= nil then
        local count = EffectDC():Get_Targets(0):Count()
   EffectDC():Set_Int(0, count)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
            if target ~= nil then
      EffectDC():Protect_CardPtr(i)
                target:Exile()
            end
        end
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
   
        local count = EffectDC():Get_Int(0)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_CardPtr(i)
            if target ~= nil then
               target:PutOntoBattlefield( target:GetOwner() )
            end
        end
    </RESOLUTION_TIME_ACTION>
 </TRIGGERED_ABILITY>
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
   <SFX text="GHOST_ATTACK" power_boundary_min="1" power_boundary_max="-1" />
</CARD_V2>
There are three main problems here:
  • You are overwriting the targets with the count (you can't use the same register for two different pieces of data). Recommendation, is to save the count to register 1 and access it from there.
  • You are protecting pointers that don't exist because you didn't put in Get_Targets(0) before the Protect_CardPtr() call.
  • In the second action you are trying to get card pointers directly from the EffectDC() instead of from Get_Targets(0), this will definitely cause issues because there are no pointers there. (SweetLu previously pointed out this problem.)

So the fixed ability should look something like this:
Brago, King Eternal Ability | Open
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <!-- Foreign language localizations omitted. -->
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
   <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_FLICKER" definition="0" compartment="0" any_number_of="1" />
   <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add(FE_TYPE, OP_NOT, CARD_TYPE_LAND)
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Targets(0) ~= nil then
        local count = EffectDC():Get_Targets(0):Count()
   EffectDC():Set_Int(1, count)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
            if target ~= nil then
      EffectDC():Get_Targets(0):Protect_CardPtr(i)
                target:Exile()
            end
        end
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
   
        local count = EffectDC():Get_Int(1)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
            if target ~= nil then
               target:PutOntoBattlefield( target:GetOwner() )
            end
        end
    </RESOLUTION_TIME_ACTION>
 </TRIGGERED_ABILITY>
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Some card issues I'm having

Postby volrathxp » 07 Aug 2014, 10:46

RiiakShiNal wrote:
volrathxp wrote:The last one I got is Brago. He's ticking me off. I swear every time I think it's right, it's not. Right now he tells me I'm trying to index a nil value.

Brago | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="BRAGO_KING_ETERNAL_1000382221" />
  <CARDNAME text="BRAGO_KING_ETERNAL" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[永遠王、ブレイゴ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="1000382221" />
  <ARTID value="1000382221" />
  <ARTIST name="Karla Ortiz" />
  <CASTING_COST cost="{2}{W}{U}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「我の統治は、死の後も続く。」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <SUPERTYPE metaname="Legendary" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Spirit" />
  <EXPANSION value="CNS" />
  <RARITY metaname="R" />
  <POWER value="2" />
  <TOUGHNESS value="4" />
  <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>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[永遠王、ブレイゴがプレイヤー1人に戦闘ダメージを与えるたび、あなたがコントロールする土地でないパーマネントを望む数だけ対象とし、それらを追放する。その後、それらのカードをそれぞれのオーナーのコントロール下で戦場に戻す。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
   <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_FLICKER" definition="0" compartment="0" any_number_of="1" />
   <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add(FE_TYPE, OP_NOT, CARD_TYPE_LAND)
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Targets(0) ~= nil then
        local count = EffectDC():Get_Targets(0):Count()
   EffectDC():Set_Int(0, count)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
            if target ~= nil then
      EffectDC():Protect_CardPtr(i)
                target:Exile()
            end
        end
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
   
        local count = EffectDC():Get_Int(0)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_CardPtr(i)
            if target ~= nil then
               target:PutOntoBattlefield( target:GetOwner() )
            end
        end
    </RESOLUTION_TIME_ACTION>
 </TRIGGERED_ABILITY>
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
   <SFX text="GHOST_ATTACK" power_boundary_min="1" power_boundary_max="-1" />
</CARD_V2>
There are three main problems here:
  • You are overwriting the targets with the count (you can't use the same register for two different pieces of data). Recommendation, is to save the count to register 1 and access it from there.
  • You are protecting pointers that don't exist because you didn't put in Get_Targets(0) before the Protect_CardPtr() call.
  • In the second action you are trying to get card pointers directly from the EffectDC() instead of from Get_Targets(0), this will definitely cause issues because there are no pointers there. (SweetLu previously pointed out this problem.)

So the fixed ability should look something like this:
Brago, King Eternal Ability | Open
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <!-- Foreign language localizations omitted. -->
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
   <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_FLICKER" definition="0" compartment="0" any_number_of="1" />
   <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add(FE_TYPE, OP_NOT, CARD_TYPE_LAND)
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Targets(0) ~= nil then
        local count = EffectDC():Get_Targets(0):Count()
   EffectDC():Set_Int(1, count)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
            if target ~= nil then
      EffectDC():Get_Targets(0):Protect_CardPtr(i)
                target:Exile()
            end
        end
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
   
        local count = EffectDC():Get_Int(1)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
            if target ~= nil then
               target:PutOntoBattlefield( target:GetOwner() )
            end
        end
    </RESOLUTION_TIME_ACTION>
 </TRIGGERED_ABILITY>
I figured it was something silly like that. I will have to remember that. Thanks! :)
volrathxp
User avatar
volrathxp
 
Posts: 362
Joined: 23 Jul 2014, 17:34
Has thanked: 9 times
Been thanked: 17 times

Re: Some card issues I'm having

Postby gorem2k » 07 Aug 2014, 20:51

RiiakShiNal wrote:So the fixed ability should look something like this:
Thanks, I will use this.
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: Some card issues I'm having

Postby volrathxp » 07 Aug 2014, 23:58

RiiakShiNal wrote:
volrathxp wrote:The last one I got is Brago. He's ticking me off. I swear every time I think it's right, it's not. Right now he tells me I'm trying to index a nil value.

Brago | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
  <FILENAME text="BRAGO_KING_ETERNAL_1000382221" />
  <CARDNAME text="BRAGO_KING_ETERNAL" />
  <TITLE>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[永遠王、ブレイゴ]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
  </TITLE>
  <MULTIVERSEID value="1000382221" />
  <ARTID value="1000382221" />
  <ARTIST name="Karla Ortiz" />
  <CASTING_COST cost="{2}{W}{U}" />
  <FLAVOURTEXT>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「我の統治は、死の後も続く。」]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
  </FLAVOURTEXT>
  <SUPERTYPE metaname="Legendary" />
  <TYPE metaname="Creature" />
  <SUB_TYPE metaname="Spirit" />
  <EXPANSION value="CNS" />
  <RARITY metaname="R" />
  <POWER value="2" />
  <TOUGHNESS value="4" />
  <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>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[永遠王、ブレイゴがプレイヤー1人に戦闘ダメージを与えるたび、あなたがコントロールする土地でないパーマネントを望む数だけ対象とし、それらを追放する。その後、それらのカードをそれぞれのオーナーのコントロール下で戦場に戻す。]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
   <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_FLICKER" definition="0" compartment="0" any_number_of="1" />
   <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add(FE_TYPE, OP_NOT, CARD_TYPE_LAND)
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Targets(0) ~= nil then
        local count = EffectDC():Get_Targets(0):Count()
   EffectDC():Set_Int(0, count)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
            if target ~= nil then
      EffectDC():Protect_CardPtr(i)
                target:Exile()
            end
        end
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
   
        local count = EffectDC():Get_Int(0)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_CardPtr(i)
            if target ~= nil then
               target:PutOntoBattlefield( target:GetOwner() )
            end
        end
    </RESOLUTION_TIME_ACTION>
 </TRIGGERED_ABILITY>
  <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
   <SFX text="GHOST_ATTACK" power_boundary_min="1" power_boundary_max="-1" />
</CARD_V2>
There are three main problems here:
  • You are overwriting the targets with the count (you can't use the same register for two different pieces of data). Recommendation, is to save the count to register 1 and access it from there.
  • You are protecting pointers that don't exist because you didn't put in Get_Targets(0) before the Protect_CardPtr() call.
  • In the second action you are trying to get card pointers directly from the EffectDC() instead of from Get_Targets(0), this will definitely cause issues because there are no pointers there. (SweetLu previously pointed out this problem.)

So the fixed ability should look something like this:
Brago, King Eternal Ability | Open
Code: Select all
  <TRIGGERED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <!-- Foreign language localizations omitted. -->
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
   <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_FLICKER" definition="0" compartment="0" any_number_of="1" />
   <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add(FE_TYPE, OP_NOT, CARD_TYPE_LAND)
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
    if EffectDC():Get_Targets(0) ~= nil then
        local count = EffectDC():Get_Targets(0):Count()
   EffectDC():Set_Int(1, count)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
            if target ~= nil then
      EffectDC():Get_Targets(0):Protect_CardPtr(i)
                target:Exile()
            end
        end
    end
    </RESOLUTION_TIME_ACTION>
      <RESOLUTION_TIME_ACTION>
   
        local count = EffectDC():Get_Int(1)
        for i = 0, (count - 1) do
            local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
            if target ~= nil then
               target:PutOntoBattlefield( target:GetOwner() )
            end
        end
    </RESOLUTION_TIME_ACTION>
 </TRIGGERED_ABILITY>
Unfortunately this didn't work! It does the same thing that I've been running into, spinny trigger the nothing happens.

If I use a DataChest, I can get it to exile a permanent but not bring it back.

If I use Store_CardPtr(i) it will exile and then return only one target, and do nothing to any other targets.

I am so confused....
volrathxp
User avatar
volrathxp
 
Posts: 362
Joined: 23 Jul 2014, 17:34
Has thanked: 9 times
Been thanked: 17 times

Re: Some card issues I'm having

Postby RiiakShiNal » 08 Aug 2014, 00:26

My fixed code works as is, but as the cards are immediately put back into play there is no animation other than the appearance of summoning sickness effects and cards with ETB triggers being triggered. So other than animation my corrected code works as expected.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Some card issues I'm having

Postby volrathxp » 08 Aug 2014, 00:27

RiiakShiNal wrote:My fixed code works as is, but as the cards are immediately put back into play there is no animation other than the appearance of summoning sickness effects and cards with ETB triggers being triggered. So other than animation my corrected code works as expected.
I'll try it again and let you know. It didn't trigger any ETB effects when I tried.
volrathxp
User avatar
volrathxp
 
Posts: 362
Joined: 23 Jul 2014, 17:34
Has thanked: 9 times
Been thanked: 17 times

Re: Some card issues I'm having

Postby RiiakShiNal » 08 Aug 2014, 00:30

This is the exact code I used for testing just in-case you have a typo or something:
Brago, King Eternal | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
    <CARD_V2 ExportVersion="1">
      <FILENAME text="BRAGO_KING_ETERNAL_1000382221" />
      <CARDNAME text="BRAGO_KING_ETERNAL" />
      <TITLE>
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[永遠王、ブレイゴ]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
      </TITLE>
      <MULTIVERSEID value="1000382221" />
      <ARTID value="1000382221" />
      <ARTIST name="Karla Ortiz" />
      <CASTING_COST cost="{2}{W}{U}" />
      <FLAVOURTEXT>
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「我の統治は、死の後も続く。」]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
      </FLAVOURTEXT>
      <SUPERTYPE metaname="Legendary" />
      <TYPE metaname="Creature" />
      <SUB_TYPE metaname="Spirit" />
      <EXPANSION value="CNS" />
      <RARITY metaname="R" />
      <POWER value="2" />
      <TOUGHNESS value="4" />
      <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>
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[永遠王、ブレイゴがプレイヤー1人に戦闘ダメージを与えるたび、あなたがコントロールする土地でないパーマネントを望む数だけ対象とし、それらを追放する。その後、それらのカードをそれぞれのオーナーのコントロール下で戦場に戻す。]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
       <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_FLICKER" definition="0" compartment="0" any_number_of="1" />
       <TARGET_DEFINITION id="0">
        local filter = ClearFilter()
        filter:Add(FE_TYPE, OP_NOT, CARD_TYPE_LAND)
        filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
        </TARGET_DEFINITION>
          <RESOLUTION_TIME_ACTION>
        if EffectDC():Get_Targets(0) ~= nil then
            local count = EffectDC():Get_Targets(0):Count()
       EffectDC():Set_Int(1, count)
            for i = 0, (count - 1) do
                local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
                if target ~= nil then
          EffectDC():Get_Targets(0):Protect_CardPtr(i)
                    target:Exile()
                end
            end
        end
        </RESOLUTION_TIME_ACTION>
          <RESOLUTION_TIME_ACTION>
       
            local count = EffectDC():Get_Int(1)
            for i = 0, (count - 1) do
                local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
                if target ~= nil then
                   target:PutOntoBattlefield( target:GetOwner() )
                end
            end
        </RESOLUTION_TIME_ACTION>
     </TRIGGERED_ABILITY>
      <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
       <SFX text="GHOST_ATTACK" power_boundary_min="1" power_boundary_max="-1" />
    </CARD_V2>
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Some card issues I'm having

Postby volrathxp » 08 Aug 2014, 00:48

RiiakShiNal wrote:This is the exact code I used for testing just in-case you have a typo or something:
Brago, King Eternal | Open
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
    <CARD_V2 ExportVersion="1">
      <FILENAME text="BRAGO_KING_ETERNAL_1000382221" />
      <CARDNAME text="BRAGO_KING_ETERNAL" />
      <TITLE>
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[永遠王、ブレイゴ]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Brago, King Eternal]]></LOCALISED_TEXT>
      </TITLE>
      <MULTIVERSEID value="1000382221" />
      <ARTID value="1000382221" />
      <ARTIST name="Karla Ortiz" />
      <CASTING_COST cost="{2}{W}{U}" />
      <FLAVOURTEXT>
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「我の統治は、死の後も続く。」]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[“My rule persists beyond death itself.”]]></LOCALISED_TEXT>
      </FLAVOURTEXT>
      <SUPERTYPE metaname="Legendary" />
      <TYPE metaname="Creature" />
      <SUB_TYPE metaname="Spirit" />
      <EXPANSION value="CNS" />
      <RARITY metaname="R" />
      <POWER value="2" />
      <TOUGHNESS value="4" />
      <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>
        <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[永遠王、ブレイゴがプレイヤー1人に戦闘ダメージを与えるたび、あなたがコントロールする土地でないパーマネントを望む数だけ対象とし、それらを追放する。その後、それらのカードをそれぞれのオーナーのコントロール下で戦場に戻す。]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner’s control.]]></LOCALISED_TEXT>
        <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
       <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_FLICKER" definition="0" compartment="0" any_number_of="1" />
       <TARGET_DEFINITION id="0">
        local filter = ClearFilter()
        filter:Add(FE_TYPE, OP_NOT, CARD_TYPE_LAND)
        filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
        </TARGET_DEFINITION>
          <RESOLUTION_TIME_ACTION>
        if EffectDC():Get_Targets(0) ~= nil then
            local count = EffectDC():Get_Targets(0):Count()
       EffectDC():Set_Int(1, count)
            for i = 0, (count - 1) do
                local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
                if target ~= nil then
          EffectDC():Get_Targets(0):Protect_CardPtr(i)
                    target:Exile()
                end
            end
        end
        </RESOLUTION_TIME_ACTION>
          <RESOLUTION_TIME_ACTION>
       
            local count = EffectDC():Get_Int(1)
            for i = 0, (count - 1) do
                local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
                if target ~= nil then
                   target:PutOntoBattlefield( target:GetOwner() )
                end
            end
        </RESOLUTION_TIME_ACTION>
     </TRIGGERED_ABILITY>
      <HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
       <SFX text="GHOST_ATTACK" power_boundary_min="1" power_boundary_max="-1" />
    </CARD_V2>
Thanks I just recopied it and tested it, and it works! Thank you so much. Jeez, I was beating my head into a wall today over that guy.
volrathxp
User avatar
volrathxp
 
Posts: 362
Joined: 23 Jul 2014, 17:34
Has thanked: 9 times
Been thanked: 17 times

Previous

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 20 guests


Who is online

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

Login Form