Re: Formal Request Thread
I know, but I was suggesting a way to make the code cleaner. And you can't see the problem with proliferate until you try a card with proliferate.
EDIT: It seems that "-11" does the trick. Updating the previous post.
High Quality Resources for Collectible Card Games and Home of the CCGHQ Team
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=109&t=11010
I know, but I was suggesting a way to make the code cleaner. And you can't see the problem with proliferate until you try a card with proliferate.
Sorry, that was because, I was having some problems with it after trying to fix it. I wasn't sure what was causing the issues, so I decided to copy Jund Charm and change it bit by bit until I found why it wasn't working. I was too tired to spot the reason the original wasn't working, though. Thefiremind already pointed it out, it was because the target tags had duplicate ids/compartments. The second ability's actual code was fine, and so it wasn't changed. It wasn't working, but it wasn't the ability's code itself that was messed up. This seems to have all the second two modes working (didn't test the first).Master Necro wrote:@ Xander9009:
Dizzy spell works!
But I do not understand what are you doing to Dimir Charm, the problem is in the second ability, this part of the code:
[code...code]
That part doesn't respond correctly and it seams you want to change everything except that.
I never think about protecting a card. That would have taken me forever to realizethefiremind wrote:Mortus Strider needs to have its EffectSource() protected if you want to be able to address it after zone change. The ZONECHANGE_BEGIN trigger is triggered when the zone change hasn't happened yet, but resolution happens after the zone change anyway.
Well, that's easier than expected. That's always nice.thefiremind wrote:It seems that "-11" does the trick. Updating the previous post.
Thanks and thanks for the lesson.thefiremind wrote:NOTE: Post subject to edits, I just turned the PC on and I missed a lot of posts here so I'll approach them one step at a time.
About Bloodletter Quill, you can code the blood counter addition in an easier way: the game doesn't support only RemoveCounters as standard cost, but also AddCounters. Try this instead of the generic cost:There's another small problem: blood counters are "bad" counters, so you don't want to proliferate them on yourself. Change proliferate="11" with proliferate="-11".
- Code: Select all
<COST type="AddCountersSelf" item_count="1" amount="1" counter_type="Blood" />For those who don't know, this is rule-compliant: targets always need to be declared before resolution, but everything else happens on resolution, so even if it's a bit weird, you need to choose your target before you actually decide if you'll make something to that target.BloodReyvyn wrote:I am having an issue with my Drowner Initiate. It asks me for a target before I even pay the(which I know is because it calls that first)
And about the resource cost, if you want to avoid using the UTILITY_ABILITY you can use CanPayManaCost("{1}") and PayManaCost("{1}"). As far as I know there are no differences, aside from the UTILITY_ABILITY making the code easily reusable because you need to change the cost only in one place.
Mortus Strider needs to have its EffectSource() protected if you want to be able to address it after zone change. The ZONECHANGE_BEGIN trigger is triggered when the zone change hasn't happened yet, but resolution happens after the zone change anyway. So:(Of course you can skip the comments
- Code: Select all
<TRIGGER value="ZONECHANGE_BEGIN" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIELD">
-- This happens BEFORE zone change
EffectDC():Protect_CardPtr(COMPARTMENT_ID_EFFECT_SOURCE)
return true
</TRIGGER>
<RESOLUTION_TIME_ACTION>
-- This happens AFTER zone change
if EffectSource() ~= nil then
EffectSource():PutInHand()
end
</RESOLUTION_TIME_ACTION>)
Dimir Charm is a mess, you need to put each different target in a different compartment and give each TARGET_DEFINITION a different ID, matching them with their TARGET blocks after that.
I made a picture that should help understanding... at least I hope so!
It's the code from Jund Charm (official card), and I linked the IDs that match:(Click to enlarge)
Thanks man.Xander9009 wrote:Sorry, that was because, I was having some problems with it after trying to fix it. I wasn't sure what was causing the issues, so I decided to copy Jund Charm and change it bit by bit until I found why it wasn't working. I was too tired to spot the reason the original wasn't working, though. Thefiremind already pointed it out, it was because the target tags had duplicate ids/compartments. The second ability's actual code was fine, and so it wasn't changed. It wasn't working, but it wasn't the ability's code itself that was messed up. This seems to have all the second two modes working (didn't test the first).Master Necro wrote:@ Xander9009:
Dizzy spell works!
But I do not understand what are you doing to Dimir Charm, the problem is in the second ability, this part of the code:
[code...code]
That part doesn't respond correctly and it seams you want to change everything except that.
-----I never think about protecting a card. That would have taken me forever to realizethefiremind wrote:Mortus Strider needs to have its EffectSource() protected if you want to be able to address it after zone change. The ZONECHANGE_BEGIN trigger is triggered when the zone change hasn't happened yet, but resolution happens after the zone change anyway.

<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="MERROW_REEJEREY_139702" />
<CARDNAME text="MERROW_REEJEREY" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Merrow Reejerey]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Reejerey suire]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Reejerey merrow]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Merrow-Rittersmann]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Reejerey Merrow]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[メロウの騎兵]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Merrow Reejerey]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Вожак Мерроу]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Reejerey Sirenídeo]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="139702" />
<ARTID value="139702" />
<ARTIST name="Greg Staples" />
<CASTING_COST cost="{2}{U}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Steady and silent as the deep current, the reejerey guides the course of the school.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Aussi stable et silencieux que le courant profond, le reejerey guide la course du banc.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Firme y silencioso como la corriente profunda, el reejerey guía a todo el cardumen.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Still und stetig wie die Tiefenströmung leitet der Rittersmann den Schwarm in die richtige Richtung.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Saldo e silenzioso come la corrente più profonda, il reejerey guida il corso del suo banco.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[騎兵は流れの深みのように、静かに確実に群れを導いていく。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Steady and silent as the deep current, the reejerey guides the course of the school.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Уверенный и молчаливый, как глубоководное течение, вожак плывет впереди стаи.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Estáveis e silenciosos como as correntes profundas, os reejerey orientam o curso do cardume.]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Merfolk" />
<SUB_TYPE metaname="Soldier" />
<EXPANSION value="LRW" />
<RARITY metaname="U" />
<POWER value="2" />
<TOUGHNESS value="2" />
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Other Merfolk creatures you control get +1/+1.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les autres créatures Ondin que vous contrôlez gagnent +1/+1.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Las otras criaturas Tritón que controlas obtienen +1/+1.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Andere Meervolkkreaturen, die du kontrollierst, erhalten +1/+1.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le altre creature Tritone che controlli prendono +1/+1.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがコントロールする他のマーフォーク・クリーチャーは+1/+1の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Other Merfolk creatures you control get +1/+1.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Другие существа-Мерфолки под вашим контролем получают +1/+1.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[As outras criaturas do tipo Tritão que você controla recebem +1/+1.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add(FE_CARD_INSTANCE, OP_NOT, EffectSource() )
filter:Add(FE_SUBTYPE, OP_IS, CREATURE_TYPE_MERFOLK)
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
filter:Add(FE_CONTROLLER, OP_IS, EffectController() )
</FILTER>
<CONTINUOUS_ACTION layer="7C" filter_id="0">
if FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:Power_Add( 1 )
characteristics:Toughness_Add( 1 )
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever you cast a Merfolk spell, you may tap or untap target permanent.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que vous jouez un sort d’ondin, vous pouvez engager ou dégager le permanent ciblé.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que juegues un hechizo de Tritón, puedes enderezar o girar el permanente objetivo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn du einen Meervolk-Zauberspruch spielst, kannst du eine bleibende Karte deiner Wahl tappen oder enttappen.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta lanci una magia Tritone, puoi TAPpare o STAPpare un permanente bersaglio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたがいずれかのマーフォーク呪文をプレイするたび、パーマネント1つを対象とする。あなたはそれをタップまたはアンタップしてもよい。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever you cast a Merfolk spell, you may tap or untap target permanent.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда вы разыгрываете заклинание Мерфолка, вы можете повернуть или развернуть целевой перманент.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que você joga uma mágica de Tritão, você pode virar ou desvirar a permanente alvo.]]></LOCALISED_TEXT>
<TRIGGER value="SPELL_PLAYED" simple_qualifier="objectyoucontrol">
return TriggerObject():GetSubtype():Test( CREATURE_TYPE_MERFOLK )
</TRIGGER>
<TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_TO_TAP_OR_UNTAP" definition="0" compartment="0" count="1" />
<RESOLUTION_TIME_ACTION>
local effectController = EffectController()
if effectController ~= nil then
effectController:BeginNewMultipleChoice()
effectController:AddMultipleChoiceAnswer( "CARD_QUERY_MERROW_REEJEREY_TAP_PERMANENT" )
effectController:AddMultipleChoiceAnswer( "CARD_QUERY_MERROW_REEJEREY_UNTAP_PERMANENT" )
effectController:AskMultipleChoiceQuestion( "CARD_QUERY_MERROW_REEJEREY_QUESTION", TriggerObject() )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local result = effectController:GetMultipleChoiceResult()
if result == 0 then
target:Tap()
else
target:Untap()
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<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> <TARGET tag="CARD_QUERY_CHOOSE_PERMANENT_TO_TAP_OR_UNTAP" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add(FE_IS_PERMANENT, true)
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
if target:IsTapped() then
target:Untap()
else
target:Tap()
end
end
</RESOLUTION_TIME_ACTION>
<MAY tag="DO_YOU_WANT_TO_TAP_OR_UNTAP_THIS_PERMANENT" always_prompt="1" />
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_NEUTRAL" />I think it is. My only doubt is if the AI can understand how to use it.BloodReyvyn wrote:EDIT: I was also wondering if Grimoire Thief was possible in 2014.
just noticed orzhov charm 2nd and 3rd ability doesn't work.. does anybody see what could be wrong ? thxsumomole wrote:Untesteddrleg3nd wrote:hey guys this is my first attempt at coding.. or learning how to copy and paste(whichever you prefer)..can you guys help me out on how to code these cards I would really appreciate it .thx
- Path To Bravery | Open
Sorry, the second ability numbers is wrong, and third ability is ok.drleg3nd wrote:just noticed orzhov charm 2nd and 3rd ability doesn't work.. does anybody see what could be wrong ? thx
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_DESTROY" definition="1" compartment="1" mode="2" count="1" />
<TARGET_DEFINITION id="1">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION mode="2">
local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
if target ~= nil then
local toughness = target:GetCurrentCharacteristics():Toughness_Get()
EffectDC():Set_Int( 3, toughness )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION mode="2">
local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
if target ~= nil then
target:Destroy()
end
</RESOLUTION_TIME_ACTION>local target = EffectDC():Get_Targets(1):Get_PlayerPtr(0)