Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Report cards error here
Moderator: CCGHQ Admins
Re: Report cards error here
by BloodReyvyn » 30 May 2013, 07:47
Nevermind, for some reason I saved it as a text file instead of an XML. I got it in-game, however when I cycle the card I can target a spell to counter (assuming there is one) but it doesn't actually counter the spell.
The other ability seems to work when it's in play by countering spells, although the AI hasn't been very cooperative in this area, since it rarely plays spells at all when the enchantment is in play. I don't see any counters of any kind being put on it, but I have yet to actually get to a point where it has countered 3 spells. Either I die or they do before it ever happens.
The other ability seems to work when it's in play by countering spells, although the AI hasn't been very cooperative in this area, since it rarely plays spells at all when the enchantment is in play. I don't see any counters of any kind being put on it, but I have yet to actually get to a point where it has countered 3 spells. Either I die or they do before it ever happens.
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
-
BloodReyvyn - Posts: 421
- Joined: 19 May 2013, 13:29
- Has thanked: 53 times
- Been thanked: 40 times
Re: Report cards error here
by thefiremind » 30 May 2013, 08:55
This happens because you copied the bugged countering from the official Draining Whelk or Mystic Snake. You should never use GetTargetCard() in DotP2013, since it's DotP2012 syntax, and apart from that, if you try to get the target from EffectSource(), any zone change of the counterspell will make it vain. Use this format:BloodReyvyn wrote:when I cycle the card I can target a spell to counter (assuming there is one) but it doesn't actually counter the spell.
- Code: Select all
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
target:CounterSpell()
end
</RESOLUTION_TIME_ACTION>
- Code: Select all
filter:May()
filter:AIMay()
Last thing, it's better if you put the AddCounter and the sacrifice condition in 2 separate RESOLUTION_TIME_ACTIONs. Changes to the game state are often applied only at the end of an action, so you would risk to count one less counter. I'm sure that zone changes follow this rule, I'm not totally sure for counters, anyway better be safe.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Report cards error here
by BloodReyvyn » 30 May 2013, 20:05
Well, I tried that code, but now I don't even get the option to counter anything.
Apparently I should have made the sac ability a triggered ability all its own because when I used a proliferate card, it added counters to the enchantment and had 5 depletion counters.
How do I stop proliferate from adding counters to this card by the way?
Apparently I should have made the sac ability a triggered ability all its own because when I used a proliferate card, it added counters to the enchantment and had 5 depletion counters.
How do I stop proliferate from adding counters to this card by the way?
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
-
BloodReyvyn - Posts: 421
- Joined: 19 May 2013, 13:29
- Has thanked: 53 times
- Been thanked: 40 times
Re: Report cards error here
by thefiremind » 30 May 2013, 21:04
My pieces of code are misplaced a bit too often these days, I should learn to post the whole code everytime rather than just pieces...BloodReyvyn wrote:Well, I tried that code, but now I don't even get the option to counter anything.

- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
<FILENAME text="DECREE_OF_SILENCE_46430" />
<CARDNAME text="DECREE_OF_SILENCE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Decree of Silence]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Décret de silence]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Decreto de silencio]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Dekret des Schweigens]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Decreto del Silenzio]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Decree of Silence]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Decree of Silence]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Decree of Silence]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Decreto de Silêncio]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="46430" />
<ARTID value="A46430" />
<ARTIST name="Adam Rex" />
<CASTING_COST cost="{6}{U}{U}" />
<TYPE metaname="Enchantment" />
<EXPANSION value="SCG" />
<RARITY metaname="R" />
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever an opponent casts a spell, counter that spell and put a depletion counter on Decree of Silence. If there are three or more depletion counters on Decree of Silence, sacrifice it.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois qu’un adversaire joue un sort, contrez ce sort et placez un marqueur « sec » sur le Décret de silence. Quand il y a au moins trois marqueurs « sec » sur le Décret de silence, sacrifiez-le.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que un oponente juegue un hechizo, contrarresta ese hechizo y pon un contador de agotamiento sobre el Decreto de silencio. Si hay tres o más contadores de agotamiento sobre el Decreto de silencio, sacrifícalo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn ein Gegner einen Zauberspruch spielt, neutralisiere ihn und lege eine Entleerungsmarke auf das Dekret des Schweigens. Falls drei oder mehr Entleerungsmarken auf dem Dekret des Schweigens liegen, opfere sie.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta un avversario lancia una magia, neutralizza quella magia e metti un segnalino desolazione sul Decreto del Silenzio. Se ci sono tre o più segnalini desolazione sul Decreto del Silenzio, sacrificalo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever an opponent casts a spell, counter that spell and put a depletion counter on Decree of Silence. If there are three or more depletion counters on Decree of Silence, sacrifice it.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever an opponent casts a spell, counter that spell and put a depletion counter on Decree of Silence. If there are three or more depletion counters on Decree of Silence, sacrifice it.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever an opponent casts a spell, counter that spell and put a depletion counter on Decree of Silence. If there are three or more depletion counters on Decree of Silence, sacrifice it.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que um oponente jogar uma mágica, anule aquela mágica e coloque um marcador de depleção em Decreto de Silêncio. Se houver três ou mais marcadores de depleção em Decreto de Silêncio, sacrifique-o.]]></LOCALISED_TEXT>
<TRIGGER value="SPELL_PLAYED">
return TriggerObject():GetPlayer():GetTeam() ~= EffectController():GetTeam()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local spell = TriggerObject()
if spell ~= nil then
spell:CounterSpell()
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():GetCountersType("DEPLETION"), 1 )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local source = EffectSource()
if source ~= nil then
if source:CountCounters( MTG():GetCountersType("DEPLETION") ) > 2 then
source:Sacrifice( EffectController() )
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<ACTIVATED_ABILITY auto_skip="1" filter_zone="ZONE_IN_PLAY" active_zone="ZONE_HAND">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Cycling {4}{U}{U}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Recyclage {4}{U}{U}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Ciclo {4}{U}{U}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Umwandlung {4}{U}{U}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ciclo {4}{U}{U}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[サイクリング {4}{U}{U}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[순환 {4}{U}{U}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Цикл {4}{U}{U}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Reciclar {4}{U}{U}]]></LOCALISED_TEXT>
<COST type="DiscardSelf" />
<COST type="Mana" cost="{4}{U}{U}" />
<PLAY_TIME_ACTION>
MTG():FireTrigger( TRIGGER_CYCLED, Object() )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
EffectController():DrawCard()
</RESOLUTION_TIME_ACTION>
<AI_AVAILABILITY type="in_response" />
</ACTIVATED_ABILITY>
<TRIGGERED_ABILITY active_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When you cycle Decree of Silence, you may counter target spell.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand vous recyclez le Décret de silence, vous pouvez contrer le sort ciblé.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cuando uses la habilidad de ciclo del Decreto de silencio, puedes contrarrestar el hechizo objetivo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn du das Dekret des Schweigens umwandelst, kannst du einen Zauberspruch deiner Wahl neutralisieren.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando cicli il Decreto del Silenzio, puoi neutralizzare una magia bersaglio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[When you cycle Decree of Silence, you may counter target spell.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[When you cycle Decree of Silence, you may counter target spell.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[When you cycle Decree of Silence, you may counter target spell.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Quando reciclar Decreto do Silêncio, você pode anular a mágica alvo.]]></LOCALISED_TEXT>
<TRIGGER value="CYCLED" simple_qualifier="self" />
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:May()
filter:AIMay()
filter:SetZone( ZONE_STACK )
filter:SetStackObjectType( STACK_OBJECT_CARD )
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_SPELL_TO_COUNTER", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
target:CounterSpell()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<HELP title="MORE_INFO_TITLE_CYCLING" body="MORE_INFO_BODY_CYCLING" zone="ZONE_ANY" />
<AI_BASE_SCORE score="1800" zone="ZONE_HAND" />
</CARD_V2>
No, it's a single ability, otherwise it would be on different lines. You can even have 100 depletion counters if you add them in another way.BloodReyvyn wrote:Apparently I should have made the sac ability a triggered ability all its own
The GetBestOrWorstCounterType can't do wonders... it knows that -1/-1 counters are bad, but it can't guess the nature of new counter types. The only way would be to rewrite the proliferate function so that depletion counters are treated as "bad".BloodReyvyn wrote:How do I stop proliferate from adding counters to this card by the way?
Last edited by thefiremind on 30 May 2013, 22:46, edited 1 time in total.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Report cards error here
by BloodReyvyn » 30 May 2013, 22:37
Hmm, the enchantment still isn't getting sacrificed. I got the opponent locked up and they played about 10 spells. All of them got countered, but the enchantment never went away.
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
-
BloodReyvyn - Posts: 421
- Joined: 19 May 2013, 13:29
- Has thanked: 53 times
- Been thanked: 40 times
Re: Report cards error here
by thefiremind » 30 May 2013, 22:47
Sorry, I wrote "do" instead of "then" on the inner "if" of the sacrifice.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Report cards error here
by BloodReyvyn » 31 May 2013, 01:31
Cool, that got everything working great. A question real quick: If I am coding a card and having issues is it more appropriate to post here or in the card request thread, as it seems most people go there?
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
-
BloodReyvyn - Posts: 421
- Joined: 19 May 2013, 13:29
- Has thanked: 53 times
- Been thanked: 40 times
Re: Report cards error here
by thefiremind » 31 May 2013, 08:29
Good question indeed!BloodReyvyn wrote:A question real quick: If I am coding a card and having issues is it more appropriate to post here or in the card request thread, as it seems most people go there?

< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Report cards error here
by BloodReyvyn » 02 Jun 2013, 11:59
- Code: Select all
[lua] [string "NEARHEATH_PILGRIM_1030501_TITLE (RESOLUTION_TIME_ACTION) [3817]"]:5:
parameter mismatch or too few parameters [expected bzS32]
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
-
BloodReyvyn - Posts: 421
- Joined: 19 May 2013, 13:29
- Has thanked: 53 times
- Been thanked: 40 times
Re: Report cards error here
by thefiremind » 02 Jun 2013, 12:10
The occasional crashes are hard to debug and usually leave no trace on SCRIPT_LOG.TXT, but if you post your Nearheath Pilgrim code, I can help on that at least. 

< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Report cards error here
by BloodReyvyn » 02 Jun 2013, 12:39
Well, here is the code. It was working for the longest time without errors or the errors got lost in with other card errors (I do get similar errors with other Soulbond cards, and a lot with level-up cards).
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="NEARHEATH_PILGRIM_1030501" />
<CARDNAME text="NEARHEATH_PILGRIM" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Nearheath Pilgrim]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Nearheath Pilgrim]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Nearheath Pilgrim]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Nearheath Pilgrim]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Nearheath Pilgrim]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Nearheath Pilgrim]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Nearheath Pilgrim]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Nearheath Pilgrim]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Nearheath Pilgrim]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1030501" />
<ARTID value="1030501" />
<ARTIST name="Erica Yang" />
<CASTING_COST cost="{1}{W}" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Human" order_de-DE="0" order_es-ES="1" order_fr-FR="0" order_it-IT="1" order_jp-JA="0" order_ko-KR="0" order_pt-BR="0" order_ru-RU="0" />
<SUB_TYPE metaname="Cleric" order_de-DE="1" order_es-ES="0" order_fr-FR="1" order_it-IT="0" order_jp-JA="1" order_ko-KR="1" order_pt-BR="1" order_ru-RU="1" />
<EXPANSION value="DPG" />
<RARITY metaname="U" />
<POWER value="2" />
<TOUGHNESS value="1" />
<TRIGGERED_ABILITY auto_skip="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Soulbond |(You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)|]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Soulbond |(You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)|]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Soulbond |(You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)|]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Soulbond |(You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)|]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Soulbond |(You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)|]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Soulbond |(You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)|]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Soulbond |(You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)|]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Soulbond |(You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)|]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Soulbond |(You may pair this creature with another unpaired creature when either enters the battlefield. They remain paired for as long as you control both of them.)|]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" to_zone="ZONE_IN_PLAY">
return (TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 and Object():GetCurrentCharacteristics():Characteristic_Get( CHARACTERISTIC_PHASING ) == 0)
</TRIGGER>
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:May()
filter:NotTargetted()
if TriggerObject() ~= Object() then
filter:SetCardInstance( TriggerObject() )
else
filter:SetCardInstance( Object() )
filter:AddExtra( FILTER_EXTRA_FLIP_CARD_INSTANCE )
end
filter:AddCharacteristic( CHARACTERISTIC_PHASING )
filter:AddExtra( FILTER_EXTRA_FLIP_CHARACTERISTICS )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetZone( ZONE_IN_PLAY )
filter:SetController( EffectController() )
filter:SetHint( HINT_ALLIED_ONLY, EffectController() )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<RESOLUTION_TIME_ACTION>
if (EffectSource() ~= nil and
Object():GetCurrentCharacteristics():Characteristic_Get( CHARACTERISTIC_PHASING ) == 0 and
Object():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 and
Object():GetController() == EffectController()) then
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_CREATURE_TO_PAIR", EffectDC():Make_Targets(0) )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
ObjectDC():Set_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND, target)
ObjectDC():Set_PlayerPtr(COMPARTMENT_ID_PLR_PAIRED, EffectController())
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY">
<TRIGGER value="ABILITY_RESOLVED">
if Object():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0 and ObjectDC():Get_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND) == nil then
local filter = Object():GetFilter()
filter:Clear()
filter:NotTargetted()
filter:SetZone( ZONE_IN_PLAY )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:SetCardInstance( Object() )
filter:AddExtra( FILTER_EXTRA_FLIP_CARD_INSTANCE )
filter:SetController( EffectController() )
local others = filter:EvaluateObjects()
if others > 0 then
for i=0,others-1 do
local card = filter:GetNthEvaluatedObject(i)
if card ~= nil and card:GetDataChest() ~= nil then
local pair = card:GetDataChest():Get_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND)
if pair ~= nil and pair == Object() then
ObjectDC():Set_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND, card)
ObjectDC():Set_PlayerPtr(COMPARTMENT_ID_PLR_PAIRED, EffectController())
return true
end
end
end
end
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As long as Nearheath Pilgrim is paired with another creature, both creatures have lifelink.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[As long as Nearheath Pilgrim is paired with another creature, both creatures have lifelink.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[As long as Nearheath Pilgrim is paired with another creature, both creatures have lifelink.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[As long as Nearheath Pilgrim is paired with another creature, both creatures have lifelink.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[As long as Nearheath Pilgrim is paired with another creature, both creatures have lifelink.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[As long as Nearheath Pilgrim is paired with another creature, both creatures have lifelink.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As long as Nearheath Pilgrim is paired with another creature, both creatures have lifelink.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As long as Nearheath Pilgrim is paired with another creature, both creatures have lifelink.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[As long as Nearheath Pilgrim is paired with another creature, both creatures have lifelink.]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION layer="8">
local pair = ObjectDC():Get_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND)
if pair ~= nil then
pair:GetCurrentCharacteristics():Characteristic_Set( CHARACTERISTIC_PHASING, 1 )
Object():GetCurrentCharacteristics():Characteristic_Set( CHARACTERISTIC_PHASING, 1 )
end
</CONTINUOUS_ACTION>
<CONTINUOUS_ACTION layer="6">
local pair = ObjectDC():Get_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND)
if pair ~= nil then
pair:GetCurrentCharacteristics():Characteristic_Set( CHARACTERISTIC_LIFELINK, 1 )
Object():GetCurrentCharacteristics():Characteristic_Set( CHARACTERISTIC_LIFELINK, 1 )
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY">
<TRIGGER value="ABILITY_RESOLVED">
local pair = ObjectDC():Get_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND)
local player = ObjectDC():Get_PlayerPtr(COMPARTMENT_ID_PLR_PAIRED)
if pair ~= nil and player ~= nil then
return (pair:GetController() ~= player or Object():GetController() ~= player or pair:GetCardType():Test( CARD_TYPE_CREATURE ) == 0 or Object():GetCardType():Test( CARD_TYPE_CREATURE ) == 0)
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
ObjectDC():Set_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND, nil)
ObjectDC():Set_PlayerPtr(COMPARTMENT_ID_PLR_PAIRED, nil)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY">
<TRIGGER value="SPELL_RESOLVED">
local pair = ObjectDC():Get_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND)
local player = ObjectDC():Get_PlayerPtr(COMPARTMENT_ID_PLR_PAIRED)
if pair ~= nil and player ~= nil then
return (pair:GetController() ~= player or Object():GetController() ~= player or pair:GetCardType():Test( CARD_TYPE_CREATURE ) == 0 or Object():GetCardType():Test( CARD_TYPE_CREATURE ) == 0)
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
ObjectDC():Set_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND, nil)
ObjectDC():Set_PlayerPtr(COMPARTMENT_ID_PLR_PAIRED, nil)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY">
<TRIGGER value="PLAYER_LOSES_GAME">
local player = ObjectDC():Get_PlayerPtr(COMPARTMENT_ID_PLR_PAIRED)
if player ~= nil then
return TriggerPlayer() == player
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
ObjectDC():Set_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND, nil)
ObjectDC():Set_PlayerPtr(COMPARTMENT_ID_PLR_PAIRED, nil)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY internal="1" filter_zone="ZONE_IN_PLAY">
<TRIGGER value="ZONECHANGE_BEGIN" simple_qualifier="self" to_zone="ZONE_ANY" from_zone="ZONE_IN_PLAY" />
<RESOLUTION_TIME_ACTION>
ObjectDC():Set_CardPtr(COMPARTMENT_ID_OBJ_SOULBOND, nil)
ObjectDC():Set_PlayerPtr(COMPARTMENT_ID_PLR_PAIRED, nil)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<HELP title="MORE_INFO_BADGE_TITLE_2" body="MORE_INFO_BADGE_BODY_2" zone="ZONE_ANY" />
<HELP title="MORE_INFO_BADGE_TITLE_170" body="MORE_INFO_BADGE_BODY_170" zone="ZONE_ANY" />
<SFX text="COMBAT_BLADE_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_BLADE_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
<AI_BASE_SCORE score="450" zone="ZONE_IN_PLAY" />
</CARD_V2>
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
-
BloodReyvyn - Posts: 421
- Joined: 19 May 2013, 13:29
- Has thanked: 53 times
- Been thanked: 40 times
Re: Report cards error here
by sumomole » 02 Jun 2013, 13:15
I guess you use my code without my functions. You need download CONSTANTS_623.LOL from here, or you can change COMPARTMENT_ID_OBJ_SOULBOND to 623, COMPARTMENT_ID_PLR_PAIRED to 624.BloodReyvyn wrote:Well, here is the code. It was working for the longest time without errors or the errors got lost in with other card errors (I do get similar errors with other Soulbond cards, and a lot with level-up cards).
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Report cards error here
by BloodReyvyn » 02 Jun 2013, 13:33
Oh wow. 
I had the functions downloaded but never copied them into the wad like I thought I did. Thanks.

I had the functions downloaded but never copied them into the wad like I thought I did. Thanks.
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
-
BloodReyvyn - Posts: 421
- Joined: 19 May 2013, 13:29
- Has thanked: 53 times
- Been thanked: 40 times
Re: Report cards error here
by BloodReyvyn » 14 Jun 2013, 22:59
I had Damia, Sage of stone working just fine about a week ago, but lately when I have her in play, it skips my card draw during the draw step as intended (I know it's flawed since you can't actually skip the draw step), but when the Upkeep ability triggers (which it DOES trigger) it does not allow me to draw cards. I even tried changing ID's around to make sure it isn't conflicting with another mod, but have had no luck. Any help would be appreciated.
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
<FILENAME text="DAMIA_SAGE_OF_STONE_97297001" />
<CARDNAME text="DAMIA_SAGE_OF_STONE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Damia, Sage of Stone]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Damia, sage de pierre]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Damia, Sabia de Piedra]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Damia, Weise des Steins]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Damia, Saggia di Pietra]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[石の賢者、ダミーア]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Damia, Sage of Stone]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Damia, Sage of Stone]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Damia, Sage of Stone]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="97297001" />
<ARTID value="A97297001" />
<ARTIST name="Steve Argyle" />
<CASTING_COST cost="{4}{G}{U}{B}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Ask your query and be on your way. Just don’t look her in the eye.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Pose ta question et reprends ton chemin. Mais quoi que tu fasses, ne la regarde pas dans les yeux.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Haz tu pregunta y sigue tu camino. Pero no la mires a los ojos.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Stelle deine Frage und gehe wieder. Und schaue ihr nie in die Augen.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Fai la tua domanda e vattene. Ma non guardarla negli occhi.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[質問を問い、そのまま立ち去れ。 とにかく彼女の目を見るな。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Ask your query and be on your way. Just don’t look her in the eye.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Ask your query and be on your way. Just don’t look her in the eye.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Ask your query and be on your way. Just don’t look her in the eye.]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<SUPERTYPE metaname="Legendary" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Gorgon" order_fr-FR="0" order_es-ES="1" order_de-DE="0" order_it-IT="1" order_jp-JA="0" order_ko-KR="0" order_ru-RU="0" order_pt-BR="0" />
<SUB_TYPE metaname="Wizard" order_fr-FR="1" order_es-ES="0" order_de-DE="1" order_it-IT="0" order_jp-JA="1" order_ko-KR="1" order_ru-RU="1" order_pt-BR="1" />
<EXPANSION value="CMD" />
<RARITY metaname="M" />
<POWER value="4" />
<TOUGHNESS value="4" />
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Deathtouch]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Contact mortel]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Toque mortal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Todesberührung]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tocco letale]]></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[Toque mortífero]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION>
local characteristics = Object():GetCurrentCharacteristics()
characteristics:Characteristic_Set( CHARACTERISTIC_DEATHTOUCH, 1 )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY internal="1" pre_trigger="1" priority="-10">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Skip your draw step.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Sautez votre étape de pioche.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Sáltate tu paso de robar.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Übergehe dein Ziehsegment.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Salta la tua acquisizione.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたのドロー・ステップを飛ばす。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Skip your draw step.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Skip your draw step.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Skip your draw step.]]></LOCALISED_TEXT>
<TRIGGER value="DREW_CARD" simple_qualifier="controller">
if MTG():GetStep() == STEP_DRAW and EffectController():MyTurn() ~= 0 then
override = 1
return true
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your upkeep, if you have fewer than seven cards in hand, draw cards equal to the difference.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de votre entretien, si vous avez moins de sept cartes en main, piochez un nombre de cartes égal à la différence.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al comienzo de tu mantenimiento, si tienes menos de siete cartas en tu mano, roba una cantidad de cartas igual a la diferencia.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Hast du zu Beginn deines Versorgungssegments weniger als sieben Karten auf der Hand, ziehe so viele Karten, wie die Differenz beträgt.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All’inizio del tuo mantenimento, se hai meno di sette carte in mano, pesca un numero di carte pari alla differenza.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたのアップキープの開始時に、あなたの手札にあるカードが7枚未満である場合、その差分の枚数のカードを引く。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your upkeep, if you have fewer than seven cards in hand, draw cards equal to the difference.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[At the beginning of your upkeep, if you have fewer than seven cards in hand, draw cards equal to the difference.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[At the beginning of your upkeep, if you have fewer than seven cards in hand, draw cards equal to the difference.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
return ( EffectController():MyTurn() ~= 0 ) and ( MTG():GetStep() == STEP_UPKEEP )
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local cardsinhand = 0
local cardstodraw = 0
local filter = Object():GetFilter()
filter:Clear()
filter:SetZone( ZONE_HAND )
filter:SetController( EffectController() )
filter:NotTargetted()
cardsinhand = filter:Count()
if cardsinhand < 7
cardstodraw = ( 7 - cardsinhand )
PlayerDrawCards( EffectController(), cardstodraw )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<HELP title="MORE_INFO_BADGE_TITLE_3" body="MORE_INFO_BADGE_BODY_3" 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>
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
-
BloodReyvyn - Posts: 421
- Joined: 19 May 2013, 13:29
- Has thanked: 53 times
- Been thanked: 40 times
Re: Report cards error here
by BloodReyvyn » 15 Jun 2013, 07:00
Nevermind... I forgot to add "then" to my "if" statement. That got it working.
Have no idea why it worked in my test deck without it.
Have no idea why it worked in my test deck without it.
"There's an experience worse than blindness - it's the certainty that your vision is perfect and the horror that there's no world around you to see."
-
BloodReyvyn - Posts: 421
- Joined: 19 May 2013, 13:29
- Has thanked: 53 times
- Been thanked: 40 times
Who is online
Users browsing this forum: No registered users and 2 guests