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



Talk about new cards here
Moderator: CCGHQ Admins
Re: Talk about new cards here
by Niah » 30 Oct 2012, 17:59
i created card/xml with lotleth troll and Abrupt Decay but i can't paste here :/
Re: Talk about new cards here
by Niah » 30 Oct 2012, 18:02
sorry for the spam
Lotleth Troll
Lotleth Troll
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="LOTLETH_TROLL_23173" />
<CARDNAME text="LOTLETH_TROLL" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Lotleth Troll]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Lotleth Troll]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Lotleth Troll]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Lotleth Troll]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Lotleth Troll]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Lotleth Troll]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Lotleth Troll]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Lotleth Troll]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Lotleth Troll]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="23173" />
<ARTID value="2" />
<ARTIST name=" Vincent Proce" />
<CASTING_COST cost="{B}{G}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[He lurks in the undercity, eager for the corpse haulers to unload their rotting cargo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[He lurks in the undercity, eager for the corpse haulers to unload their rotting cargo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[He lurks in the undercity, eager for the corpse haulers to unload their rotting cargo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[He lurks in the undercity, eager for the corpse haulers to unload their rotting cargo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[He lurks in the undercity, eager for the corpse haulers to unload their rotting cargo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[He lurks in the undercity, eager for the corpse haulers to unload their rotting cargo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[He lurks in the undercity, eager for the corpse haulers to unload their rotting cargo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[He lurks in the undercity, eager for the corpse haulers to unload their rotting cargo.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[He lurks in the undercity, eager for the corpse haulers to unload their rotting cargo.]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Zombie" 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="Troll" 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="R" />
<POWER value="2" />
<TOUGHNESS value="1" />
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Trample]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Trample]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Trample]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Trample]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Trample]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Trample]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Trample]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Trample]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Trample]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION>
local characteristics = Object():GetCurrentCharacteristics()
characteristics:Characteristic_Set( CHARACTERISTIC_TRAMPLE, 1 )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Discard a creature card: Put a +1/+1 counter on Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Discard a creature card: Put a +1/+1 counter on Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Discard a creature card: Put a +1/+1 counter on Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Discard a creature card: Put a +1/+1 counter on Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Discard a creature card: Put a +1/+1 counter on Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Discard a creature card: Put a +1/+1 counter on Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Discard a creature card: Put a +1/+1 counter on Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Discard a creature card: Put a +1/+1 counter on Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Discard a creature card: Put a +1/+1 counter on Lotleth Troll.]]></LOCALISED_TEXT>
<COST type="Discard">
<TARGET_DEFINITION id="6">
local filter = Object():GetFilter()
filter:Clear()
filter:NotTargetted()
filter:SetZone( ZONE_HAND )
filter:SetPlayer( EffectController() )
filter:AddCardType( CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(6)
</TARGET_DETERMINATION>
<PLAYTIME>
EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD", EffectDC():Make_Targets(0) )
</PLAYTIME>
</COST>
<RESOLUTION_TIME_ACTION>
Object():AddCounters( MTG():PlusOnePlusOneCounters(), 1 )
</RESOLUTION_TIME_ACTION>
</ACTIVATED_ABILITY>
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{B}: Regenerate Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{B}: Regenerate Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{B}: Regenerate Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{B}: Regenerate Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{B}: Regenerate Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{B}: Regenerate Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{B}: Regenerate Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{B}: Regenerate Lotleth Troll.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{B}: Regenerate Lotleth Troll.]]></LOCALISED_TEXT>
<COST type="Mana" cost="{B}" />
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
EffectSource():GiveRegeneration()
end
</RESOLUTION_TIME_ACTION>
<AI_AVAILABILITY type="regeneration" and="1" />
<AI_AVAILABILITY step="declare_blockers" blocking_or_blocked="1" />
<AI_AVAILABILITY type="in_response_dangerous" />
</ACTIVATED_ABILITY>
<HELP title="MORE_INFO_BADGE_TITLE_1" body="MORE_INFO_BADGE_BODY_1" zone="ZONE_ANY" />
</CARD_V2>
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="ABRUPT_DECAY_23172" />
<CARDNAME text="ABRUPT_DECAY" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Abrupt Decay]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Abrupt Decay]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Abrupt Decay]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Abrupt Decay]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Abrupt Decay]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Abrupt Decay]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Abrupt Decay]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Abrupt Decay]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Abrupt Decay]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="23172" />
<ARTID value="1" />
<ARTIST name="Svetlin Velinov" />
<CASTING_COST cost="{B}{G}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[The Izzet quickly suspended their policy of lifetime guarantees.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[The Izzet quickly suspended their policy of lifetime guarantees.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[The Izzet quickly suspended their policy of lifetime guarantees.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[The Izzet quickly suspended their policy of lifetime guarantees.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[The Izzet quickly suspended their policy of lifetime guarantees.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[The Izzet quickly suspended their policy of lifetime guarantees.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[The Izzet quickly suspended their policy of lifetime guarantees.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[The Izzet quickly suspended their policy of lifetime guarantees.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[The Izzet quickly suspended their policy of lifetime guarantees.]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Instant" />
<EXPANSION value="DPG" />
<RARITY metaname="R" />
<STATIC_ABILITY filter_zone="ZONE_ANY" active_zone="ZONE_STACK">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Abrupt Decay can't be countered by spells or abilities.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Abrupt Decay can't be countered by spells or abilities.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Abrupt Decay can't be countered by spells or abilities.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Abrupt Decay can't be countered by spells or abilities.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Abrupt Decay can't be countered by spells or abilities.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Abrupt Decay can't be countered by spells or abilities.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Abrupt Decay can't be countered by spells or abilities.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Abrupt Decay can't be countered by spells or abilities.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Abrupt Decay can't be countered by spells or abilities.]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION>
local characteristics = Object():GetCurrentCharacteristics()
characteristics:Characteristic_Set( CHARACTERISTIC_CANT_BE_COUNTERED, 1 )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Destroy target nonland permanent with converted mana cost 3 or less.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Destroy target nonland permanent with converted mana cost 3 or less.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Destroy target nonland permanent with converted mana cost 3 or less.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Destroy target nonland permanent with converted mana cost 3 or less.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Destroy target nonland permanent with converted mana cost 3 or less.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Destroy target nonland permanent with converted mana cost 3 or less.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Destroy target nonland permanent with converted mana cost 3 or less.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Destroy target nonland permanent with converted mana cost 3 or less.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Destroy target nonland permanent with converted mana cost 3 or less.]]></LOCALISED_TEXT>
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_ARTIFACT )
filter:AddCardType( CARD_TYPE_ENCHANTMENT )
filter:AddCardType( CARD_TYPE_CREATURE )
filter:AddCardType( CARD_TYPE_PLANESWALKER )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:SetZone( ZONE_IN_PLAY )
filter:SetConvertedCostMax( 3 )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_PERMANENT_TO_DESTROY", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_NthCardPtr(0)
local player = target:GetPlayer()
if (target ~= nil and player ~= nil) then
target:Destroy()
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
<AI_AVAILABILITY type="in_response" />
<AI_AVAILABILITY step="begin_combat" turn="their_turn" />
<AI_AVAILABILITY step="main_1" turn="my_turn" />
<AI_AVAILABILITY step="declare_attackers" turn="their_turn" />
<AI_AVAILABILITY step="declare_blockers" />
<AI_AVAILABILITY step="end_of_turn" />
<AI_AVAILABILITY step="end_of_turn" turn="their_turn" />
<AI_AVAILABILITY step="declare_attackers" turn="their_turn" />
<AI_AVAILABILITY type="in_response_dangerous" />
<AI_BASE_SCORE score="1350" zone="ZONE_HAND" />
</CARD_V2>
Re: Talk about new cards here
by Whizard » 14 Dec 2012, 19:10
I need some help coding a card. Could someone please code this for me:
Any opponent may pay 0 mana to look at (reveal) your hand.
Any opponent may pay 0 mana to look at (reveal) your hand.
Re: Talk about new cards here
by Whizard » 14 Dec 2012, 19:28
How do I change a custom deck name in the game from eg. DECK_DRAGONS to just Dragons?
Re: Talk about new cards here
by thefiremind » 14 Dec 2012, 20:19
Your first assumption was right: the localised deck name is defined in TEXT_PERMANENT. You can use my test WAD as a template if you are in doubt.Whizard wrote:How do I change a custom deck name in the game from eg. DECK_DRAGONS to just Dragons?
I'd prefer to know the whole card before giving an answer... if there was just the text you mentioned, I would reveal the hand without asking: anyone would do something good for free.Whizard wrote:I need some help coding a card. Could someone please code this for me:
Any opponent may pay 0 mana to look at (reveal) your hand.
< 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: Talk about new cards here
by Whizard » 15 Dec 2012, 00:10
The card is Enduring Renewal. All the code is working excellent, except i dont have the code to play with my hand revealed.
Re: Talk about new cards here
by Whizard » 15 Dec 2012, 00:16
If I can make Enduring Renewal I would like to release it with a few other cards in a deck wad.
Re: Talk about new cards here
by thefiremind » 15 Dec 2012, 10:38
Oh, now I understood! You want to make an ability that lets the opponents peek into your hand so it's like you are playing with your hand revealed.Whizard wrote:The card is Enduring Renewal. All the code is working excellent, except i dont have the code to play with my hand revealed.
This could be an option:
- Code: Select all
<ACTIVATED_ABILITY any_player="1" forced_skip="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Play with your hand revealed.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Gioca con la tua mano rivelata.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Spiele mit offenen Karten.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Jouez avec votre main révélée.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Juega mostrando tu mano.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたの自分の手札を公開した状態でプレイする。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Play with your hand revealed.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Играйте с открытой рукой.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Jogue com sua mão revelada.]]></LOCALISED_TEXT>
<COST type="Mana" cost="{0}" />
<RESOLUTION_TIME_ACTION>
local player = Object():GetController()
if player ~= nil then
player:RevealHand()
end
</RESOLUTION_TIME_ACTION>
<AI_AVAILABILITY step="draw" turn="their_turn" />
</ACTIVATED_ABILITY>
- It's an activated ability, so it will trigger Burning-Tree Shaman and similar cards, and it could be shut down by Faith's Fetters and similar cards.
- I don't know how the AI will react to this: it could become stuck in activating this ability forever, since it costs nothing. I hope that limiting it to the opponents' draw phase with AI_AVAILABILITY will be enough to prevent it. After all, I don't think that the AI really uses the information about a revealed hand (unless it knows the hand contents because of the difficulty level), but I couldn't prevent AI players from using this ability because using EffectController() in an AVAILABILITY block gives unpredictable results.
- Code: Select all
<TRIGGERED_ABILITY forced_skip="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Play with your hand revealed.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Gioca con la tua mano rivelata.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Spiele mit offenen Karten.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Jouez avec votre main révélée.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Juega mostrando tu mano.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[あなたの自分の手札を公開した状態でプレイする。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Play with your hand revealed.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Играйте с открытой рукой.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Jogue com sua mão revelada.]]></LOCALISED_TEXT>
<TRIGGER value="DREW_CARD" simple_qualifier="controller">
return TriggerPlayer() == Object():GetController()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local player = Object():GetController()
if player ~= nil then
player:RevealHand()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
The choice is yours. The code isn't tested, so there could be other problems I didn't expect.
< 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: Talk about new cards here
by Whizard » 16 Dec 2012, 21:15
Thank you so much. I appreciate your time helping me code this awesome card. I have made a few other cards and made some improvements to others. I will upload a deck with all the cards for everyone to enjoy as soon as it is bulletproof. Again thanks alot. Whizard
EDIT: I used the second option you gave me. I dont really know if it works.
EDIT: I used the second option you gave me. I dont really know if it works.

Re: Talk about new cards here
by thundrio » 21 May 2013, 05:03
I am trying to create Shard Volley, and I have this issue where when I play it asks me to target a creature/player, and then I sacrifice my land. I sacrifice the land and the card hangs around in the air for a while like its going to damage the opponent, but it doesn't actually do damage to the player (I didn't test it on creatures). I have no idea why this would happen. I started with a xml for Bone Splinters, and then changed the cost to be land instead of creatures, and then deleted the code within the <SPELL_ABILITY> tags and pasted in the <SPELL_ABILITY> code from Lightning Bolt. Please help me understand what I am doing wrong, this also happened when I tried to create Ghost Quarter (it sacced Ghost Quarter and targeted a land, but it didn't get destroyed).
Heres the code for Shard Volley:
Thanks a lot in advance.
Heres the code for Shard Volley:
- Code: Select all
<?xml version='1.0'?>
<CARD_V2>
<FILENAME text="SHARD_VOLLEY_9510006" />
<CARDNAME text="SHARD_VOLLEY" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Shard Volley]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="9510006" />
<ARTID value="9510006" />
<ARTIST name="NA" />
<CASTING_COST cost="{R}" />
<FLAVOURTEXT>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[...]]></LOCALISED_TEXT>
</FLAVOURTEXT>
<TYPE metaname="Instant" />
<EXPANSION value="DPG" />
<RARITY metaname="C" />
<UTILITY_ABILITY filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As an additional cost to cast Shard Volley, sacrifice a land.]]></LOCALISED_TEXT>
<COST type="Sacrifice" qualifier="Additional">
<TARGET_DEFINITION id="6">
local filter = Object():GetFilter()
filter:Clear()
filter:AddCardType( CARD_TYPE_LAND )
filter:SetPlayer( EffectController() )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY, EffectController() )
filter:NotTargetted()
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(6)
</TARGET_DETERMINATION>
<PLAYTIME>
EffectController():ChooseTarget( 6, "CARD_QUERY_CHOOSE_LAND_TO_SACRIFICE", EffectDC():Make_Targets(0) )
</PLAYTIME>
</COST>
</UTILITY_ABILITY>
<SPELL_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Shard Volley deals 3 damage to target creature or player.]]></LOCALISED_TEXT>
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:SetFilterType( FILTER_TYPE_CARDS + FILTER_TYPE_PLAYERS )
filter:SetZone( ZONE_IN_PLAY )
filter:SetHint( HINT_ENEMY_ONLY, EffectController() )
filter:AddCardType( CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<TARGET_DETERMINATION>
return AtLeastOneTargetFromDefinition(0)
</TARGET_DETERMINATION>
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_DEAL_3_DAMAGE", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
local source = EffectSource()
if source == nil then
source = Object()
end
if ( target_creature ~= nil ) then
target_creature:DealDamage(3, source)
elseif
( target_player ~= nil ) then
target_player:DealDamage(3, source)
end
</RESOLUTION_TIME_ACTION>
<SFX text="TARGET_LIGHTNING_PLAY" />
</SPELL_ABILITY>
</CARD_V2>
Thanks a lot in advance.
- thundrio
- Posts: 2
- Joined: 09 May 2013, 23:55
- Has thanked: 0 time
- Been thanked: 0 time
Re: Talk about new cards here
by sumomole » 21 May 2013, 06:15
thundrio wrote:I am trying to create Shard Volley, and I have this issue where when I play it asks me to target a creature/player, and then I sacrifice my land. I sacrifice the land and the card hangs around in the air for a while like its going to damage the opponent, but it doesn't actually do damage to the player (I didn't test it on creatures).
- Code: Select all
<PLAY_TIME_ACTION target_choosing="1">
EffectController():ChooseTarget( 0, "CARD_QUERY_CHOOSE_DEAL_3_DAMAGE", EffectDC():Make_Targets(1) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target_creature = EffectDC():Get_Targets(1):Get_CardPtr(0)
local target_player = EffectDC():Get_Targets(1):Get_PlayerPtr(0)
local source = EffectSource()
if source == nil then
source = Object()
end
if ( target_creature ~= nil ) then
target_creature:DealDamage(3, source)
elseif
( target_player ~= nil ) then
target_player:DealDamage(3, source)
end
</RESOLUTION_TIME_ACTION>
-
sumomole - Programmer
- Posts: 611
- Joined: 07 Jun 2011, 08:34
- Has thanked: 51 times
- Been thanked: 234 times
Re: Talk about new cards here
by thefiremind » 21 May 2013, 08:44
Just to add a bit more information to sumomole's post, what you did wrong there is to use target chest #0 twice: once you use a chest for something inside an ability, you shouldn't use it again for something else (there are exceptions, but if you just follow this rule, you can't go wrong).
Within the portions of Lua scripting it's the same as far as I know (well of course except "nothing at all", that can't work
).
Within the XML structure you can use tabs, spaces, returns, even nothing at all, it works anyway.thundrio wrote:Also (this might be related), does the xml care about tabbed spacing (like how Python does for instance) or not?
Within the portions of Lua scripting it's the same as far as I know (well of course except "nothing at all", that can't work

< 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: Talk about new cards here
by BloodReyvyn » 26 May 2013, 12:50
Well, I am at work right now so I only have a few minutes to post here. I was coding Stuffy Doll last night and thought everything was kosher, but when I tried to test I got a crash to desktop. I checked the SCRIPT_LOG and the only thing mentioned there was a nil value having to do with Temporal Extortion (which was/is working just fine).
Anyways, since I am limited on time, I will plop my code here for you guys to look over if you could.
I am sure it's just another foolish mistake on my part, so thanks for the help in advance and for being so patient with a newb like me.
Anyways, since I am limited on time, I will plop my code here for you guys to look over if you could.
I am sure it's just another foolish mistake on my part, so thanks for the help in advance and for being so patient with a newb like me.

- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2>
<FILENAME text="STUFFY_DOLL_279711" />
<CARDNAME text="STUFFY_DOLL" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Stuffy Doll]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Poupée de son]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Muñeca de trapo]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Ausgestopfte Puppe]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Bambola di Pezza]]></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[Boneco Empalhado]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="279711" />
<ARTID value="A279711" />
<ARTIST name="David Rapoza" />
<CASTING_COST cost="{5}" />
<TYPE metaname="Artifact" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Construct" />
<EXPANSION value="M13" />
<RARITY metaname="R" />
<POWER value="0" />
<TOUGHNESS value="1" />
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Stuffy Doll enters the battlefield, choose a player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand la Poupée de son arrive sur le champ de bataille, choisissez un joueur.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[En cuanto la Muñeca de trapo entre al campo de batalla, elige un jugador.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sowie die Ausgestopfte Puppe ins Spiel kommt, bestimme einen Spieler.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mentre la Bambola di Pezza entra nel campo di battaglia, scegli un giocatore.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ぬいぐるみ人形が戦場に出るに際し、プレイヤーを1人選ぶ。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[푹신한 인형이 전장에 들어올 시에, 플레이어 한 명을 선택한다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[При выходе Мягкой Куклы на поле битвы выберите игрока.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Conforme Boneco Empalhado entra no campo de batalha, escolha um jogador.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_IN_PLAY" />
<TARGET_DEFINITION id="0">
local filter = Object():GetFilter()
filter:Clear()
filter:SetFilterType( FILTER_TYPE_PLAYERS + FILTER_TYPE_OPPONENTS)
filter:SetOwner( EffectController() )
filter:SetHint( HINT_ENEMY_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_OPPONENT", EffectDC():Make_Targets(0) )
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_PlayerPtr(0, player)
MTG():CreateDelayedTrigger(1, delayDC)
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
EffectDC():Protect_CardPtr( COMPARTMENT_ID_EFFECT_SOURCE )
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="0">
local player = ObjectDC():Get_PlayerPtr(0)
if player ~= nil then
player:AddBadge(PLAYER_BADGE_ICON_CHOSEN_PLAYER, "PLAYER_CHOSEN_ICON")
end
</CONTINUOUS_ACTION>
<DURATION>
return (EffectSource() == nil)
</DURATION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Stuffy Doll is indestructible.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[La Poupée de son est indestructible.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[La Muñeca de trapo es indestructible.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Die Ausgestopfte Puppe ist unzerstörbar.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La Bambola di Pezza è indistruttibile.]]></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[Boneco Empalhado é indestrutível.]]></LOCALISED_TEXT>
local characteristics = Object():GetCurrentCharacteristics()
characteristics:Characteristic_Set( CHARACTERISTIC_INDESTRUCTIBLE, 1 )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever Stuffy Doll is dealt damage, it deals that much damage to the chosen player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que des blessures sont infligées à la Poupée de son, elle inflige autant de blessures au joueur choisi.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que la Muñeca de trapo reciba daño, esta le hace esa misma cantidad de daño al jugador elegido.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn der Ausgestopften Puppe Schaden zugefügt wird, fügt sie dem bestimmten Spieler ebenso viele Schadenspunkte zu.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta viene inflitto danno alla Bambola di Pezza, essa infligge altrettanti danni al giocatore scelto.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ぬいぐるみ人形にダメージが与えられるたび、それはその点数に等しい点数のダメージを選ばれたプレイヤーに与える。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: 푹신한 인형은 스스로에게 피해 1점을 입힌다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз, когда Мягкой Кукле наносятся повреждения, она наносит столько же повреждений выбранному игроку.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que Boneco Empalhado sofre dano, ele causa uma quantidade equivalente de dano ao jogador escolhido. ]]></LOCALISED_TEXT>
<TRIGGER value="CREATURE_TOOK_DAMAGE" simple_qualifier="self">
EffectDC():Set_CardPtr(2, SecondaryObject())
EffectDC():LKIShield_CardPtr(2)
local chosen_opponent = ObjectDC():Get_PlayerPtr(0)
if chosen_opponent ~= nil
return true
else
return false
end
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local chosen_opponent = ObjectDC():Get_PlayerPtr(0)
local source = EffectSource()
if source == nil then
source = Object()
end
if chosen_opponent ~= nil then
local damage = GetDamageDealt( self )
if damage > 0 then
chosen_opponent:DealDamage( damage, source )
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{T}: Stuffy Doll deals 1 damage to itself.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{T} : La Poupée de son s’inflige 1 blessure.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{T}: La Muñeca de trapo se hace 1 punto de daño a sí misma.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{T}: Die Ausgestopfte Puppe fügt sich selber 1 Schadenspunkt zu.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{T}: La Bambola di Pezza infligge 1 danno a sé stessa.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{T}:ぬいぐるみ人形は自身に1点のダメージを与える。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{T}: Stuffy Doll deals 1 damage to itself.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{T}: Мягкая Кукла наносит 1 повреждение сама себе.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{T}: Boneco Empalhado causa 1 ponto de dano a si mesmo.]]></LOCALISED_TEXT>
<COST type="TapSelf" />
<RESOLUTION_TIME_ACTION>
local source = EffectSource()
if source == nil then
source = Object()
end
source:DealDamage(1, source)
</RESOLUTION_TIME_ACTION>
<AI_AVAILABILITY type="in_response" />
<AI_AVAILABILITY step="begin_combat" turn="their_turn" />
<AI_AVAILABILITY step="main_1" turn="my_turn" />
<AI_AVAILABILITY step="declare_attackers" turn="their_turn" />
<AI_AVAILABILITY step="declare_blockers" />
<AI_AVAILABILITY step="end_of_turn" />
<SFX text="TARGET_LIGHTNING_PLAY" />
</ACTIVATED_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>
"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: Talk about new cards here
by thefiremind » 26 May 2013, 12:59
You are missing <CONTINUOUS_ACTION> in the indestructible ability. If you have Firefox, drop the card XML onto it before testing the card, it will tell you if there are problems with the XML structure.
By the way, when the game crashes at the start of the match, it's (almost) always because of an error in the XML structure. You won't find information about it on SCRIPT_LOG.TXT because the Lua code can't even be accessed when the XML isn't valid.
Can you write me the exact message that appears on SCRIPT_LOG.TXT about Temporal Extortion? Since I'm the one who coded it, I'm interested in removing any bug, even the ones that have no influence on its behavior.
By the way, when the game crashes at the start of the match, it's (almost) always because of an error in the XML structure. You won't find information about it on SCRIPT_LOG.TXT because the Lua code can't even be accessed when the XML isn't valid.
Can you write me the exact message that appears on SCRIPT_LOG.TXT about Temporal Extortion? Since I'm the one who coded it, I'm interested in removing any bug, even the ones that have no influence on its behavior.
< 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: Talk about new cards here
by BloodReyvyn » 26 May 2013, 13:12
The script log says this about 4 times.
[lua] [string "TEMPORAL_EXTORTION_126814_TITLE (RESOLUTION_TIME_ACTION) [2566]"]:8: attempt to call method 'isAI' (a nil value)
Also, thanks again for the help on that code, I will test it when I get off in a few hours (yay early day, maybe I can try to finish up my Magus of the Mirror.)
Ummm by the way, where are the Planechase cards saved? I know one of them allows you to exchange life totals with an opponent during your upkeep, which is very similar to the Magus, so I was just gonna alter that code to save time.
[lua] [string "TEMPORAL_EXTORTION_126814_TITLE (RESOLUTION_TIME_ACTION) [2566]"]:8: attempt to call method 'isAI' (a nil value)
Also, thanks again for the help on that code, I will test it when I get off in a few hours (yay early day, maybe I can try to finish up my Magus of the Mirror.)
Ummm by the way, where are the Planechase cards saved? I know one of them allows you to exchange life totals with an opponent during your upkeep, which is very similar to the Magus, so I was just gonna alter that code to save time.
"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 5 guests