Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Problem with Summoner's Pact (Card Frame Issue)
Moderator: CCGHQ Admins
Problem with Summoner's Pact (Card Frame Issue)
by RiiakShiNal » 17 Jul 2012, 02:33
I'm having a problem with summoner's pact that I'm hoping someone can help me with. I have successfully created the card, but I have been unable to get the card border to show it as Green (instead it shows as colourless).
I have already tried:
I suppose a worst case scenario would be that I put the green card frame and the illustration together as a single image and use the resulting image as the illustration, though it's a bit of a hassle and I would prefer to have a better solution.
I have already tried:
- Code: Select all
<COLOUR value="G" />
- Code: Select all
<STATIC_ABILITY active_zone="ZONE_ANY">
<!-- Localized Text Omitted -->
<CONTINUOUS_ACTION>
Object():GetCurrentCharacteristics():Colour_Add( COLOUR_GREEN )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
I suppose a worst case scenario would be that I put the green card frame and the illustration together as a single image and use the resulting image as the illustration, though it's a bit of a hassle and I would prefer to have a better solution.
- Complete Card Code | Open
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="SUMMONERS_PACT_130706" />
<CARDNAME text="SUMMONERS_PACT" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Summoner's Pact]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Pacte de l'invocateur]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Pacto del invocador]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Pakt der Beschwörer]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Patto dell'Evocatore]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[召喚士の契約]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Summoner's Pact]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Договор Вызывателя]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Pacto do Invocador]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="130706" />
<ARTID value="RSN130706" />
<ARTIST name="Chippy" />
<COLOUR value="G" />
<CASTING_COST cost="{0}" />
<TYPE metaname="Instant" />
<EXPANSION value="FUT" />
<RARITY metaname="R" />
<STATIC_ABILITY active_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Summoner's Pact is green.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Le Pacte de l'invocateur est vert.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El Pacto del invocador es verde.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Der Pakt der Beschwörer ist grün.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Il Patto dell'Evocatore è verde.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[召喚士の契約は緑である。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Summoner's Pact is green.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Договор Вызывателя зеленый.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Pacto do Invocador é verde.]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION>
Object():GetCurrentCharacteristics():Colour_Add( COLOUR_GREEN )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<SPELL_ABILITY filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Search your library for a green creature card, reveal it, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Cherchez dans votre bibliothèque une carte de créature verte, révélez-la et mettez-la dans votre main. Mélangez ensuite votre bibliothèque.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Busca en tu biblioteca una carta de criatura verde, muéstrala y ponla en tu mano. Luego baraja tu biblioteca.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Durchsuche deine Bibliothek nach einer grünen Kreaturenkarte, zeige sie offen vor und nimm sie auf deine Hand. Mische danach deine Bibliothek.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Passa in rassegna il tuo grimorio per una carta creatura verde, rivelala e aggiungila alla tua mano. Poi rimescola il tuo grimorio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたのライブラリーから緑のクリーチャー・カードを1枚探し、それを公開してあなたの手札に加える。 その後あなたのライブラリーを切り直す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Search your library for a green creature card, reveal it, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Найдите в вашей библиотеке карту зеленого существа, покажите ее и положите в вашу руку. Затем перетасуйте вашу библиотеку.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Procure em seu grimório por um card de criatura verde, revele-o e coloque-o em sua mão. Depois, embaralhe seu grimório.]]></LOCALISED_TEXT>
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:SetZone( ZONE_LIBRARY )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:AddColour( COLOUR_GREEN )
filter:SetPlayer( EffectController() )
filter:SetHint( HINT_ALLIED_ONLY, EffectController() )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_INTO_HAND", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
EffectController():PlayerDataChest():Set_ProtectedCardPtr( REGISTER_SUMMONERS_PACT, Object() )
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if ( target ~= nil ) then
target:PutInHand()
end
EffectController():ShuffleLibrary()
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
<TRIGGERED_ABILITY active_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your next upkeep, pay {2}{G}{G}. If you don't, you lose the game.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de votre prochain entretien, payez {2}{G}{G}. Si vous ne le faites pas, vous perdez la partie.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al comienzo de tu próximo mantenimiento, paga {2}{G}{G}. Si no lo haces, pierdes el juego.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bezahle zu Beginn deines nächsten Versorgungssegments {2}{G}{G}. Falls du dies nicht tust, verlierst du das Spiel.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All'inizio del tuo prossimo mantenimento, paga {2}{G}{G}. Se non lo fai, perdi la partita.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたの次のアップキープの開始時に、{2}{G}{G}を支払う。 そうしない場合、あなたはこのゲームに敗北する。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your next upkeep, pay {2}{G}{G}. If you don't, you lose the game.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В начале вашего следующего шага поддержки заплатите {2}{G}{G}. Если вы этого не делаете, вы проигрываете партию.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No início de sua próxima manutenção, pague {2}{G}{G}. Se não o fizer, você perde o jogo.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_STEP">
return RSN_Step( STEP_UPKEEP ) and
(TriggerPlayer():MyTurn() ~= 0) and
(TriggerPlayer():PlayerDataChest():Get_ProtectedCardPtr( REGISTER_SUMMONERS_PACT ) == Object())
</TRIGGER>
<COST type="Mana" cost="{2}{G}{G}" qualifier="conditional" />
<RESOLUTION_TIME_ACTION>
TriggerPlayer():PlayerDataChest():Set_ProtectedCardPtr( REGISTER_SUMMONERS_PACT, nil )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION conditional="else">
TriggerPlayer():PlayerDataChest():Set_ProtectedCardPtr( REGISTER_SUMMONERS_PACT, nil )
TriggerPlayer():LoseGame()
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
</CARD_V2>
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by thefiremind » 17 Jul 2012, 09:00
That's the same thing I would have tried, since it works for tokens... maybe the COLOUR block works only on tokens, or only when there's no mana cost at all. I'm afraid this is another limitation of DotP2013 and we can't overcome it.RiiakShiNal wrote:I have already tried:
- Code: Select all
<COLOUR value="G" />
< 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: 721 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by RiiakShiNal » 17 Jul 2012, 11:43
I guess for now I'll just have to live with combining the frame and illustration together as the illustration it's not perfect but at least it looks fairly close to correct.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by thefiremind » 17 Jul 2012, 11:58
Speaking about the code... why didn't you make the payment ability as a delayed trigger? I noticed I have become too fond of delayed triggers and I would put them everywhere but this seems the perfect situation for them in my opinion.
I also think that the payment should be mandatory when it can be afforded (pretty much like sacrifices for Lord of the Pit), and searching in libraries usually doesn't use TARGET_DEFINITION, TARGET_DETERMINATION and PLAY_TIME_ACTION. Putting all things together, my code would be:
I also think that the payment should be mandatory when it can be afforded (pretty much like sacrifices for Lord of the Pit), and searching in libraries usually doesn't use TARGET_DEFINITION, TARGET_DETERMINATION and PLAY_TIME_ACTION. Putting all things together, my code would be:
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="SUMMONERS_PACT_130706" />
<CARDNAME text="SUMMONERS_PACT" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Summoner's Pact]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Pacte de l'invocateur]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Pacto del invocador]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Pakt der Beschwörer]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Patto dell'Evocatore]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[召喚士の契約]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Summoner's Pact]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Договор Вызывателя]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Pacto do Invocador]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="130706" />
<ARTID value="RSN130706" />
<ARTIST name="Chippy" />
<COLOUR value="G" />
<CASTING_COST cost="{0}" />
<TYPE metaname="Instant" />
<EXPANSION value="FUT" />
<RARITY metaname="R" />
<STATIC_ABILITY filter_zone="ZONE_ANY" active_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Summoner's Pact is green.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Le Pacte de l'invocateur est vert.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El Pacto del invocador es verde.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Der Pakt der Beschwörer ist grün.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Il Patto dell'Evocatore è verde.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[召喚士の契約は緑である。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Summoner's Pact is green.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Договор Вызывателя зеленый.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Pacto do Invocador é verde.]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION>
Object():GetCurrentCharacteristics():Colour_Add( COLOUR_GREEN )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Search your library for a green creature card, reveal it, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Cherchez dans votre bibliothèque une carte de créature verte, révélez-la et mettez-la dans votre main. Mélangez ensuite votre bibliothèque.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Busca en tu biblioteca una carta de criatura verde, muéstrala y ponla en tu mano. Luego baraja tu biblioteca.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Durchsuche deine Bibliothek nach einer grünen Kreaturenkarte, zeige sie offen vor und nimm sie auf deine Hand. Mische danach deine Bibliothek.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Passa in rassegna il tuo grimorio per una carta creatura verde, rivelala e aggiungila alla tua mano. Poi rimescola il tuo grimorio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたのライブラリーから緑のクリーチャー・カードを1枚探し、それを公開してあなたの手札に加える。 その後あなたのライブラリーを切り直す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Search your library for a green creature card, reveal it, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Найдите в вашей библиотеке карту зеленого существа, покажите ее и положите в вашу руку. Затем перетасуйте вашу библиотеку.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Procure em seu grimório por um card de criatura verde, revele-o e coloque-o em sua mão. Depois, embaralhe seu grimório.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
local filter = Object():GetFilter()
EffectController():MarkSearchedLibrary()
filter:Clear()
filter:NotTargetted()
filter:SetZone( ZONE_LIBRARY )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:AddColour( COLOUR_GREEN )
filter:SetPlayer( EffectController() )
EffectController():ChooseTarget( NO_VALIDATION, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_INTO_HAND", EffectDC():Make_Targets(0) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if ( target ~= nil ) then
target:PutInHand()
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
EffectController():ShuffleLibrary()
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your next upkeep, pay {2}{G}{G}. If you don't, you lose the game.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de votre prochain entretien, payez {2}{G}{G}. Si vous ne le faites pas, vous perdez la partie.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al comienzo de tu próximo mantenimiento, paga {2}{G}{G}. Si no lo haces, pierdes el juego.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bezahle zu Beginn deines nächsten Versorgungssegments {2}{G}{G}. Falls du dies nicht tust, verlierst du das Spiel.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All'inizio del tuo prossimo mantenimento, paga {2}{G}{G}. Se non lo fai, perdi la partita.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたの次のアップキープの開始時に、{2}{G}{G}を支払う。 そうしない場合、あなたはこのゲームに敗北する。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your next upkeep, pay {2}{G}{G}. If you don't, you lose the game.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В начале вашего следующего шага поддержки заплатите {2}{G}{G}. Если вы этого не делаете, вы проигрываете партию.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No início de sua próxima manutenção, pague {2}{G}{G}. Se não o fizer, você perde o jogo.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_PlayerPtr(0, EffectController())
MTG():CreateDelayedTrigger(1, delayDC)
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
<TRIGGERED_ABILITY resource_id="1" active_zone="ZONE_ANY">
<TRIGGER value="BEGINNING_OF_STEP" simple_qualifier="controller">
local player = EffectDC():Get_PlayerPtr(0)
if player ~= nil then
return MTG():GetStep() == STEP_UPKEEP and player:MyTurn() ~= 0
end
return false
</TRIGGER>
<CLEANUP fire_once="1" />
<RESOLUTION_TIME_ACTION>
local player = EffectDC():Get_PlayerPtr(0)
if player ~= nil then
if player:CanAfford("{2}{G}{G}") == 1 then
player:TapLand("{2}{G}{G}")
else
player:LoseGame()
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
</CARD_V2>
Last edited by thefiremind on 17 Jul 2012, 12:22, edited 2 times 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: 721 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by RiiakShiNal » 17 Jul 2012, 12:12
Actually I've never used a delayed trigger (DotP 2010 didn't have them) so I didn't even think about it. I'll convert it over and test it again to make sure it still works with a delayed trigger.thefiremind wrote:Speaking about the code... why didn't you make the payment ability as a delayed trigger? I noticed I have become too fond of delayed triggers and I would put them everywhere but this seems the perfect situation for them in my opinion.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by thefiremind » 17 Jul 2012, 12:21
I edited the post above with the code as I would write it, while you were answering.
< 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: 721 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by RiiakShiNal » 17 Jul 2012, 14:05
I missed your edit and subsequent post as I was re-writing mine (and Luminesce, Quest for Pure Flame, and Skeletonize) to use delayed triggers. Though I do prefer your method of checking to see if the player can afford the cost instead of using the COST tag with qualifier conditional. So after looking at my re-written card and yours I changed it again to use bits of both as below:
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="SUMMONERS_PACT_130706" />
<CARDNAME text="SUMMONERS_PACT" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Summoner's Pact]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Pacte de l'invocateur]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Pacto del invocador]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Pakt der Beschwörer]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Patto dell'Evocatore]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[召喚士の契約]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Summoner's Pact]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Договор Вызывателя]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Pacto do Invocador]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="130706" />
<ARTID value="RSN130706" />
<ARTIST name="Chippy" />
<COLOUR value="G" />
<CASTING_COST cost="{0}" />
<TYPE metaname="Instant" />
<EXPANSION value="FUT" />
<RARITY metaname="R" />
<STATIC_ABILITY active_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Summoner's Pact is green.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Le Pacte de l'invocateur est vert.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El Pacto del invocador es verde.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Der Pakt der Beschwörer ist grün.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Il Patto dell'Evocatore è verde.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[召喚士の契約は緑である。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Summoner's Pact is green.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Договор Вызывателя зеленый.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Pacto do Invocador é verde.]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION>
Object():GetCurrentCharacteristics():Colour_Add( COLOUR_GREEN )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<SPELL_ABILITY filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Search your library for a green creature card, reveal it, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Cherchez dans votre bibliothèque une carte de créature verte, révélez-la et mettez-la dans votre main. Mélangez ensuite votre bibliothèque.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Busca en tu biblioteca una carta de criatura verde, muéstrala y ponla en tu mano. Luego baraja tu biblioteca.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Durchsuche deine Bibliothek nach einer grünen Kreaturenkarte, zeige sie offen vor und nimm sie auf deine Hand. Mische danach deine Bibliothek.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Passa in rassegna il tuo grimorio per una carta creatura verde, rivelala e aggiungila alla tua mano. Poi rimescola il tuo grimorio.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたのライブラリーから緑のクリーチャー・カードを1枚探し、それを公開してあなたの手札に加える。 その後あなたのライブラリーを切り直す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Search your library for a green creature card, reveal it, and put it into your hand. Then shuffle your library.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Найдите в вашей библиотеке карту зеленого существа, покажите ее и положите в вашу руку. Затем перетасуйте вашу библиотеку.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Procure em seu grimório por um card de criatura verde, revele-o e coloque-o em sua mão. Depois, embaralhe seu grimório.]]></LOCALISED_TEXT>
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:SetZone( ZONE_LIBRARY )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:AddColour( COLOUR_GREEN )
filter:SetPlayer( EffectController() )
filter:SetHint( HINT_ALLIED_ONLY, EffectController() )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_INTO_HAND", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if ( target ~= nil ) then
target:PutInHand()
end
EffectController():ShuffleLibrary()
MTG():CreateDelayedTrigger( 1, EffectDC() )
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
<TRIGGERED_ABILITY resource_id="1" active_zone="ZONE_ANY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[At the beginning of your next upkeep, pay {2}{G}{G}. If you don't, you lose the game.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au début de votre prochain entretien, payez {2}{G}{G}. Si vous ne le faites pas, vous perdez la partie.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Al comienzo de tu próximo mantenimiento, paga {2}{G}{G}. Si no lo haces, pierdes el juego.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bezahle zu Beginn deines nächsten Versorgungssegments {2}{G}{G}. Falls du dies nicht tust, verlierst du das Spiel.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[All'inizio del tuo prossimo mantenimento, paga {2}{G}{G}. Se non lo fai, perdi la partita.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたの次のアップキープの開始時に、{2}{G}{G}を支払う。 そうしない場合、あなたはこのゲームに敗北する。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[At the beginning of your next upkeep, pay {2}{G}{G}. If you don't, you lose the game.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[В начале вашего следующего шага поддержки заплатите {2}{G}{G}. Если вы этого не делаете, вы проигрываете партию.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[No início de sua próxima manutenção, pague {2}{G}{G}. Se não o fizer, você perde o jogo.]]></LOCALISED_TEXT>
<CLEANUP fire_once="1" />
<TRIGGER value="BEGINNING_OF_STEP">
return MyUpkeep()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if (TriggerPlayer() ~= nil) then
if (TriggerPlayer():CanAfford( "{2}{G}{G}" ) ~= 0) then
TriggerPlayer():TapLand( "{2}{G}{G}" )
else
TriggerPlayer():LoseGame()
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
</CARD_V2>
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by thefiremind » 17 Jul 2012, 14:43
If you leave the localised text directly into the delayed trigger, doesn't it prevent the text from displaying?
And I still think that my method is more exact somehow: first, you should be able to play search-library effects even when your library doesn't contain what you can search for, but if you enforce target determination, this won't be true; second, I'm not sure that the player who played the spell will be the same as the TriggerPlayer of the triggered ability in all cases, for example someone else could play your Summoner's Pact through Chancellor of the Spires, and you shouldn't be forced to pay for that player.
And I still think that my method is more exact somehow: first, you should be able to play search-library effects even when your library doesn't contain what you can search for, but if you enforce target determination, this won't be true; second, I'm not sure that the player who played the spell will be the same as the TriggerPlayer of the triggered ability in all cases, for example someone else could play your Summoner's Pact through Chancellor of the Spires, and you shouldn't be forced to pay for that player.
It's not a matter of preference: this is coherent with the card. If the card said "you may pay", then it would have been correct, but it says "pay" (imperative), so that if you can pay, you have no choice. It would be relevant if you had a Platinum Angel out and you couldn't care less about effects that make you lose the game.RiiakShiNal wrote:Though I do prefer your method of checking to see if the player can afford the cost instead of using the COST tag with qualifier conditional.
< 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: 721 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by RiiakShiNal » 17 Jul 2012, 15:12
It does, my mistake.thefiremind wrote:If you leave the localised text directly into the delayed trigger, doesn't it prevent the text from displaying?
In that case you are probably right, I guess I was only considering effects that would allow the spell to be copied (in which case the TriggerPlayer() method would work).thefiremind wrote:And I still think that my method is more exact somehow: first, you should be able to play search-library effects even when your library doesn't contain what you can search for, but if you enforce target determination, this won't be true; second, I'm not sure that the player who played the spell will be the same as the TriggerPlayer of the triggered ability in all cases, for example someone else could play your Summoner's Pact through Chancellor of the Spires, and you shouldn't be forced to pay for that player.
I understand that, but you also need to understand I'm still very used to the way DotP 2010 worked (it's going to take me some time to adjust to DotP 2013 completely) and there trying to tap lands (appropriately) for the player automatically was much more difficult (the way Wizard's coded Summoner's Pact there was in fact using the conditional cost method). Though I do understand that the cost was meant to be mandatory which was specifically why I "preferred" your method, though maybe I should have used a different word/phrase to describe what I meant there.thefiremind wrote:It's not a matter of preference: this is coherent with the card. If the card said "you may pay", then it would have been correct, but it says "pay" (imperative), so that if you can pay, you have no choice. It would be relevant if you had a Platinum Angel out and you couldn't care less about effects that make you lose the game.
I have made the necessary corrections though I don't think I need to post my corrected code now as it is almost identical to yours save that I used one of my preexisting functions (RSN_PlayersStep) to reduce the code on the trigger of the delayed trigger.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by thefiremind » 17 Jul 2012, 15:33
Yes, I see... I took a look at how DotP2010 cards were coded, and it was really a lot different. I started modding with DotP2012 and I can imagine that the passage to DotP2013 has been far less traumatic than it would have been if I were starting from DotP2010.
< 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: 721 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by RiiakShiNal » 17 Jul 2012, 15:51
Yeah, as such when I see something that makes my life easier, a better way to code something, or a more correct way to code something than I saw/did before I try to make the change (even going back and "upgrading" cards I've already written and tested when I can remember which ones I used something in), but sometimes noticing the differences can take a while as well (especially since several of the work-arounds I used in DotP 2010 still work in DotP 2013).
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by BlindWillow » 19 Jul 2012, 04:12
I just performed a test myself giving Pacifism (I'm currently toying around with cards for a white deck, so it was handy) and <COLOUR value="W" /> worked when I changed Pacifism to cost . Before adding the colour tag it looked like an Eldrazi card, but when I added <COLOUR value="W" /> (I put it directly after the casting cost tag, if that makes a difference) it showed up with a white frame (in both deck editor and game).
- BlindWillow
- Posts: 213
- Joined: 19 Jul 2012, 00:26
- Has thanked: 11 times
- Been thanked: 46 times
Re: Problem with Summoner's Pact (Card Frame Issue)
by RiiakShiNal » 19 Jul 2012, 15:22
Putting it after the casting cost works, but putting it before doesn't. Thanks, now Summoner's pact is showing up properly (and probably doesn't need the hack to add colour in the first ability).BlindWillow wrote:I just performed a test myself giving Pacifism (I'm currently toying around with cards for a white deck, so it was handy) and <COLOUR value="W" /> worked when I changed Pacifism to cost . Before adding the colour tag it looked like an Eldrazi card, but when I added <COLOUR value="W" /> (I put it directly after the casting cost tag, if that makes a difference) it showed up with a white frame (in both deck editor and game).
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
13 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 31 guests