Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
New MTG Cards and Decks (2010, 2012, 2013, 2014, 2015, Magic Duels)
2014




Formal Request Thread
Moderator: CCGHQ Admins
Re: Formal Request Thread
by Xander9009 » 13 Jul 2013, 03:56
In the resolution block, you didn't tell the program what "target" is, so "target ~= nil" will never be true. But, there's another problem. You're targeting the creature. That's not good. If you had creatures, but they had shroud or something (or were illusions, for instance), then it would cause problems. It should be in a resolution block and simply ask the player to sacrifice a creature. I did the same thing at first. I actually just did Disciple of Bolas because I saw you were going to askScion of Darkness wrote:I know i'm doing something wrong here but its almost 5 am here and i'm starting to see everything funny hehehe
i'm trying to fix my disciple of bolas but something got wrong along the way, if some gentle soul take a look here i promise no more card requests this weekend XDThanks
- Code: Select all
<TRIGGERED_ABILITY auto_skip="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Disciple of Bolas enters the battlefield, sacrifice another creature. You gain X life and draw X cards, where X is that creature’s power.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand la Disciple de Bolas arrive sur le champ de bataille, sacrifiez une autre créature. Vous gagnez X points de vie et vous piochez X cartes, X étant la force de cette créature.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cuando el Discípulo de Nicol Bolas entre al campo de batalla, sacrifica otra criatura. Ganas X vidas y robas X cartas, donde X es la fuerza de esa criatura.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn Bolas’ Schülerin ins Spiel kommt, opfere eine andere Kreatur. Du erhältst X Lebenspunkte dazu und ziehst X Karten, wobei X gleich der Stärke dieser Kreatur ist.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando la Discepola di Bolas entra nel campo di battaglia, sacrifica un'altra creatura. Guadagni X punti vita e peschi X carte, dove X è la forza di quella creatura.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[《ボーラスの信奉者》が戦場に出たとき、他のクリーチャーを1体生け贄に捧げる。あなたはX点のライフを得て、カードをX枚引く。Xはそのクリーチャーのパワーに等しい。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[니콜 볼라스의 사도가 전장에 들어올 때, 다른 생물 한 개를 희생한다. 당신은 생명 X점을 얻고 카드 X장을 뽑는다. X는 희생된 생물의 공격력이다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Приверженец Боласа выходит на поле битвы, пожертвуйте другое существо. Вы получаете X жизней и берете X карт, где X — сила того существа.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Quando Discípulo de Nicol Bolas entrar no campo de batalha, sacrifique outra criatura. Você ganha X pontos de vida e compra X cards, sendo X igual ao poder daquela criatura.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<TARGET tag="CARD_QUERY_CREATURE_SACRIFICE" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource() )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local power = EffectDC():Get_Targets(0):GetCurrentCharacteristics():Power_Get()
if target ~= nil then
EffectController():Sacrifice( target )
EffectController():GainLife( power )
EffectController():DrawCards( power )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
*xander you rock*

- Code: Select all
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Disciple of Bolas enters the battlefield, sacrifice another creature. You gain X life and draw X cards, where X is that creature’s power.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand la Disciple de Bolas arrive sur le champ de bataille, sacrifiez une créature. Vous gagnez X points de vie et vous piochez X cartes, X étant la force de cette créature.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cuando el Discípulo de Nicol Bolas entre al campo de batalla, sacrifica otra criatura. Ganas X vidas y robas X cartas, donde X es la fuerza de esa criatura.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn Bolas’ Schülerin ins Spiel kommt, opfere eine andere Kreatur. Du erhältst X Lebenspunkte dazu und ziehst X Karten, wobei X gleich der Stärke dieser Kreatur ist.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando la Discepola di Bolas entra nel campo di battaglia, sacrifica un’altra creatura. Guadagni X punti vita e peschi X carte, dove X è la forza di quella creatura.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ボーラスの信奉者が戦場に出たとき、他のクリーチャーを1体生け贄に捧げる。あなたはX点のライフを得て、カードをX枚引く。Xはそのクリーチャーのパワーに等しい。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[니콜 볼라스의 사도가 전장에 들어올 때, 다른 생물 한 개를 희생한다. 당신은 생명 X점을 얻고 카드 X장을 뽑는다. X는 희생된 생물의 공격력이다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Приверженец Боласа выходит на поле битвы, пожертвуйте другое существо. Вы получаете X жизней и берете X карт, где X — сила того существа.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Quando Discípulo de Nicol Bolas entrar no campo de batalha, sacrifique outra criatura. Você ganha X pontos de vida e compra X cards, sendo X igual ao poder daquela criatura.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
local effectController = EffectController()
filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add(FE_CONTROLLER, OP_IS, effectController)
filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource() )
effectController:ChooseItem( "CARD_QUERY_CHOOSE_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(0) )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local power = target:GetCurrentCharacteristics():Power_Get()
EffectDC():Set_Int(1, power)
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
EffectController():Sacrifice( target )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local amount = EffectDC():Get_Int(1)
if amount ~= 0 then
EffectController():GainLife( amount )
EffectController():DrawCards( amount )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by Scion of Darkness » 13 Jul 2013, 04:26
Its working fine =) hehehe thanks pal :roleye:
-
Scion of Darkness - Posts: 235
- Joined: 27 Aug 2012, 13:14
- Has thanked: 17 times
- Been thanked: 23 times
Re: Formal Request Thread
by kevlahnota » 13 Jul 2013, 04:34
Is there anyone know how to ignore resolution check?
I have coded Wing Shards like this:
). Can anyone have take a look? Maybe I overlooked something.
TIA
I have coded Wing Shards like this:
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Target player sacrifices an attacking creature.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Le joueur ciblé sacrifie une créature attaquante.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[El jugador objetivo sacrifica una criatura atacante.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Ein Spieler deiner Wahl opfert eine angreifende Kreatur.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Il giocatore bersaglio sacrifica una creatura attaccante.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Target player sacrifices an attacking creature.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Target player sacrifices an attacking creature.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Target player sacrifices an attacking creature.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[O jogador alvo sacrifica uma criatura atacante.]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_PLAYER_TO_SACRIFICE_ATTACKING_CREATURE" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_PLAYERS )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
local filter = ClearFilter()
filter:Add( FE_CONTROLLER, OP_IS, target_player )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_IS_ATTACKING, true )
if filter:Count() > 0 then
target_player:SetItemCount( 1 )
for i = 0,(1-1) do
target_player:SetItemPrompt (i, "CARD_QUERY_CHOOSE_CREATURE_TO_SACRIFICE" )
end
target_player:ChooseItems( EffectDC():Make_Targets(1) )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
if target_player ~= nil then
local creature = EffectDC():Get_Targets(1):Get_CardPtr(0)
if creature ~= nil then
target_player:Sacrifice( creature )
end
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
<TRIGGERED_ABILITY active_zone="ZONE_STACK">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Storm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Déluge]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tormenta]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sturm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tempesta]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Storm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Storm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Storm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Rajada]]></LOCALISED_TEXT>
<TRIGGER value="SPELL_PLAYED" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
local interrogation = MTG():ClearInterrogationQuery()
local spellsCast = interrogation:Count( INTERROGATE_SPELLS_CAST, INTERROGATE_THIS_TURN ) - 1
if spellsCast > 0 then
for i = 1,spellsCast do
if Object() ~= nil then
local copy = EffectController():CopySpell( Object() )
EffectController():ChooseNewTargets( copy )
end
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>

TIA
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: Formal Request Thread
by BloodReyvyn » 13 Jul 2013, 06:25
Hey guys, I ran into a slight problem when testing my Marrow Chomper, I was playing the deck against itself and the AI was able to use the devour ability to put 6 counters on it without sacrificing any of his 3 creatures. When I used the same ability, it went just fine: Asked if I wanted to use the ability, Asked which creatures to sacrifice, Sacced the creatures I chose, added the appropriate counters, then triggered the lifegain (honestly I didn't even notice if I gained the life as I was preoccupied with the other issue and closed the game to look for that problem first.)
Anyways, if we can get that functioning, it'll give a reference for other devour abilities.
Anyways, if we can get that functioning, it'll give a reference for other devour abilities.

- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="MARROW_CHOMPER_183014" />
<CARDNAME text="MARROW_CHOMPER" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Marrow Chomper]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Brifaud de moelle]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Masticamédulas]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Markmampfer]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Masticamidollo]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[骨髄食い]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Marrow Chomper]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Мозгопожиратель]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Mascador de Medula]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="183014" />
<ARTID value="183014" />
<ARTIST name="Lars Grant-West" />
<CASTING_COST cost="{3}{B}{G}" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Zombie" />
<SUB_TYPE metaname="Lizard" />
<EXPANSION value="ARB" />
<RARITY metaname="U" />
<POWER value="3" />
<TOUGHNESS value="3" />
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Devour 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Dévorement 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Devorar 2.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Verschlingen 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Divorare 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[貪食 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Devour 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пожирание 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Devorar 2]]></LOCALISED_TEXT>
<SFX text="COMBAT_WURMCOIL_ATTACK" />
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
local effectController = EffectController()
local filter = ClearFilter()
filter:Add(FE_CONTROLLER, OP_IS, effectController )
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
local maxtosac = filter:Count()
effectController:SetItemCount( maxtosac )
for i = 0, (maxtosac-1) do
effectController:SetItemPrompt( i, "CARD_QUERY_CHOOSE_CREATURE_SACRIFICE" )
end
effectController:ChooseItems( EffectDC():Make_Targets(0), QUERY_FLAG_UP_TO )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local marrowDC = EffectDC():Get_Targets(0)
LinkedDC():Set_Int( 1, EffectDC():Get_Targets(0) )
if marrowDC ~= nil then
local number = marrowDC:Count()
for i = 0, (number-1) do
local card = marrowDC:Get_CardPtr(i)
if card ~= nil then
EffectController():Sacrifice( card )
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local marrowDC = EffectDC():Get_Targets(0)
if marrowDC ~= nil then
local devcounters = (marrowDC:Count() * 2 )
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), devcounters)
end
end
</RESOLUTION_TIME_ACTION>
<MAY />
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Marrow Chomper enters the battlefield, you gain 2 life for each creature it devoured.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand le Brifaud de moelle arrive en jeu, vous gagnez 2 points de vie pour chaque créature qu’il a dévoré.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cuando el Masticamédulas entre en juego, ganas 2 vidas por cada criatura que devoró.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn der Markmampfer ins Spiel kommt, erhältst du für jede Kreatur, die er verschlungen hat, 2 Lebenspunkte dazu.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando il Masticamidollo entra nel campo di battaglia, guadagni 2 punti vita per ogni creatura che ha divorato.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[骨髄食いが場に出たとき、あなたはそれが貪食したクリーチャー1体につき2点のライフを得る。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[When Marrow Chomper enters the battlefield, you gain 2 life for each creature it devoured.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Мозгопожиратель входит в игру, вы получаете 2 жизни за каждое пожранное им существо.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Quando Mascador de Medula entra em jogo, você ganha 2 pontos de vida para cada criatura devorada por ele.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
life_gained = LinkedDC():Get_Int( 1 )
if life_gained ~= nil then
EffectController():GainLife( life_gained )
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>
"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: Formal Request Thread
by Xander9009 » 13 Jul 2013, 08:10
I'm not seeing anything wrong in either of those. I tried the code for Wing Shards but it worked perfectly in game, but gave me an error when I closed, but only if Storm was activated, just like you said. I actually have a similar problem with the Convincing Mirage I made. It works perfectly in game (after one HELL of a time of fiddling with it), but when I close it down, I get "Attempted to call global GrantAbility a nil value." I find it odd, but at least it works.
Anyway, I'm actually posting to throw up some code for landfall for someone more adept to look at and make sure it's going to do what I want it to do. Landfall exists for plenty of permanents to copy from, but they're all triggered abilities when a land enters the battlefield. That's completely useless for instants, sorceries and abilities (do any abilities use landfall like an instant or sorcery would?), and I wanted Mysteries of the Deep and this is the result. Simpler than I expected, which makes me think something must be wrong. (I know it's slightly counter-intuitive to ask if get_int isn't 1, but I liked the normal ability being on top and the enhanced ability on bottom like the card shows.)
Anyway, I'm actually posting to throw up some code for landfall for someone more adept to look at and make sure it's going to do what I want it to do. Landfall exists for plenty of permanents to copy from, but they're all triggered abilities when a land enters the battlefield. That's completely useless for instants, sorceries and abilities (do any abilities use landfall like an instant or sorcery would?), and I wanted Mysteries of the Deep and this is the result. Simpler than I expected, which makes me think something must be wrong. (I know it's slightly counter-intuitive to ask if get_int isn't 1, but I liked the normal ability being on top and the enhanced ability on bottom like the card shows.)
- Code: Select all
<RESOLUTION_TIME_ACTION>
local player = EffectController()
local interrogation = MTG():ClearInterrogationQuery()
if player ~= nil then
interrogation:SetToZone( ZONE_BATTLEFIELD )
interrogation:SetType( CARD_TYPE_LAND )
interrogation:SetPlayer( player )
if interrogation:Test( INTERROGATE_CARDS_MOVED_ZONE, INTERROGATE_THIS_TURN ) then
EffectDC():Set_Int(0, 1)
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
if EffectDC():Get_Int(0) ~= 1 then
EffectController():DrawCards(2) --non-landfall effects
else
EffectController():DrawCards(3) --landfall effects
end
</RESOLUTION_TIME_ACTION>
Last edited by Xander9009 on 13 Jul 2013, 08:52, edited 1 time in total.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by Xander9009 » 13 Jul 2013, 08:16
While I don't see what's wrong with that code (and I haven't compared it to the following), this is from Thorn-Thrash Viashino in the official cards.BloodReyvyn wrote:Hey guys, I ran into a slight problem when testing my Marrow Chomper, I was playing the deck against itself and the AI was able to use the devour ability to put 6 counters on it without sacrificing any of his 3 creatures. When I used the same ability, it went just fine: Asked if I wanted to use the ability, Asked which creatures to sacrifice, Sacced the creatures I chose, added the appropriate counters, then triggered the lifegain (honestly I didn't even notice if I gained the life as I was preoccupied with the other issue and closed the game to look for that problem first.)
Anyways, if we can get that functioning, it'll give a reference for other devour abilities.
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="MARROW_CHOMPER_183014" />
<CARDNAME text="MARROW_CHOMPER" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Marrow Chomper]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Brifaud de moelle]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Masticamédulas]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Markmampfer]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Masticamidollo]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[骨髄食い]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Marrow Chomper]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Мозгопожиратель]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Mascador de Medula]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="183014" />
<ARTID value="183014" />
<ARTIST name="Lars Grant-West" />
<CASTING_COST cost="{3}{B}{G}" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Zombie" />
<SUB_TYPE metaname="Lizard" />
<EXPANSION value="ARB" />
<RARITY metaname="U" />
<POWER value="3" />
<TOUGHNESS value="3" />
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Devour 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Dévorement 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Devorar 2.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Verschlingen 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Divorare 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[貪食 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Devour 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пожирание 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Devorar 2]]></LOCALISED_TEXT>
<SFX text="COMBAT_WURMCOIL_ATTACK" />
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
local effectController = EffectController()
local filter = ClearFilter()
filter:Add(FE_CONTROLLER, OP_IS, effectController )
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
local maxtosac = filter:Count()
effectController:SetItemCount( maxtosac )
for i = 0, (maxtosac-1) do
effectController:SetItemPrompt( i, "CARD_QUERY_CHOOSE_CREATURE_SACRIFICE" )
end
effectController:ChooseItems( EffectDC():Make_Targets(0), QUERY_FLAG_UP_TO )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local marrowDC = EffectDC():Get_Targets(0)
LinkedDC():Set_Int( 1, EffectDC():Get_Targets(0) )
if marrowDC ~= nil then
local number = marrowDC:Count()
for i = 0, (number-1) do
local card = marrowDC:Get_CardPtr(i)
if card ~= nil then
EffectController():Sacrifice( card )
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local marrowDC = EffectDC():Get_Targets(0)
if marrowDC ~= nil then
local devcounters = (marrowDC:Count() * 2 )
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), devcounters)
end
end
</RESOLUTION_TIME_ACTION>
<MAY />
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Marrow Chomper enters the battlefield, you gain 2 life for each creature it devoured.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand le Brifaud de moelle arrive en jeu, vous gagnez 2 points de vie pour chaque créature qu’il a dévoré.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cuando el Masticamédulas entre en juego, ganas 2 vidas por cada criatura que devoró.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn der Markmampfer ins Spiel kommt, erhältst du für jede Kreatur, die er verschlungen hat, 2 Lebenspunkte dazu.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando il Masticamidollo entra nel campo di battaglia, guadagni 2 punti vita per ogni creatura che ha divorato.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[骨髄食いが場に出たとき、あなたはそれが貪食したクリーチャー1体につき2点のライフを得る。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[When Marrow Chomper enters the battlefield, you gain 2 life for each creature it devoured.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Мозгопожиратель входит в игру, вы получаете 2 жизни за каждое пожранное им существо.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Quando Mascador de Medula entra em jogo, você ganha 2 pontos de vida para cada criatura devorada por ele.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
life_gained = LinkedDC():Get_Int( 1 )
if life_gained ~= nil then
EffectController():GainLife( life_gained )
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>
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Devour 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Dévorement 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Devorar 2.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Verschlingen 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Divorare 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[貪食 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[포식 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пожирание 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Devorar 2]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
local max_victims = filter:Count()
if max_victims > 0 then
EffectController():SetItemCount( max_victims )
for i = 0,(max_victims-1) do
EffectController():SetItemPrompt (i, "CARD_QUERY_CHOOSE_CREATURE_TO_DEVOUR_2" )
end
EffectDC():Set_Int(1, max_victims)
EffectController():ChooseItems( EffectDC():Make_Targets(0), QUERY_FLAG_UP_TO )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local max_victims = EffectDC():Get_Int(1)
local devour_count = 0
for i=0,max_victims-1 do
local victim = EffectDC():Get_Targets(0):Get_CardPtr(i)
if victim ~= nil then
EffectController():Sacrifice(victim)
devour_count = devour_count + 1
end
end
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), devour_count*2 )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by BloodReyvyn » 13 Jul 2013, 09:24
I'm not entirely sure how, but when I tried to use that code it completely crashed the game before I could even start a match. (Something about a memory dump, then crash, but the dump file wasn't in the folder it said it would be)
I have been tirelessly tinkering with it and this is my current code setup:
I have no idea why, since I have read and re-read the xml about 20 times and see no errors, maybe someone else can.
I have been tirelessly tinkering with it and this is my current code setup:
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="MARROW_CHOMPER_183014" />
<CARDNAME text="MARROW_CHOMPER" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Marrow Chomper]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Brifaud de moelle]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Masticamédulas]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Markmampfer]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Masticamidollo]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[骨髄食い]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Marrow Chomper]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Мозгопожиратель]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Mascador de Medula]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="183014" />
<ARTID value="183014" />
<ARTIST name="Lars Grant-West" />
<CASTING_COST cost="{3}{B}{G}" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Zombie" />
<SUB_TYPE metaname="Lizard" />
<EXPANSION value="ARB" />
<RARITY metaname="U" />
<POWER value="3" />
<TOUGHNESS value="3" />
<TRIGGERED_ABILITY linked_ability_group="1" priority="10">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Devour 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Dévorement 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Devorar 2.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Verschlingen 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Divorare 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[貪食 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Devour 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пожирание 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Devorar 2]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION filter_id="0">
local effectController = EffectController()
local filter = ClearFilter()
filter:Add(FE_CONTROLLER, OP_IS, effectController )
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
local maxtosac = filter:Count()
effectController:SetItemCount( maxtosac )
for i = 0, (maxtosac-1) do
effectController:SetItemPrompt( i, "CARD_QUERY_CHOOSE_CREATURE_SACRIFICE" )
end
effectController:ChooseItems( EffectDC():Make_Targets(0), QUERY_FLAG_UP_TO )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local marrowDC = EffectDC():Get_Targets(0)
LinkedDC():Set_Int( 1, marrowDC:Count() )
if marrowDC ~= nil then
local number = marrowDC:Count()
for i = 0, (number-1) do
local card = marrowDC:Get_CardPtr(i)
if card ~= nil then
EffectController():Sacrifice( card )
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local marrowDC = EffectDC():Get_Targets(0)
if marrowDC ~= nil then
local devcounters = (marrowDC:Count() * 2 )
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), devcounters)
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Marrow Chomper enters the battlefield, you gain 2 life for each creature it devoured.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand le Brifaud de moelle arrive en jeu, vous gagnez 2 points de vie pour chaque créature qu’il a dévoré.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cuando el Masticamédulas entre en juego, ganas 2 vidas por cada criatura que devoró.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn der Markmampfer ins Spiel kommt, erhältst du für jede Kreatur, die er verschlungen hat, 2 Lebenspunkte dazu.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando il Masticamidollo entra nel campo di battaglia, guadagni 2 punti vita per ogni creatura che ha divorato.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[骨髄食いが場に出たとき、あなたはそれが貪食したクリーチャー1体につき2点のライフを得る。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[When Marrow Chomper enters the battlefield, you gain 2 life for each creature it devoured.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Мозгопожиратель входит в игру, вы получаете 2 жизни за каждое пожранное им существо.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Quando Mascador de Medula entra em jogo, você ganha 2 pontos de vida para cada criatura devorada por ele.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
life_gained = LinkedDC():Get_Int( 1 )
if life_gained ~= nil then
EffectController():GainLife( life_gained )
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>
I have no idea why, since I have read and re-read the xml about 20 times and see no errors, maybe someone else can.

"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: Formal Request Thread
by Xander9009 » 13 Jul 2013, 09:39
It's a random guess, but perhaps in this block:BloodReyvyn wrote:It is almost exactly like the previous one, with a few minor changes, except this one now gives me the following Script Log error: "[lua] [string "MARROW_CHOMPER_183014_TITLE (RESOLUTION_TIME_ACTION)~0x000003a7"]:3: attempt to index local 'marrowDC' (a nil value)"
- Code: Select all
<RESOLUTION_TIME_ACTION>
local marrowDC = EffectDC():Get_Targets(0)
LinkedDC():Set_Int( 1, marrowDC:Count() )
if marrowDC ~= nil then
local number = marrowDC:Count()
for i = 0, (number-1) do
local card = marrowDC:Get_CardPtr(i)
if card ~= nil then
EffectController():Sacrifice( card )
end
end
end
</RESOLUTION_TIME_ACTION>
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by thefiremind » 13 Jul 2013, 09:41
I just know that Thrumming Stone is what interests players, not the spells with Ripple on them.Scion of Darkness wrote:i dont know what kind of witchcraft you made but you read my mind

"%" is the operator for "module" (it's called "mod" in some other programming languages) and it returns the remainder of the division. Example: 5%2 = 1, 1234%10 = 4. It's useful for doing parity checks: "n%2" returns 0 if the number is even, 1 if the number is odd. This is used in DotP when a repeating action needs to ask each player for a choice and then do something with that choice: during the even iterations it asks, while during the odd iterations it does something.Xander9009 wrote:I don't even know what "n%2" actually does...
I guess the AI thinks that 5 life are always less valuable than a resolved spell... have you tried to get to 4 or less life and see if the AI starts to cast it?Xander9009 wrote:The only issue I've seen with it is that the ai practically refuses to cast it. I even tried making it gain 100 life and made the spell free haha.
I have read about this problem but I have no clue about why it happens. I'll take a deeper look into it as soon as I have time.kevlahnota wrote:It's working fine however it returns nil value when you try to use it with storm (after playing even it works). Can anyone have take a look? Maybe I overlooked something.
EDIT: I just noticed something: the first RESOLUTION_TIME_ACTION is missing the "if target_player ~= nil" check.
I'm not sure if it works since I'm still not very confident with interrogations, but if I had to try and code it, I would have coded it like that. Just test and see.Xander9009 wrote:I'm actually posting to throw up some code for landfall for someone more adept to look at and make sure it's going to do what I want it to do.
Last edited by thefiremind on 13 Jul 2013, 11:52, edited 1 time in total.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Formal Request Thread
by BloodReyvyn » 13 Jul 2013, 09:47
LOL, I just did that before I checked back here just in case. I think it fixed the script log errors, but I have yet to get one out with creatures still on the battlefield to sac and ran into a few other cards not working that were working just fine a few games ago...Xander9009 wrote:It's a random guess, but perhaps in this block:BloodReyvyn wrote:It is almost exactly like the previous one, with a few minor changes, except this one now gives me the following Script Log error: "[lua] [string "MARROW_CHOMPER_183014_TITLE (RESOLUTION_TIME_ACTION)~0x000003a7"]:3: attempt to index local 'marrowDC' (a nil value)"You could move "if marrowDC ~= nil then" up a line so that if the targets are never initialized, then it doesn't try to count them?
- Code: Select all
<RESOLUTION_TIME_ACTION>
local marrowDC = EffectDC():Get_Targets(0)
LinkedDC():Set_Int( 1, marrowDC:Count() )
if marrowDC ~= nil then
local number = marrowDC:Count()
for i = 0, (number-1) do
local card = marrowDC:Get_CardPtr(i)
if card ~= nil then
EffectController():Sacrifice( card )
end
end
end
</RESOLUTION_TIME_ACTION>

"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: Formal Request Thread
by Xander9009 » 13 Jul 2013, 09:51
It's literally the first thing with interrogations I've written. That's why I wanted someone else to look at it. It works. I just wasn't sure if it was going to screw up under some circumstance that I overlooked. (Well, I'm sure everything we code will screw up under some circumstance. But you know what I mean.)thefiremind wrote:I'm not sure if it works since I'm still not very confident with interrogations, but if I had to try and code it, I would have coded it like that. Just test and see.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Formal Request Thread
by BloodReyvyn » 13 Jul 2013, 10:09
Ugh... still no luck and when I cast Marrow Chomper, it gives me this CTD error every time: https://www.dropbox.com/s/j2f5cd7hykifw ... rt2014.png
I'm pretty much JUST hung up on THIS card and it is starting to really **** me off...
EDIT: And just as a curiosity, who else does NOT like the changed to the Legend/Planeswalker rules? Seems to me they just made Legends and PWs a lot less unique, but maybe that's just my opinion...
EDIT 2: And now it crashes if I so much as try to concede a match..... and when I had all of the abilities lumped into one it worked flawlessly... the first time I try a LinkedDC() it has this error, that error, and errors that don't really exist....
I'm pretty much JUST hung up on THIS card and it is starting to really **** me off...

EDIT: And just as a curiosity, who else does NOT like the changed to the Legend/Planeswalker rules? Seems to me they just made Legends and PWs a lot less unique, but maybe that's just my opinion...
EDIT 2: And now it crashes if I so much as try to concede a match..... and when I had all of the abilities lumped into one it worked flawlessly... the first time I try a LinkedDC() it has this error, that error, and errors that don't really exist....
"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: Formal Request Thread
by Fero » 13 Jul 2013, 11:26
Hi. I tried to make the Phyrexian Obliterator. But the ability dosen´t work. When He receive damage, the ability of sacrifice permanents won´t work.
Plese help!!!
Plese help!!!

- | Open
- <?xml version='1.0'?>
<CARD_V2>
<FILENAME text="PHYREXIAN_OBLITERATOR_999277185" />
<CARDNAME text="PHYREXIAN_OBLITERATOR" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Phyrexian Obliterator]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Oblitérateur phyrexian]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Arrasador pirexiano]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Phyrexianischer Auslöscher]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Annientatore di Phyrexia]]></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[Obliterador Phyrexiano]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="999277185" />
<ARTID value="999277185" />
<ARTIST name="Todd Lockwood" />
<CASTING_COST cost="{B}{B}{B}{B}" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Horror" />
<EXPANSION value="DPG" />
<RARITY metaname="M" />
<POWER value="5" />
<TOUGHNESS value="5" />
<STATIC_ABILITY filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Trample]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Piétinement]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Arrolla.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Verursacht Trampelschaden]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Travolgere]]></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[Atropelar]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION>
local characteristics = Object():GetCurrentCharacteristics()
characteristics:Characteristic_Set( CHARACTERISTIC_TRAMPLE, 1 )
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY dangerous="1" filter_zone="ZONE_IN_PLAY">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever a source deals damage to Phyrexian Obliterator, that source’s controller sacrifices that many permanents.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois qu’une source inflige des blessures à l’Oblitérateur phyrexian, le contrôleur de cette source sacrifie autant de permanents.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que una fuente haga daño al Arrasador pirexiano, el controlador de esa fuente sacrifica esa misma cantidad de permanentes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn eine Quelle dem Phyrexianischen Auslöscher Schaden zufügt, opfert der Beherrscher dieser Quelle entsprechend viele bleibende Karten.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta una fonte infligge danno all’Annientatore di Phyrexia, il controllore della fonte sacrifica altrettanti permanenti.]]></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[Toda vez que uma fonte causa dano a Obliterador Phyrexiano, o controlador daquela fonte sacrifica uma quantidade equivalente de permanentes.]]></LOCALISED_TEXT>
<TRIGGER value="CREATURE_TOOK_DAMAGE" simple_qualifier="self">
EffectDC():Set_CardPtr(2, SecondaryObject())
EffectDC():LKIShield_CardPtr(2)
return true
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local card = EffectDC():Get_CardPtr(2)
if card ~= nil then
local player = card:GetPlayer()
local amount = Damage():GetAmount()
local filter = Object():GetFilter()
if player ~= nil then
filter:Clear()
filter:NotTargetted()
filter:SetPlayer( player )
filter:SetHint( HINT_ENEMY, player )
filter:SetZone( ZONE_IN_PLAY )
player:SetTargetCount( amount )
EffectDC():Set_Int(1, amount)
for i=0,amount-1 do
player:SetTargetPrompt( i, "CARD_QUERY_CHOOSE_PERMANENT_TO_SACRIFICE" )
end
player:ChooseTargets( NO_VALIDATION, EffectDC():Make_Targets(0) )
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local amount = EffectDC():Get_Int(1)
if amount ~= nil then
for i = 0,amount-1 do
local target = EffectDC():Get_Targets(0):Get_CardPtr(i)
if target ~= nil then
local player = target:GetPlayer()
if player ~= nil then
target:Sacrifice(player)
end
end
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<HELP title="MORE_INFO_BADGE_TITLE_1" body="MORE_INFO_BADGE_BODY_1" zone="ZONE_ANY" />
<SFX text="COMBAT_CLAW_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_CLAW_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
<AI_BASE_SCORE score="600" zone="ZONE_IN_PLAY" />
</CARD_V2>
- Fero
- Posts: 15
- Joined: 13 Jul 2013, 06:07
- Has thanked: 0 time
- Been thanked: 0 time
Re: Formal Request Thread
by thefiremind » 13 Jul 2013, 11:33
I totally rewrote the code starting from Hellkite Hatchling. Try it:BloodReyvyn wrote:I'm pretty much JUST hung up on THIS card and it is starting to really **** me off...
- Marrow Chomper abilities (untested) | Open
- Code: Select all
<TRIGGERED_ABILITY replacement_query="1" linked_ability_group="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Devour 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Dévorement 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Devorar 2.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Verschlingen 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Divorare 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[貪食 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[포식 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Пожирание 2]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Devorar 2]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" from_zone="ZONE_ANY" />
<RESOLUTION_TIME_ACTION>
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
local max_victims = filter:Count()
if max_victims > 0 then
EffectController():SetItemCount(max_victims)
for i = 0,(max_victims-1) do
EffectController():SetItemPrompt (i, "CARD_QUERY_CHOOSE_CREATURE_TO_DEVOUR")
end
EffectDC():Set_Int(1, max_victims)
EffectController():ChooseItems( EffectDC():Make_Targets(0), QUERY_FLAG_UP_TO )
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local max_victims = EffectDC():Get_Int(1)
local devour_count = 0
for i=0,max_victims-1 do
local victim = EffectDC():Get_Targets(0):Get_CardPtr(i)
if victim ~= nil then
EffectController():Sacrifice(victim)
devour_count = devour_count + 1
LinkedDC():Set_Int(0, devour_count)
end
end
if EffectSource() ~= nil then
EffectSource():AddCounters( MTG():PlusOnePlusOneCounters(), devour_count*2 )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[When Marrow Chomper enters the battlefield, you gain 2 life for each creature it devoured.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Quand le Brifaud de moelle arrive sur le champ de bataille, vous gagnez 2 points de vie pour chaque créature qu’il a dévoré.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Cuando el Masticamédulas entre al campo de batalla, ganas 2 vidas por cada criatura que devoró.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Wenn der Markmampfer ins Spiel kommt, erhältst du für jede Kreatur, die er verschlungen hat, 2 Lebenspunkte dazu.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Quando il Masticamidollo entra nel campo di battaglia, guadagni 2 punti vita per ogni creatura che ha divorato.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[骨髄食いが場に出たとき、あなたはそれが貪食したクリーチャー1体につき2点のライフを得る。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[When Marrow Chomper enters the battlefield, you gain 2 life for each creature it devoured.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Когда Мозгопожиратель входит в игру, вы получаете 2 жизни за каждое пожранное им существо.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Quando Mascador de Medula entra no campo de batalha, você ganha 2 pontos de vida para cada criatura devorada por ele.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
local devour_count = LinkedDC():Get_Int(0)
if devour_count > 0 then
EffectController():GainLife(devour_count*2)
end
</RESOLUTION_TIME_ACTION>
<SFX text="CASTER_BUFF_PLAY" />
</TRIGGERED_ABILITY>
And what about mirror matches with decks that heavily count on a few legendary creatures? They can be fun now, while they weren't before.BloodReyvyn wrote:EDIT: And just as a curiosity, who else does NOT like the changed to the Legend/Planeswalker rules? Seems to me they just made Legends and PWs a lot less unique, but maybe that's just my opinion...
This code seems totally taken from DotP2013 without a single update. Of course it doesn't work.Fero wrote:Hi. I tried to make the Phyrexian Obliterator. But the ability dosen´t work. When He receive damage, the ability of sacrifice permanents won´t work.
Plese help!!!
EDIT: Try this:
PHYREXIAN_OBLITERATOR_277185.zip
- Version 2, fixed a DotP2013 leftover
- (2.79 KiB) Downloaded 263 times
EDIT 2: I'm not sure if the requester wanted Genju of the Falls for DotP2014 or 2013, anyway I coded it for DotP2014 and maybe someone else could be interested.
GENJU_OF_THE_FALLS_74582.zip
- (2.67 KiB) Downloaded 237 times
Last edited by thefiremind on 13 Jul 2013, 18:36, 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: 722 times
Re: Formal Request Thread
by BloodReyvyn » 13 Jul 2013, 13:33
Well, as usual you are a life-saver man. That code works flawlessly. 
So, finally done with this deck now that I moved some things around.
Question: Has anyone else been having the game wipe out their saved deck settings every time they start the game? It's been happening to me today. Only a minor annoyance as I usually main-deck everything I need to test, but still I thought there was a variable that helped each deck save its own setup.
Back to the off-topic discussion of the new PW rules, I don't know really. I don't think I have ever built a deck that relies on any given card. Usually my decks will get a boost from the card, but I always assume those kind of cards will be the fastest targets out of the gate. Then again, I usually only play magic IRL about every other week and it's always multiplayer. I guess the new rules aren't really game-breaking, I guess I just don't like all THAT much change at once... perhaps when I see what the new block sets have to offer it will be a less bitter pill to swallow.

So, finally done with this deck now that I moved some things around.
Question: Has anyone else been having the game wipe out their saved deck settings every time they start the game? It's been happening to me today. Only a minor annoyance as I usually main-deck everything I need to test, but still I thought there was a variable that helped each deck save its own setup.
Back to the off-topic discussion of the new PW rules, I don't know really. I don't think I have ever built a deck that relies on any given card. Usually my decks will get a boost from the card, but I always assume those kind of cards will be the fastest targets out of the gate. Then again, I usually only play magic IRL about every other week and it's always multiplayer. I guess the new rules aren't really game-breaking, I guess I just don't like all THAT much change at once... perhaps when I see what the new block sets have to offer it will be a less bitter pill to swallow.

"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 6 guests