Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Report cards error here
Moderator: CCGHQ Admins
Re: Report cards error here
by GrovyleXShinyCelebi » 22 Sep 2013, 15:57
Cool, also, do you know how to set an interrogation so only to check permanents (I know permanent isn't a card type and looking through the interrogation functions I can't find any way to make it so an interrogation will check when a permanent enters the graveyard from the battlefield this turn; I don't yet know if AddType works for interrogations).
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-
GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by thefiremind » 22 Sep 2013, 18:19
If something enters the battlefield from the graveyard, then it's a permanent, there's no doubt about it: it can't be instant or sorcery because it entered the battlefield, and it can't be an invisible token because it was in the graveyard. So I'd suggest to ignore the check for the card type.GrovyleXShinyCelebi wrote:Cool, also, do you know how to set an interrogation so only to check permanents (I know permanent isn't a card type and looking through the interrogation functions I can't find any way to make it so an interrogation will check when a permanent enters the graveyard from the battlefield this turn; I don't yet know if AddType works for interrogations).
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Report cards error here
by GrovyleXShinyCelebi » 22 Sep 2013, 23:11
Odd, I tried exactly what you said with Bitter Ordeal, and each time my spell hits the graveyard a new clone of the spell pops up, then another one appears when THAT clone hits the graveyard, and it's just an endless cycle.thefiremind wrote:If something enters the battlefield from the graveyard, then it's a permanent, there's no doubt about it: it can't be instant or sorcery because it entered the battlefield, and it can't be an invisible token because it was in the graveyard. So I'd suggest to ignore the check for the card type.GrovyleXShinyCelebi wrote:Cool, also, do you know how to set an interrogation so only to check permanents (I know permanent isn't a card type and looking through the interrogation functions I can't find any way to make it so an interrogation will check when a permanent enters the graveyard from the battlefield this turn; I don't yet know if AddType works for interrogations).
I'm sure I said from ZONE_BATTLEFIELD, not ZONE_STACK. I don't have access to my code now, but do you know why this is happening?
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-
GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by thefiremind » 22 Sep 2013, 23:36
This is the code from Caller of the Claw (official expansion):GrovyleXShinyCelebi wrote:Odd, I tried exactly what you said with Bitter Ordeal, and each time my spell hits the graveyard a new clone of the spell pops up, then another one appears when THAT clone hits the graveyard, and it's just an endless cycle.
- Caller of the Claw official interrogation code | Open
- Code: Select all
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetPlayer( EffectController() )
interrogation:SetFromZone( ZONE_BATTLEFIELD )
interrogation:SetToZone( ZONE_GRAVEYARD )
interrogation:SetType( CARD_TYPE_CREATURE )
interrogation:SetNonTokenOnly()
local tokens = interrogation:Count( INTERROGATE_CARDS_MOVED_ZONE, INTERROGATE_THIS_TURN )
- My guess about what's enough for gravestorm | Open
- Code: Select all
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetFromZone( ZONE_BATTLEFIELD )
interrogation:SetToZone( ZONE_GRAVEYARD )
local count = interrogation:Count( INTERROGATE_CARDS_MOVED_ZONE, INTERROGATE_THIS_TURN )
If you add a SetType with a permanent type of your choice, does it correctly count the permanents of that type that go to the graveyard from the battlefield? If it does, then this should work:
- A better guess (hopefully) | Open
- Code: Select all
local count = 0
for t=CARD_TYPE_ARTIFACT,CARD_TYPE_PLANESWALKER do
if t ~= CARD_TYPE_INSTANT then
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetFromZone( ZONE_BATTLEFIELD )
interrogation:SetToZone( ZONE_GRAVEYARD )
interrogation:SetType( t )
count = count + interrogation:Count( INTERROGATE_CARDS_MOVED_ZONE, INTERROGATE_THIS_TURN )
end
end
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Report cards error here
by GrovyleXShinyCelebi » 23 Sep 2013, 22:18
So I playtested Bitter Ordeal, making the modification to the interrogation query as shown here:
What's going on here?
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Gravestorm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Déluge de cimetière]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Gravestorm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[ Gräbersturm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tempesta sepolcrale]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[ 墓地ストーム]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Gravestorm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Могильный шторм]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Rajada Tumular]]></LOCALISED_TEXT>
<TRIGGERED_ABILITY active_zone="ZONE_STACK">
<TRIGGER value="SPELL_PLAYED" simple_qualifier="self" />
<RESOLUTION_TIME_ACTION>
local count = 0
for t=CARD_TYPE_ARTIFACT,CARD_TYPE_PLANESWALKER do
if t ~= CARD_TYPE_INSTANT then
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetFromZone( ZONE_BATTLEFIELD )
interrogation:SetToZone( ZONE_GRAVEYARD )
interrogation:SetType( t )
count = count + interrogation:Count( INTERROGATE_CARDS_MOVED_ZONE, INTERROGATE_THIS_TURN )
if count > 0 then
for i=0,count-1 do
local copy = EffectController():CopySpell( EffectSourceLKI() )
EffectController():ChooseNewTargets(copy)
end
end
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
</SPELL_ABILITY>
What's going on here?
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-
GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by thefiremind » 23 Sep 2013, 23:09
You nested the code wrong... the copies should be made outside the card type loop. You may also want to prevent the bug where the additional copies won't allow you to choose any target if the original spell leaves the stack before they are created, as I explained here. Enclosing the triggered ability inside a spell ability probably messed up things even more (I know that my web generator will put gravestorm into a SPELL_ABILITY, but that's just because I set it as the default behaviour for instants and sorceries ).GrovyleXShinyCelebi wrote:This time, though, the card makes FOUR copies of the card whenever the original hits the graveyard, and then when THOSE clones hit the graveyard THOSE ones make FOUR copies of themselves...
What's going on here?
- Code: Select all
<TRIGGERED_ABILITY active_zone="ZONE_STACK">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Gravestorm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Déluge de cimetière]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Gravestorm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Gräbersturm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tempesta sepolcrale]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[墓地ストーム]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Gravestorm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Могильный шторм]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Rajada Tumular]]></LOCALISED_TEXT>
<TRIGGER value="SPELL_PLAYED" simple_qualifier="self">
EffectDC():Make_Chest(0):CopyFrom( TriggerObject():GetDataChest() )
return true
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local count = 0
for t=CARD_TYPE_ARTIFACT,CARD_TYPE_PLANESWALKER do
if t ~= CARD_TYPE_INSTANT then
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetFromZone( ZONE_BATTLEFIELD )
interrogation:SetToZone( ZONE_GRAVEYARD )
interrogation:SetType( t )
count = count + interrogation:Count( INTERROGATE_CARDS_MOVED_ZONE, INTERROGATE_THIS_TURN )
end
end
if count > 0 then
for i=0,count-1 do
local copy = EffectController():CopySpell( TriggerObjectLKI(), EffectDC():Get_Chest(0) )
EffectController():ChooseNewTargets(copy)
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Report cards error here
by GrovyleXShinyCelebi » 23 Sep 2013, 23:53
Aah! I can't believe I'd put a TRIGGERED_ABILITY block inside of a SPELL_ABILITY block and not notice itthefiremind wrote:You nested the code wrong... the copies should be made outside the card type loop. You may also want to prevent the bug where the additional copies won't allow you to choose any target if the original spell leaves the stack before they are created, as I explained here. Enclosing the triggered ability inside a spell ability probably messed up things even more (I know that my web generator will put gravestorm into a SPELL_ABILITY, but that's just because I set it as the default behaviour for instants and sorceries ).GrovyleXShinyCelebi wrote:This time, though, the card makes FOUR copies of the card whenever the original hits the graveyard, and then when THOSE clones hit the graveyard THOSE ones make FOUR copies of themselves...
What's going on here?Now that I think about it, the copies that you blamed on the gravestorm ability triggering on any kind of card might actually have been created because gravestorm was inside a SPELL_ABILITY, so it was executed as a part of the spell resolution. If that's so, then the loop on card types would be useless, and my "first guess" on the previous topic would be enough.
- Code: Select all
<TRIGGERED_ABILITY active_zone="ZONE_STACK">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Gravestorm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Déluge de cimetière]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Gravestorm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Gräbersturm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tempesta sepolcrale]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[墓地ストーム]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Gravestorm]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Могильный шторм]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Rajada Tumular]]></LOCALISED_TEXT>
<TRIGGER value="SPELL_PLAYED" simple_qualifier="self">
EffectDC():Make_Chest(0):CopyFrom( TriggerObject():GetDataChest() )
return true
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local count = 0
for t=CARD_TYPE_ARTIFACT,CARD_TYPE_PLANESWALKER do
if t ~= CARD_TYPE_INSTANT then
local interrogation = MTG():ClearInterrogationQuery()
interrogation:SetFromZone( ZONE_BATTLEFIELD )
interrogation:SetToZone( ZONE_GRAVEYARD )
interrogation:SetType( t )
count = count + interrogation:Count( INTERROGATE_CARDS_MOVED_ZONE, INTERROGATE_THIS_TURN )
end
end
if count > 0 then
for i=0,count-1 do
local copy = EffectController():CopySpell( TriggerObjectLKI(), EffectDC():Get_Chest(0) )
EffectController():ChooseNewTargets(copy)
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
Thanks for catching my mistake!
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-
GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by GrovyleXShinyCelebi » 24 Sep 2013, 23:32
Another problem:
I've been trying to make Archangel of Strife for about an hour, and nothing seems to be working:
Taking out all references to the "player" variable (including "card:GetOwner() == player") I get a card that gives all creatures +6/+0 ... regardless to how I answer the multiple choice!
Can anyone be of assistance? Huge thanks!
I've been trying to make Archangel of Strife for about an hour, and nothing seems to be working:
- Code: Select all
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Archangel of Strife]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Archange de la discorde]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Arcángel del conflicto]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Erzengel des Streits]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Arcangelo del Conflitto]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[敵対の大天使]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Archangel of Strife]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Archangel of Strife]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Archangel of Strife]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="228246" />
<ARTID value="131682" />
<ARTIST name="Greg Staples" />
<CASTING_COST cost="" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Angel" />
<EXPANSION value="CMD" />
<RARITY metaname="R" />
<POWER value="6" />
<TOUGHNESS value="6" />
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au moment où l’Archange de la discorde arrive sur le champ de bataille, chaque joueur choisit entre la guerre et la paix.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[En cuanto el Arcángel del conflicto entre al campo de batalla, cada jugador elige guerra o paz.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sowie der Erzengel des Streits ins Spiel kommt, bestimmt jeder Spieler „Krieg” oder „Frieden”.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mentre l’Arcangelo del Conflitto entra nel campo di battaglia, ogni giocatore sceglie guerra o pace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[敵対の大天使が戦場に出るに際し、各プレイヤーは「戦争」か「平和」のいずれかを選ぶ。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION repeating="1">
local n = MTG():GetActionRepCount()
local jugadores = MTG():GetNumberOfPlayers()
if (n < jugadores) then
local player = MTG():GetNthPlayer(n)
player:BeginNewMultipleChoice()
player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_WAR" )
player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PEACE" )
player:AskMultipleChoiceQuestion( "CARD_QUERY_MC_CHOOSE_WAR_OR_PEACE" )
else
for i=0, (jugadores-1) do
local player = MTG():GetNthPlayer(i)
local result = player:GetMultipleChoiceResult()
LinkedDC():Set_Int(i, result)
LinkedDC():Set_PlayerPtr(4+i, player)
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les créatures contrôlées par les joueurs qui ont choisi la guerre gagnent +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Las criaturas controladas por los jugadores que eligieron guerra obtienen +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreaturen, die von Spielern kontrolliert werden, die „Krieg” gewählt haben, erhalten +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le creature controllate dai giocatori che hanno scelto guerra prendono +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「戦争」を選んだプレイヤーがコントロールするクリーチャーは+3/+0の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</FILTER>
<CONTINUOUS_ACTION layer="7C" filter_id="0">
local card = FilteredCard()
if card ~= nil then
local n = MTG():GetNumberOfPlayers()
for i=0, (n-1) do
local result = LinkedDC():Get_Int(i)
local player = LinkedDC():Get_PlayerPtr(4+i)
if (result ~= nil) and (player ~= nil) then
if (result == 0) and (card:GetOwner() == player ) then
card:GetCurrentCharacteristics():Power_Add( 3 )
card:GetCurrentCharacteristics():Toughness_Add( 0 )
elseif (result == 1) and (card:GetOwner() == player ) then
card:GetCurrentCharacteristics():Power_Add( 0 )
card:GetCurrentCharacteristics():Toughness_Add( 3 )
end
end
end
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les créatures contrôlées par les joueurs qui ont choisi la paix gagnent +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Las criaturas controladas por los jugadores que eligieron paz obtienen +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreaturen, die von Spielern kontrolliert werden, die „Frieden” gewählt haben, erhalten +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le creature controllate dai giocatori che hanno scelto pace prendono +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「平和」を選んだプレイヤーがコントロールするクリーチャーは+0/+3の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
</STATIC_ABILITY>
<HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
<SFX text="COMBAT_ANGEL_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_ANGEL_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
Taking out all references to the "player" variable (including "card:GetOwner() == player") I get a card that gives all creatures +6/+0 ... regardless to how I answer the multiple choice!
Can anyone be of assistance? Huge thanks!
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-
GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by thefiremind » 24 Sep 2013, 23:51
The repeating actions need a return value in order to decide if they need to be repeated (true) or not (false). The default is false, so your repeating action actually runs only once, asking the choice to the first player and doing nothing else. You need to add a "return true" before the "else".
About the static ability, why are you checking the owner of the creatures instead of the controller?
Last thing, the "As <this> enters the battlefield" triggers should be made in ZONECHANGE_TRANSITION. It's not really relevant for Archangel of Strife, but try to use ZONECHANGE_END on Sewer Nemesis and it will die before you can choose.
About the static ability, why are you checking the owner of the creatures instead of the controller?
Last thing, the "As <this> enters the battlefield" triggers should be made in ZONECHANGE_TRANSITION. It's not really relevant for Archangel of Strife, but try to use ZONECHANGE_END on Sewer Nemesis and it will die before you can choose.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Report cards error here
by GrovyleXShinyCelebi » 25 Sep 2013, 00:04
Hah! Thanks! Didn't know about the return value for the repeating actions!
Another thing, does COMPARTMENT_ID_PLR_REGISTER_0 work for Duels 2014?
Another thing, does COMPARTMENT_ID_PLR_REGISTER_0 work for Duels 2014?
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-
GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by thefiremind » 25 Sep 2013, 00:07
The constant is still defined, but that's not really important, you can use any register.GrovyleXShinyCelebi wrote:Another thing, does COMPARTMENT_ID_PLR_REGISTER_0 work for Duels 2014?
This is my attempt at coding the abilities:
- Archangel of Strife abilities (untested) | Open
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1" replacement_query="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au moment où l’Archange de la discorde arrive sur le champ de bataille, chaque joueur choisit entre la guerre et la paix.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[En cuanto el Arcángel del conflicto entre al campo de batalla, cada jugador elige guerra o paz.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sowie der Erzengel des Streits ins Spiel kommt, bestimmt jeder Spieler „Krieg” oder „Frieden”.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mentre l’Arcangelo del Conflitto entra nel campo di battaglia, ogni giocatore sceglie guerra o pace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[敵対の大天使が戦場に出るに際し、各プレイヤーは「戦争」か「平和」のいずれかを選ぶ。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION repeating="1">
local n = MTG():GetActionRepCount()
local nPlayers = MTG():GetNumberOfPlayers()
if n < nPlayers then
local player = MTG():GetNthPlayer(n)
player:BeginNewMultipleChoice()
player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_WAR" )
player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PEACE" )
player:AskMultipleChoiceQuestion( "CARD_QUERY_MC_CHOOSE_WAR_OR_PEACE" )
return true
else
for i=0,nPlayers-1 do
LinkedDC():Set_Int( i, MTG():GetNthPlayer(i):GetMultipleChoiceResult() )
end
end
return false
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les créatures contrôlées par les joueurs qui ont choisi la guerre gagnent +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Las criaturas controladas por los jugadores que eligieron guerra obtienen +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreaturen, die von Spielern kontrolliert werden, die „Krieg” gewählt haben, erhalten +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le creature controllate dai giocatori che hanno scelto guerra prendono +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「戦争」を選んだプレイヤーがコントロールするクリーチャーは+3/+0の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_LUA_CONDITION, 1, EffectController(), EffectDC() )
</FILTER>
<FILTER_CONDITION id="1">
local creature = FilteredCard()
if creature ~= nil then
local player = creature:GetController()
for i=0,MTG():GetNumberOfPlayers()-1 do
if player == MTG():GetNthPlayer(i) and LinkedDC():Get_Int(i) == 0 then
return true
end
end
end
return false
</FILTER_CONDITION>
<CONTINUOUS_ACTION layer="7C" filter_id="0">
if FilteredCard() ~= nil then
FilteredCard():GetCurrentCharacteristics():Power_Add(3)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les créatures contrôlées par les joueurs qui ont choisi la paix gagnent +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Las criaturas controladas por los jugadores que eligieron paz obtienen +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreaturen, die von Spielern kontrolliert werden, die „Frieden” gewählt haben, erhalten +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le creature controllate dai giocatori che hanno scelto pace prendono +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「平和」を選んだプレイヤーがコントロールするクリーチャーは+0/+3の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_LUA_CONDITION, 1, EffectController(), EffectDC() )
</FILTER>
<FILTER_CONDITION id="1">
local creature = FilteredCard()
if creature ~= nil then
local player = creature:GetController()
for i=0,MTG():GetNumberOfPlayers()-1 do
if player == MTG():GetNthPlayer(i) and LinkedDC():Get_Int(i) == 1 then
return true
end
end
end
return false
</FILTER_CONDITION>
<CONTINUOUS_ACTION layer="7C" filter_id="0">
if FilteredCard() ~= nil then
FilteredCard():GetCurrentCharacteristics():Toughness_Add(3)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Report cards error here
by GrovyleXShinyCelebi » 25 Sep 2013, 01:07
Something I don't get about ( FE_LUA_CONDITION, 1, EffectController(), EffectDC() ), why must you put "EffectController()" and "EffectDC()"? I believe the "1" means "if this condition return true", but what's up with the last 2 values?
Originally, I took Archangel of Strife as an opportunity to practice making a loop with "local parity = n % 2", but after it never working after a half hour of testing I decided to scrap that method and just pull off the code with the tried-and-true, copying-and-pasting from Fleshbag Marauder. Does that method get the same result as this one? Is it rendered obselete with repeating RESOLUTION_TIME_ACTION blocks?
Apologies for the barrage of n00b questions, I'm trying to learn some things from making this card.
Originally, I took Archangel of Strife as an opportunity to practice making a loop with "local parity = n % 2", but after it never working after a half hour of testing I decided to scrap that method and just pull off the code with the tried-and-true, copying-and-pasting from Fleshbag Marauder. Does that method get the same result as this one? Is it rendered obselete with repeating RESOLUTION_TIME_ACTION blocks?
Apologies for the barrage of n00b questions, I'm trying to learn some things from making this card.
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-
GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by thefiremind » 25 Sep 2013, 08:42
"1" means that you are referring to FILTER_CONDITION with id="1". I don't know why we need to specify EffectController() and EffectDC(), either... but official cards do that and it seems to work, so I don't bother.GrovyleXShinyCelebi wrote:Something I don't get about ( FE_LUA_CONDITION, 1, EffectController(), EffectDC() ), why must you put "EffectController()" and "EffectDC()"? I believe the "1" means "if this condition return true", but what's up with the last 2 values?
When you use parity you are using repeating actions anyway: the parity check is needed when you want to do something on even iterations and something different on odd iterations. If you use parity, you usually apply the effect of the latest choice before going on asking to the other players. I don't think this would have any impact on Archangel of Strife. DotP is usually loose on this kind of problems even on official cards. If you read the rules, you'll notice that when a choice must be performed by all players, the first to choose should be the active player, but this is totally ignored on DotP (unless they dynamically shift the active player to MTG():GetNthPlayer(0), which I never paid attention to, but something tells me they don't).GrovyleXShinyCelebi wrote:Originally, I took Archangel of Strife as an opportunity to practice making a loop with "local parity = n % 2", but after it never working after a half hour of testing I decided to scrap that method and just pull off the code with the tried-and-true, copying-and-pasting from Fleshbag Marauder. Does that method get the same result as this one? Is it rendered obselete with repeating RESOLUTION_TIME_ACTION blocks?
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: Report cards error here
by GrovyleXShinyCelebi » 25 Sep 2013, 23:45
So, I was testing out my Archangel of Strife and so far everything works except for one little thing: no matter if I select "War" or "Peace", the card just gives everything +3/+0 anyways! I tried out your code (you forgot an active_zone="ZONE_TRANSITION" tag, by the way ) but the problem is still there! I've tried everything I could for about another half hour, but nothing seems to be working! What could be going on? Has the result been mispointed so LinkedDC():Get_Int(i) will always return 0 regardless of what happens?thefiremind wrote:The constant is still defined, but that's not really important, you can use any register.GrovyleXShinyCelebi wrote:Another thing, does COMPARTMENT_ID_PLR_REGISTER_0 work for Duels 2014?
This is my attempt at coding the abilities:
- Archangel of Strife abilities (untested) | Open
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1" replacement_query="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au moment où l’Archange de la discorde arrive sur le champ de bataille, chaque joueur choisit entre la guerre et la paix.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[En cuanto el Arcángel del conflicto entre al campo de batalla, cada jugador elige guerra o paz.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sowie der Erzengel des Streits ins Spiel kommt, bestimmt jeder Spieler „Krieg” oder „Frieden”.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mentre l’Arcangelo del Conflitto entra nel campo di battaglia, ogni giocatore sceglie guerra o pace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[敵対の大天使が戦場に出るに際し、各プレイヤーは「戦争」か「平和」のいずれかを選ぶ。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION repeating="1">
local n = MTG():GetActionRepCount()
local nPlayers = MTG():GetNumberOfPlayers()
if n < nPlayers then
local player = MTG():GetNthPlayer(n)
player:BeginNewMultipleChoice()
player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_WAR" )
player:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PEACE" )
player:AskMultipleChoiceQuestion( "CARD_QUERY_MC_CHOOSE_WAR_OR_PEACE" )
return true
else
for i=0,nPlayers-1 do
LinkedDC():Set_Int( i, MTG():GetNthPlayer(i):GetMultipleChoiceResult() )
end
end
return false
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les créatures contrôlées par les joueurs qui ont choisi la guerre gagnent +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Las criaturas controladas por los jugadores que eligieron guerra obtienen +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreaturen, die von Spielern kontrolliert werden, die „Krieg” gewählt haben, erhalten +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le creature controllate dai giocatori che hanno scelto guerra prendono +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「戦争」を選んだプレイヤーがコントロールするクリーチャーは+3/+0の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_LUA_CONDITION, 1, EffectController(), EffectDC() )
</FILTER>
<FILTER_CONDITION id="1">
local creature = FilteredCard()
if creature ~= nil then
local player = creature:GetController()
for i=0,MTG():GetNumberOfPlayers()-1 do
if player == MTG():GetNthPlayer(i) and LinkedDC():Get_Int(i) == 0 then
return true
end
end
end
return false
</FILTER_CONDITION>
<CONTINUOUS_ACTION layer="7C" filter_id="0">
if FilteredCard() ~= nil then
FilteredCard():GetCurrentCharacteristics():Power_Add(3)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les créatures contrôlées par les joueurs qui ont choisi la paix gagnent +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Las criaturas controladas por los jugadores que eligieron paz obtienen +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreaturen, die von Spielern kontrolliert werden, die „Frieden” gewählt haben, erhalten +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le creature controllate dai giocatori che hanno scelto pace prendono +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「平和」を選んだプレイヤーがコントロールするクリーチャーは+0/+3の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_LUA_CONDITION, 1, EffectController(), EffectDC() )
</FILTER>
<FILTER_CONDITION id="1">
local creature = FilteredCard()
if creature ~= nil then
local player = creature:GetController()
for i=0,MTG():GetNumberOfPlayers()-1 do
if player == MTG():GetNthPlayer(i) and LinkedDC():Get_Int(i) == 1 then
return true
end
end
end
return false
</FILTER_CONDITION>
<CONTINUOUS_ACTION layer="7C" filter_id="0">
if FilteredCard() ~= nil then
FilteredCard():GetCurrentCharacteristics():Toughness_Add(3)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
(in Duels 2014)
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
Duels 2012: viewtopic.php?f=109&t=12152
Duels 2013: viewtopic.php?f=109&t=12481&p=137458#p137458
-
GrovyleXShinyCelebi - Posts: 294
- Joined: 12 Jun 2013, 18:23
- Has thanked: 14 times
- Been thanked: 37 times
Re: Report cards error here
by thefiremind » 26 Sep 2013, 08:44
In case someone already read what I wrote here before, well, forget it: the problem wasn't LinkedDC that gets wiped, but the repeating loop. In fact, even though GetMultipleChoiceResult now is called from the player, it seems that it can't be saved on a player basis. This means that the parity is needed. I tested the following code and it works.GrovyleXShinyCelebi wrote:So, I was testing out my Archangel of Strife and so far everything works except for one little thing: no matter if I select "War" or "Peace", the card just gives everything +3/+0 anyways! I tried out your code (you forgot an active_zone="ZONE_TRANSITION" tag, by the way ) but the problem is still there! I've tried everything I could for about another half hour, but nothing seems to be working! What could be going on? Has the result been mispointed so LinkedDC():Get_Int(i) will always return 0 regardless of what happens?
- Archangel of Strife abilities (2nd attempt) (tested) | Open
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1" replacement_query="1" active_zone="ZONE_TRANSITION">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Au moment où l’Archange de la discorde arrive sur le champ de bataille, chaque joueur choisit entre la guerre et la paix.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[En cuanto el Arcángel del conflicto entre al campo de batalla, cada jugador elige guerra o paz.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Sowie der Erzengel des Streits ins Spiel kommt, bestimmt jeder Spieler „Krieg” oder „Frieden”.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Mentre l’Arcangelo del Conflitto entra nel campo di battaglia, ogni giocatore sceglie guerra o pace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[敵対の大天使が戦場に出るに際し、各プレイヤーは「戦争」か「平和」のいずれかを選ぶ。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[As Archangel of Strife enters the battlefield, each player chooses war or peace.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_TRANSITION" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION repeating="1">
local n = MTG():GetActionRepCount()
local parity = n%2
local index = n/2
if index < MTG():GetNumberOfStartingPlayers() then
local player = MTG():GetNthStartingPlayer(index)
if player ~= nil then
if parity == 0 then
player:BeginNewMultipleChoice()
player:AddMultipleChoiceAnswer("CARD_QUERY_OPTION_WAR")
player:AddMultipleChoiceAnswer("CARD_QUERY_OPTION_PEACE")
player:AskMultipleChoiceQuestion( "CARD_QUERY_MC_CHOOSE_WAR_OR_PEACE", EffectSource() )
else
LinkedDC():Set_Int( index, player:GetMultipleChoiceResult()+1 )
end
end
return true
end
return false
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<STATIC_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les créatures contrôlées par les joueurs qui ont choisi la guerre gagnent +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Las criaturas controladas por los jugadores que eligieron guerra obtienen +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreaturen, die von Spielern kontrolliert werden, die „Krieg” gewählt haben, erhalten +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le creature controllate dai giocatori che hanno scelto guerra prendono +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「戦争」を選んだプレイヤーがコントロールするクリーチャーは+3/+0の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Creatures controlled by players who chose war get +3/+0.]]></LOCALISED_TEXT>
<FILTER filter_id="1">
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
filter:Add( FE_LUA_CONDITION, 1, EffectController(), EffectDC() )
</FILTER>
<FILTER_CONDITION id="1">
local creature = FilteredCard()
if creature ~= nil then
local player = creature:GetController()
for i=0,MTG():GetNumberOfStartingPlayers()-1 do
if player == MTG():GetNthStartingPlayer(i) and LinkedDC():Get_Int(i) == 1 then
return true
end
end
end
return false
</FILTER_CONDITION>
<CONTINUOUS_ACTION layer="7C" filter_id="1">
if FilteredCard() ~= nil then
FilteredCard():GetCurrentCharacteristics():Power_Add(3)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<STATIC_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Les créatures contrôlées par les joueurs qui ont choisi la paix gagnent +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Las criaturas controladas por los jugadores que eligieron paz obtienen +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Kreaturen, die von Spielern kontrolliert werden, die „Frieden” gewählt haben, erhalten +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Le creature controllate dai giocatori che hanno scelto pace prendono +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[「平和」を選んだプレイヤーがコントロールするクリーチャーは+0/+3の修整を受ける。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Creatures controlled by players who chose peace get +0/+3.]]></LOCALISED_TEXT>
<FILTER filter_id="2">
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
filter:Add( FE_LUA_CONDITION, 2, EffectController(), EffectDC() )
</FILTER>
<FILTER_CONDITION id="2">
local creature = FilteredCard()
if creature ~= nil then
local player = creature:GetController()
for i=0,MTG():GetNumberOfStartingPlayers()-1 do
if player == MTG():GetNthStartingPlayer(i) and LinkedDC():Get_Int(i) == 2 then
return true
end
end
end
return false
</FILTER_CONDITION>
<CONTINUOUS_ACTION layer="7C" filter_id="2">
if FilteredCard() ~= nil then
FilteredCard():GetCurrentCharacteristics():Toughness_Add(3)
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Who is online
Users browsing this forum: No registered users and 3 guests