Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
New MTG Cards and Decks
2013
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
New MTG Cards and Decks
2013
[Card help needed] Glimpse of Nature
Moderators: Xander9009, CCGHQ Admins
[Card help needed] Glimpse of Nature
by kevorz » 06 Aug 2012, 16:16
Hey all,
I'm currently trying to recreate Glimpse of Nature, anyhow i figured i should take Primordial Sage as an example, but it's not really working out for me at all.
My Glimpse of Nature just draws one card this way, and nothing happens when i cast a creature afterwards.
Thanks alot for your patience and expertise
Greets,
Kevorz
I'm currently trying to recreate Glimpse of Nature, anyhow i figured i should take Primordial Sage as an example, but it's not really working out for me at all.
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="GLIMPSE_OF_NATURE_75241" />
<CARDNAME text="GLIMPSE_OF_NATURE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Glimpse of Nature]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Glimpse of Nature]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Glimpse of Nature]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Glimpse of Nature]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Glimpse of Nature]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Glimpse of Nature]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Glimpse of Nature]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Glimpse of Nature]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Glimpse of Nature]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="75241" />
<ARTID value="75241" />
<ARTIST name="Shishizaru" />
<CASTING_COST cost="{G}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Dosan sat in repose for many hours. He made no motion, no sound at all. And as he sat, nature revealed itself to him.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Dosan sat in repose for many hours. He made no motion, no sound at all. And as he sat, nature revealed itself to him.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Dosan sat in repose for many hours. He made no motion, no sound at all. And as he sat, nature revealed itself to him.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Dosan sat in repose for many hours. He made no motion, no sound at all. And as he sat, nature revealed itself to him.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Dosan sat in repose for many hours. He made no motion, no sound at all. And as he sat, nature revealed itself to him.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Dosan sat in repose for many hours. He made no motion, no sound at all. And as he sat, nature revealed itself to him.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Dosan sat in repose for many hours. He made no motion, no sound at all. And as he sat, nature revealed itself to him.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Dosan sat in repose for many hours. He made no motion, no sound at all. And as he sat, nature revealed itself to him.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Dosan sat in repose for many hours. He made no motion, no sound at all. And as he sat, nature revealed itself to him.]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Sorcery" />
<EXPANSION value="DPG" />
<RARITY metaname="R" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<TRIGGER value="SPELL_PLAYED" simple_qualifier="objectyoucontrol">
return TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0
</TRIGGER>
<RESOLUTION_TIME_ACTION>
EffectController():DrawCard()
</RESOLUTION_TIME_ACTION>
<DURATION simple_duration="UntilEOT" />
</SPELL_ABILITY>
</CARD_V2>
My Glimpse of Nature just draws one card this way, and nothing happens when i cast a creature afterwards.
Thanks alot for your patience and expertise
Greets,
Kevorz
Re: [Card help needed] Glimpse of Nature
by thefiremind » 06 Aug 2012, 16:34
That card gave some modders a hard time in DotP2012, but in DotP2013 we have my favorite new feature: delayed triggers. 
Before posting the code, I'll tell you that inserting a TRIGGER block inside something that isn't a TRIGGERED_ABILITY will never work.
Substitute your SPELL_ABILITY with this:
EDIT: sorry, I forgot to write the check for a creature spell. Now the code is OK.
Before posting the code, I'll tell you that inserting a TRIGGER block inside something that isn't a TRIGGERED_ABILITY will never work.
Substitute your SPELL_ABILITY with this:
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta lanci una magia creatura in questo turno, pesca una carta.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn du in diesem Zug einen Kreaturenzauber wirkst, ziehe eine Karte.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que vous lancez un sort de créature ce tour-ci, piochez une carte.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que lances una carta de criatura este turno, roba una carta.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[このターン、あなたがクリーチャー呪文をプレイするたび、カードを1枚引く。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever you cast a creature spell this turn, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que você conjurar uma mágica de criatura neste turno, compre um card.]]></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 auto_skip="1" resource_id="1">
<CLEANUP simple_cleanup="EndOfTurn" />
<TRIGGER value="SPELL_PLAYED">
local player = EffectDC():Get_PlayerPtr(0)
return player ~= nil and TriggerObject():GetPlayer() == player and
TriggerObject():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local player = EffectDC():Get_PlayerPtr(0)
local NumCards = 1
while (NumCards > 0) do
NumCards = NumCards - 1
player:DrawCard()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
EDIT: sorry, I forgot to write the check for a creature spell. Now the code is OK.
< 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: 719 times
Re: [Card help needed] Glimpse of Nature
by kevorz » 06 Aug 2012, 16:45
Thank you for your response!
Just a quick question, does the resource_id="1" equal a Creature? I'm just trying to understand the code so i can learn more ^^
EDIT: oops :p asked a question before you edited the code, what does the resource_id stand for anyway?
Just a quick question, does the resource_id="1" equal a Creature? I'm just trying to understand the code so i can learn more ^^
EDIT: oops :p asked a question before you edited the code, what does the resource_id stand for anyway?
Re: [Card help needed] Glimpse of Nature
by RiiakShiNal » 06 Aug 2012, 18:18
The resource_id is a way to reference a specific ability such as granting an ability or for delayed triggers (as in the code above). When you have an ability that has a resource_id that ability itself doesn't do anything unless it is granted or used for a 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: 2160
- Joined: 16 May 2011, 21:37
- Has thanked: 74 times
- Been thanked: 483 times
Re: [Card help needed] Glimpse of Nature
by kevorz » 06 Aug 2012, 19:37
Thank you for the insight
//Request move to the correct forum (Programming?)
//Request move to the correct forum (Programming?)
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests
