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 nivmizzet1 » 15 Feb 2015, 13:51
Hi All,
I'd really like some help coding Darigaaz’s Charm. This is a slightly modified version (I added until EOT to third ability and AI simplified targeting) of the version from the community WAD apparently coded by volrathxp. Currently the first two abilities function as intended, however the third ability is broken -- it won't allow the user to select a target, and just resolves nothing instead. It generates the script_log "[lua] [string "DARIGAAZS_CHARM_SM_28546_TITLE (CONTINUOUS_ACTION)~0x0000081e"]:2: attempt to index a nil value".
[lua] [string "AVACYNS_COLLAR_SM_282368_TITLE (RESOLUTION_TIME_ACTION)~0x00000..."]:5: unexpected symbol near ')'", although I'm not sure if this is actually linked to the triggered ability not working, it may be another problem.
Cheers.
I'd really like some help coding Darigaaz’s Charm. This is a slightly modified version (I added until EOT to third ability and AI simplified targeting) of the version from the community WAD apparently coded by volrathxp. Currently the first two abilities function as intended, however the third ability is broken -- it won't allow the user to select a target, and just resolves nothing instead. It generates the script_log "[lua] [string "DARIGAAZS_CHARM_SM_28546_TITLE (CONTINUOUS_ACTION)~0x0000081e"]:2: attempt to index a nil value".
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<MODE_SELECT tag="MODE_CHOOSE_ONE">
<MODE tag="MODE_DAR_RETURN" index="1" />
<MODE tag="MODE_DAR_DAMAGE" index="2" />
<MODE tag="MODE_DAR_PUMP" index="3" />
</MODE_SELECT>
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_RETURN_TO_HAND" definition="0" compartment="0" mode="1" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:SetZone( ZONE_GRAVEYARD, EffectController() )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION mode="1">
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
target:PutInHand()
end
</RESOLUTION_TIME_ACTION>
<TARGET tag="CARD_QUERY_CHOOSE_DEAL_3_DAMAGE" definition="1" compartment="1" mode="2" count="1" />
<TARGET_DEFINITION id="1">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_CARDS + FILTER_TYPE_PLAYERS )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION mode="2">
local target_creature = EffectDC():Get_Targets(1):Get_CardPtr(0)
local target_player = EffectDC():Get_Targets(1):Get_PlayerPtr(0)
if ( target_creature ~= nil ) then
EffectSourceLKI():DealDamageTo( 3, target_creature )
elseif ( target_player ~= nil ) then
EffectSourceLKI():DealDamageTo( 3, target_player )
end
</RESOLUTION_TIME_ACTION>
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_GET_3_3" definition="2" compartment="0" mode="3" count="1" />
<TARGET_DEFINITION id="2">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<CONTINUOUS_ACTION layer="7C" mode="3">
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Power_Add( 3 )
characteristics:Toughness_Add( 3 )
end
</CONTINUOUS_ACTION>
<DURATION simple_duration="UntilEOT" />
<AI_SIMPLIFIED_TARGETING compartment="1" hint="HINT_ENEMY_ONLY" />
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ALLIED_ONLY" />
</SPELL_ABILITY>
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[• Return target creature card from your graveyard to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[• Return target creature card from your graveyard to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[• Return target creature card from your graveyard to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[• Return target creature card from your graveyard to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[• Return target creature card from your graveyard to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[• Return target creature card from your graveyard to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[• Return target creature card from your graveyard to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[• Return target creature card from your graveyard to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[• Return target creature card from your graveyard to your hand.]]></LOCALISED_TEXT>
</SPELL_ABILITY>
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[• Darigaaz’s Charm deals 3 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[• Darigaaz’s Charm deals 3 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[• Darigaaz’s Charm deals 3 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[• Darigaaz’s Charm deals 3 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[• Darigaaz’s Charm deals 3 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[• Darigaaz’s Charm deals 3 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[• Darigaaz’s Charm deals 3 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[• Darigaaz’s Charm deals 3 damage to target creature or player.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[• Darigaaz’s Charm deals 3 damage to target creature or player.]]></LOCALISED_TEXT>
</SPELL_ABILITY>
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[• Target creature gets +3/+3 until end of turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[• Target creature gets +3/+3 until end of turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[• Target creature gets +3/+3 until end of turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[• Target creature gets +3/+3 until end of turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[• Target creature gets +3/+3 until end of turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[• Target creature gets +3/+3 until end of turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[• Target creature gets +3/+3 until end of turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[• Target creature gets +3/+3 until end of turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[• Target creature gets +3/+3 until end of turn.]]></LOCALISED_TEXT>
</SPELL_ABILITY>
[lua] [string "AVACYNS_COLLAR_SM_282368_TITLE (RESOLUTION_TIME_ACTION)~0x00000..."]:5: unexpected symbol near ')'", although I'm not sure if this is actually linked to the triggered ability not working, it may be another problem.

- Code: Select all
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Equipped creature gets +1/+0 and has vigilance.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[La créature équipée gagne +1/+0 et a la vigilance.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[La criatura equipada obtiene +1/+0 y tiene vigilancia.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Die ausgerüstete Kreatur erhält +1/+0 und hat Wachsamkeit.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[La creatura equipaggiata prende +1/+0 e ha cautela.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[装備しているクリーチャーは+1/+0の修整を受けるとともに警戒を持つ。装備しているクリーチャーが死亡するたび、それが人間だった場合、飛行を持つ白の1/1のスピリット・クリーチャー・トークンを1体戦場に出す。 装備 {2}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[장착된 생물은 +1/+0을 받고 경계 능력을 가진다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Снаряженное существо получает +1/+0 и имеет Бдительность.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[A criatura equipada recebe +1/+0 e tem vigilância.]]></LOCALISED_TEXT>
<CONTINUOUS_ACTION layer="7C">
local parent = EffectSource():GetParent()
if parent ~= nil then
parent:GetCurrentCharacteristics():Power_Add( 1 )
end
</CONTINUOUS_ACTION>
<CONTINUOUS_ACTION layer="6">
local parent = EffectSource():GetParent()
if parent ~= nil then
parent:GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_VIGILANCE, 1 )
end
</CONTINUOUS_ACTION>
</STATIC_ABILITY>
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever equipped creature dies, if it was a Human, put a 1/1 white Spirit creature token with flying onto the battlefield.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[À chaque fois que la créature équipée meurt, si elle était un humain, mettez sur le champ de bataille un jeton de créature 1/1 blanche Esprit avec le vol.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Siempre que la criatura equipada muera, si era un Humano, pon en el campo de batalla una ficha de criatura Espíritu blanca 1/1 con la habilidad de volar.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Immer wenn die ausgerüstete Kreatur stirbt, bringe einen 1/1 weißen Geist-Kreaturenspielstein mit Flugfähigkeit ins Spiel, falls sie ein Mensch war.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Ogniqualvolta la creatura equipaggiata muore, se era un Umano, metti sul campo di battaglia una pedina creatura Spirito 1/1 bianca con volare.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever equipped creature dies, if it was a Human, put a 1/1 white Spirit creature token with flying onto the battlefield.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[장착된 생물이 죽을 때마다, 그 생물이 인간이었다면, 비행 능력을 가진 1/1 백색 신령 토큰 한 개를 전장에 놓는다.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Каждый раз когда снаряженное существо умирает, если оно было Человеком, положите на поле битвы одну фишку существа 1/1 белый Дух с Полетом.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Toda vez que a criatura equipada morrer, se ela for do tipo Humano, coloque no campo de batalha uma ficha de criatura branca 1/1 do tipo Espírito com voar.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_BEGIN" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIELD">
return TriggerObject() == EffectSource():GetParent()
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectSource() ~= nil then
local sacrificed = EffectDC():Get_Targets(6):Get_CardPtr(0)
if sacrificed ~= nil and sacrificed:GetSubType():Test(CREATURE_TYPE_HUMAN) then
MTG():PutTokensOntoBattlefield( "TOKEN_SPIRIT_1_1_W_F_350803", 1, EffectController() ) )
else
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Equip {2}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Équipement {2}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Equipar {2}.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Ausrüsten {2}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Equipaggiare {2}]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Equip {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[Equipar {2}]]></LOCALISED_TEXT>
<COST mana_cost="{2}" type="Mana" />
<AVAILABILITY sorcery_time="1" />
<AI_AVAILABILITY type="restriction" restriction_type="equip" />
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_EQUIP" 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() )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local target_card = EffectDC():Get_Targets(0):Get_CardPtr(0)
if (target_card ~= nil and EffectSource() ~= nil) then
EffectSource():Attach( target_card )
end
</RESOLUTION_TIME_ACTION>
<AUTO_SKIP>
local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
return false
else
return true
end
</AUTO_SKIP>
</ACTIVATED_ABILITY>
Cheers.
______________________________________
my DOTP 2014 Main mod page - my DOTP 2014 OP Decks mod page - Community WAD
my DOTP 2014 Main mod page - my DOTP 2014 OP Decks mod page - Community WAD
- nivmizzet1
- Posts: 617
- Joined: 21 Mar 2013, 10:10
- Has thanked: 100 times
- Been thanked: 25 times
Re: Formal Request Thread
by RiiakShiNal » 15 Feb 2015, 14:49
Well, on the first card, Darigaaz'a Charm, I don't actually see any problems so my guess is that the CONTINUOUS_ACTION block is somehow getting processed before the TARGET block and thus errors out before the target gets set. So try changing the line that gets the target to this:
As for Avacyn's Collar the problem here is easy, you have one too many end parenthesis at the end of the line:
- Code: Select all
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
As for Avacyn's Collar the problem here is easy, you have one too many end parenthesis at the end of the line:
- Code: Select all
MTG():PutTokensOntoBattlefield( "TOKEN_SPIRIT_1_1_W_F_350803", 1, EffectController() ) )
- Code: Select all
MTG():PutTokensOntoBattlefield( "TOKEN_SPIRIT_1_1_W_F_350803", 1, EffectController() )
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Formal Request Thread
by Xander9009 » 15 Feb 2015, 16:28
Quick question about Sage-Eye Avengers. Should I be able to target any creature and have the resolution take care of the power check, or should that be part of the target definition?
The way it's worded, it appears I should be able to target any creature, since target restrictions are usually handled with "target creature with power less than..." In this case, it seems like I'd be allowed to target a more powerful creature, but the creature would only be bounced if its power is low enough during resolution.
This is particularly important for a card with prowess. Thoughts? I'm coding it the way I think it should be, but I'd much rather have someone else's opinion.
EDIT: Another question for those that know the language well (meaning mainly you, Riiak), are there any known duration attributes besides simple_duration="UntilEOT"? I just ran a scan on every card in the CW, and that's the ONLY one it found. (Recorded every instance of the duration tag, and after elimination duplicate results, that was the only result with any attributes at all.)
The way it's worded, it appears I should be able to target any creature, since target restrictions are usually handled with "target creature with power less than..." In this case, it seems like I'd be allowed to target a more powerful creature, but the creature would only be bounced if its power is low enough during resolution.
This is particularly important for a card with prowess. Thoughts? I'm coding it the way I think it should be, but I'd much rather have someone else's opinion.
EDIT: Another question for those that know the language well (meaning mainly you, Riiak), are there any known duration attributes besides simple_duration="UntilEOT"? I just ran a scan on every card in the CW, and that's the ONLY one it found. (Recorded every instance of the duration tag, and after elimination duplicate results, that was the only result with any attributes at all.)
_______________________________
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 RiiakShiNal » 15 Feb 2015, 19:54
For Sage-Eye Avengers I believe it should be able to target any creature with the bounce only occurring if the power is less at resolution (due to the wording).
The attribute simple_duration is not actually part of the language (the language is Lua and it's language reference is here), it is part of the object XML definition defined by the DotP engine. A search of the executable shows UntilEOT in a single location (defined as unicode) with other terms around it, but I can't see any of those other terms really being useful for durations. So the only value I know of that can be used for simple_duration is UntilEOT.
The attribute simple_duration is not actually part of the language (the language is Lua and it's language reference is here), it is part of the object XML definition defined by the DotP engine. A search of the executable shows UntilEOT in a single location (defined as unicode) with other terms around it, but I can't see any of those other terms really being useful for durations. So the only value I know of that can be used for simple_duration is UntilEOT.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Formal Request Thread
by Xander9009 » 15 Feb 2015, 20:22
Sage-Eye Avengers: Thanks.
simple_duration: Yeah, I knew it was specific to the DotP engine; I just wasn't sure if there were any other known values. That's alright. I just figured it would useful to have one for no_effect_source like the auto_skip tag. But then again, I'm not even certain that it's needed. Do you happen to know if the duration tag is necessary here? (This is the kind of situation I was thinking another simple duration would be useful.)
simple_duration: Yeah, I knew it was specific to the DotP engine; I just wasn't sure if there were any other known values. That's alright. I just figured it would useful to have one for no_effect_source like the auto_skip tag. But then again, I'm not even certain that it's needed. Do you happen to know if the duration tag is necessary here? (This is the kind of situation I was thinking another simple duration would be useful.)
- Code: Select all
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[As Monastery Siege enters the battlefield, choose Khans or Dragons.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
local EffectController = EffectController()
if EffectController ~= nil then
EffectController:BeginNewMultipleChoice()
EffectController:AddMultipleChoiceAnswer("CARD_QUERY_OPTION_KHANS")
EffectController:AddMultipleChoiceAnswer("CARD_QUERY_OPTION_DRAGONS")
EffectController:AskMultipleChoiceQuestion( "CARD_QUERY_MONASTERY_SIEGE_CHOOSE_KHANS_OR_DRAGONS", EffectSource() )
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="6">
local EffectController = EffectController()
if EffectController ~= nil and EffectController:GetMultipleChoiceResult() == 0 then
EffectSource():GrantAbility(0)
else
EffectSource():GrantAbility(1)
end
</CONTINUOUS_ACTION>
<DURATION>
return EffectSource ~= nil
</DURATION>
</STATIC_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 RiiakShiNal » 16 Feb 2015, 02:42
Well, your ability is a mess. For one it should be split into 2 linked abilities, one TRIGGERED_ABILITY for selecting Khans or Dragons and a second STATIC_ABILITY to grant the appropriate chosen ability. Duration won't be needed for either ability.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Formal Request Thread
by nivmizzet1 » 16 Feb 2015, 03:58
Thanks Riiak. Judging by the script_log I thought the problem with Avacyn's collar would be something like that, but for some reason I couldn't see it until you pointed it out. I removed the extra bracket but the token is still not being generatedRiiakShiNal wrote:Well, on the first card, Darigaaz'a Charm, I don't actually see any problems so my guess is that the CONTINUOUS_ACTION block is somehow getting processed before the TARGET block and thus errors out before the target gets set. So try changing the line that gets the target to this:If nothing else that will get rid of the script error and hopefully will allow it to work (though I'm not sure why it isn't getting set in the first place). Are you sure you had a creature in play when you tried to use mode 3?
- Code: Select all
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
As for Avacyn's Collar the problem here is easy, you have one too many end parenthesis at the end of the line:It should be:
- Code: Select all
MTG():PutTokensOntoBattlefield( "TOKEN_SPIRIT_1_1_W_F_350803", 1, EffectController() ) )
- Code: Select all
MTG():PutTokensOntoBattlefield( "TOKEN_SPIRIT_1_1_W_F_350803", 1, EffectController() )

Unfortunately, that adjustment to Darigaaz'a Charm didn't work either, but it did stop the script_log being generated, as you said. And yes, there has definitely been a creature in play all times that I've attempted to use mode 3.
Last edited by nivmizzet1 on 16 Feb 2015, 05:43, edited 1 time in total.
______________________________________
my DOTP 2014 Main mod page - my DOTP 2014 OP Decks mod page - Community WAD
my DOTP 2014 Main mod page - my DOTP 2014 OP Decks mod page - Community WAD
- nivmizzet1
- Posts: 617
- Joined: 21 Mar 2013, 10:10
- Has thanked: 100 times
- Been thanked: 25 times
Re: Formal Request Thread
by Xander9009 » 16 Feb 2015, 04:18
To be fair, I just pasted in some code and then stopped when I started wondering about the DURATION. It wasn't anywhere close to being completed. However, why can't I leave the continuous action in the triggered ability instead of splitting them up?RiiakShiNal wrote:Well, your ability is a mess. For one it should be split into 2 linked abilities, one TRIGGERED_ABILITY for selecting Khans or Dragons and a second STATIC_ABILITY to grant the appropriate chosen ability. Duration won't be needed for either ability.
Doesn't really matter, though. I can't think of a reliable way to make an unrelated card cost more based on what it targets.
You're usingnivmizzet1 wrote:Thanks Riiak. Judging by the script_log I thought the problem with Avacyn's collar was something like that, but for some reason I couldn't see it until you pointed it out. I removed the extra bracket but the token is still not being generatedThe new script_log says "[lua] [string "AVACYNS_COLLAR_SM_282368_TITLE (RESOLUTION_TIME_ACTION)~0x00000424"]:3: attempt to index a nil value"
Unfortunately, that adjustment to Darigaaz'a Charm didn't work either, but it did stop the script_log being generated, as you said. And yes, there has definitely been a creature in play all times that I've attempted to use mode 3.
- Code: Select all
local sacrificed = EffectDC():Get_Targets(6):Get_CardPtr(0)
- Code: Select all
local sacrificed = EffectDC():Get_Targets(6) and EffectDC():Get_Targets(6):Get_CardPtr(0)
- Code: Select all
<TRIGGER value="ZONECHANGE_BEGIN" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIELD">
local TriggerObject = TriggerObject()
local EffectSource = EffectSource()
if TriggerObject ~= nil and EffectSource ~= nil then
local Parent = EffectSource:GetParent()
if Parent ~= nil and TriggerObject == Parent then
if Parent:GetSubType():Test(CREATURE_TYPE_HUMAN) then
EffectDC():Set_Int(0, 1)
else
EffectDC():Set_Int(0, 0)
end
end
return true
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectDC():Get_Int(0) == 1 and EffectController() ~= nil then
MTG():PutTokensOntoBattlefield( "TOKEN_SPIRIT_1_1_W_F_350803", 1, EffectController() )
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 nivmizzet1 » 16 Feb 2015, 06:11
Thanks Xander. That code did improve Avacyn's Collar in that it's now generating tokens when it should, but the trigger is activating every time anything goes to the graveyard, even things the opponent controls, not just when the equipped creature goes to the graveyard. Do you have any idea how this can be fixed?
EDIT: and the program created a dump file when the game was complete.
EDIT 2: Is there a simple_qualifier e.g. "objectyoucontrol" that could be added to make it work properly? I'm guessing there's no simple_qualifier="creatureequippedwithavacyn'scollar" lol
EDIT 3: I thought adding a filter on the trigger might at least help to reduce the number of instances that make it trigger, but it didn't change anything. EDIT: Acutally, it seems to have prevented the token generation
EDIT: and the program created a dump file when the game was complete.
EDIT 2: Is there a simple_qualifier e.g. "objectyoucontrol" that could be added to make it work properly? I'm guessing there's no simple_qualifier="creatureequippedwithavacyn'scollar" lol
EDIT 3: I thought adding a filter on the trigger might at least help to reduce the number of instances that make it trigger, but it didn't change anything. EDIT: Acutally, it seems to have prevented the token generation


- Code: Select all
<TRIGGER value="ZONECHANGE_BEGIN" to_zone="ZONE_GRAVEYARD" from_zone="ZONE_BATTLEFIELD">
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CREATURE_TYPE_HUMAN )
filter:Add( FE_CONTROLLER, OP_IS, EffectController())
</FILTER>
local TriggerObject = TriggerObject()
local EffectSource = EffectSource()
if TriggerObject ~= nil and EffectSource ~= nil then
local Parent = EffectSource:GetParent()
if Parent ~= nil and TriggerObject == Parent then
if Parent:GetSubType():Test(CREATURE_TYPE_HUMAN) then
EffectDC():Set_Int(0, 1)
else
EffectDC():Set_Int(0, 0)
end
end
return true
end
return false
</TRIGGER>
______________________________________
my DOTP 2014 Main mod page - my DOTP 2014 OP Decks mod page - Community WAD
my DOTP 2014 Main mod page - my DOTP 2014 OP Decks mod page - Community WAD
- nivmizzet1
- Posts: 617
- Joined: 21 Mar 2013, 10:10
- Has thanked: 100 times
- Been thanked: 25 times
Re: Formal Request Thread
by Xander9009 » 16 Feb 2015, 11:35
It's triggering all the time because I put the "return true" outside of the if block that check's if the dead creature was the collar's parent. Move that up into that if block and it should fire when it should.
For the error log, do you have a token registration? Basically, put this line somewhere in the card inside <CARD_V2 ExportVersion="1">...</CARD_V2> but outside of any other tags (does not go inside an ability block).
For the error log, do you have a token registration? Basically, put this line somewhere in the card inside <CARD_V2 ExportVersion="1">...</CARD_V2> but outside of any other tags (does not go inside an ability block).
- Code: Select all
<TOKEN_REGISTRATION reservation="1" type="TOKEN_SPIRIT_1_1_W_F_350803" />
Last edited by Xander9009 on 16 Feb 2015, 11: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 RiiakShiNal » 16 Feb 2015, 11:49
I don't know what is causing the problem then because the card looks correct.nivmizzet1 wrote:Unfortunately, that adjustment to Darigaaz'a Charm didn't work either, but it did stop the script_log being generated, as you said. And yes, there has definitely been a creature in play all times that I've attempted to use mode 3.
Well, you could leave the CONTINUOUS_ACTION in a TRIGGERED_ABILITY (except you had it as a STATIC_ABILITY so it would never actually trigger). Then you would need a DURATION and it just becomes a bit more of a hassle.Xander9009 wrote:To be fair, I just pasted in some code and then stopped when I started wondering about the DURATION. It wasn't anywhere close to being completed. However, why can't I leave the continuous action in the triggered ability instead of splitting them up?
Doesn't really matter, though. I can't think of a reliable way to make an unrelated card cost more based on what it targets.
There isn't a good way to make a card cost more based on what it targets.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Formal Request Thread
by nivmizzet1 » 16 Feb 2015, 13:54
Yep, that all worked. Cheers!Xander9009 wrote:It's triggering all the time because I put the "return true" outside of the if block that check's if the dead creature was the collar's parent. Move that up into that if block and it should fire when it should.
For the error log, do you have a token registration? Basically, put this line somewhere in the card inside <CARD_V2 ExportVersion="1">...</CARD_V2> but outside of any other tags (does not go inside an ability block).If you don't already have that line, then it might fix the error log being generated. If you did already have that line, then I'm not sure why it's doing that. If that's the case, let me know and I'll test it myself.
- Code: Select all
<TOKEN_REGISTRATION reservation="1" type="TOKEN_SPIRIT_1_1_W_F_350803" />
RiiakShiNal wrote:I don't know what is causing the problem then because the card looks correct.nivmizzet1 wrote:Unfortunately, that adjustment to Darigaaz'a Charm didn't work either, but it did stop the script_log being generated, as you said. And yes, there has definitely been a creature in play all times that I've attempted to use mode 3.

______________________________________
my DOTP 2014 Main mod page - my DOTP 2014 OP Decks mod page - Community WAD
my DOTP 2014 Main mod page - my DOTP 2014 OP Decks mod page - Community WAD
- nivmizzet1
- Posts: 617
- Joined: 21 Mar 2013, 10:10
- Has thanked: 100 times
- Been thanked: 25 times
Re: Formal Request Thread
by Xander9009 » 16 Feb 2015, 14:40
I just tested every one of this code's modes, including targeting a creature and a player with the second ability. I made sure the options were properly grayed out when an option shouldn't be a valid choice. The only thing I didn't test was the creature/player/card becoming invalid by the time it resolves.
- Darigaaz's Charm | Open
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Choose one —]]></LOCALISED_TEXT>
<MODE_SELECT tag="MODE_CHOOSE_ONE">
<MODE tag="MODE_DAR_RETURN" index="1" />
<MODE tag="MODE_DAR_DAMAGE" index="2" />
<MODE tag="MODE_DAR_PUMP" index="3" />
</MODE_SELECT>
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_RETURN_TO_HAND" definition="1" compartment="1" mode="1" count="1" />
<TARGET_DEFINITION id="1">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:SetZone( ZONE_GRAVEYARD, EffectController() )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION mode="1">
local target = EffectDC():Get_Targets(1) and EffectDC():Get_Targets(1):Get_CardPtr(0)
if target ~= nil then
target:PutInHand()
end
</RESOLUTION_TIME_ACTION>
<TARGET tag="CARD_QUERY_CHOOSE_DEAL_3_DAMAGE" definition="2" compartment="2" mode="2" count="1" />
<TARGET_DEFINITION id="2">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_CARDS + FILTER_TYPE_PLAYERS )
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION mode="2">
local target_creature = EffectDC():Get_Targets(2) and EffectDC():Get_Targets(2):Get_CardPtr(0)
local target_player = EffectDC():Get_Targets(2) and EffectDC():Get_Targets(2):Get_PlayerPtr(0)
if ( target_creature ~= nil ) then
EffectSourceLKI():DealDamageTo( 3, target_creature )
elseif ( target_player ~= nil ) then
EffectSourceLKI():DealDamageTo( 3, target_player )
end
</RESOLUTION_TIME_ACTION>
<TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_GET_3_3" definition="3" compartment="3" mode="3" count="1" />
<TARGET_DEFINITION id="3">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<CONTINUOUS_ACTION layer="7C" mode="3">
local target = EffectDC():Get_Targets(3) and EffectDC():Get_Targets(3):Get_CardPtr(0)
if target ~= nil then
local characteristics = target:GetCurrentCharacteristics()
characteristics:Power_Add( 3 )
characteristics:Toughness_Add( 3 )
end
</CONTINUOUS_ACTION>
<DURATION simple_duration="UntilEOT" />
<AI_SIMPLIFIED_TARGETING compartment="2" hint="HINT_ENEMY_ONLY" />
<AI_SIMPLIFIED_TARGETING compartment="3" hint="HINT_ALLIED_ONLY" />
</SPELL_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 RiiakShiNal » 16 Feb 2015, 16:09
In this case the compartments should not have mattered as they were all separated by modes and within each mode they were properly matched.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
Re: Formal Request Thread
by Xander9009 » 16 Feb 2015, 17:41
Yeah, I also didn't see anything wrong with the ids or compartments. I just changed them because that's how I always try to handle modes just to keep everything simple and easy to follow. I imagine it must have been something else I changed without realizing it (or the issue is specific to his setup).
_______________________________
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
Who is online
Users browsing this forum: No registered users and 43 guests