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 thefiremind » 24 Jul 2013, 08:31
Exactly as the code you posted. If you encountered a problem with that code, it might be an engine limitation. What doesn't work?gorem2k wrote:How to code activated ability with![]()
in its cost?
But CREATURE isn't a constant, either... it should be CARD_TYPE_CREATURE.Master Necro wrote:But it just made logic to replace CREATURE WITH ENCHANTMENT.

First, remove all the mode="3", this isn't a modal spell.Master Necro wrote:And now I have a problem with Prahv, Spires of Order , it won't let me activate the second ability.
I think that the problem is how the target is coded: I was about to start coding Prahv for my Azorius deck, too, but I changed my mind because I didn't know how to code the target so that it allows the player to choose a card anywhere. Most of the times the damage will come from the battlefield or from the stack, but there are exceptions (Gempalm Incinerator for example). You would need a query that makes you choose a zone before you declare a target, but I have no idea about how to do that.
< 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 Master Necro » 24 Jul 2013, 08:37
Sincerely I just copied the third option from Rith's Charm but it looks I was to dumb to remove the mode="3".thefiremind wrote:Exactly as the code you posted. If you encountered a problem with that code, it might be an engine limitation. What doesn't work?gorem2k wrote:How to code activated ability with![]()
in its cost?
But CREATURE isn't a constant, either... it should be CARD_TYPE_CREATURE.Master Necro wrote:But it just made logic to replace CREATURE WITH ENCHANTMENT.
First, remove all the mode="3", this isn't a modal spell.Master Necro wrote:And now I have a problem with Prahv, Spires of Order , it won't let me activate the second ability.
I think that the problem is how the target is coded: I was about to start coding Prahv for my Azorius deck, too, but I changed my mind because I didn't know how to code the target so that it allows the player to choose a card anywhere. Most of the times the damage will come from the battlefield or from the stack, but there are exceptions (Gempalm Incinerator for example). You would need a query that makes you choose a zone before you declare a target, but I have no idea about how to do that.

-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by thefiremind » 24 Jul 2013, 08:43
Who made Rith's Charm? If it works, then it's a big step ahead... and I just noticed that your code has the delayed triggered ability nested inside the activated ability, which could be another reason why it doesn't work.Master Necro wrote:Sincerely I just copied the third option from Rith's Charm but it looks I was to dumb to remove the mode="3".
< 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 Master Necro » 24 Jul 2013, 08:50
Bugger me if I know it's from DATA_CORE_972.wad , and I have removed the mode="3" and it still doesn't let me activate it...thefiremind wrote:Who made Rith's Charm? If it works, then it's a big step ahead... and I just noticed that your code has the delayed triggered ability nested inside the activated ability, which could be another reason why it doesn't work.Master Necro wrote:Sincerely I just copied the third option from Rith's Charm but it looks I was to dumb to remove the mode="3".
- Code: Select all
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<COST mana_cost="{4}{W}{U}" type="Mana" />
<COST type="TapSelf" />
<TARGET tag="CARD_QUERY_CHOOSE_SOURCE_PREVENT_DAMAGE" definition="1" compartment="0" count="1" />
<TARGET_DEFINITION id="1">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_CARDS )
filter:Add( FE_ZONE, OP_IS, ZONE_ANY)
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION layer="6">
local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
if target ~= nil then
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_CardPtr(0, target)
MTG():CreateDelayedTrigger(2, delayDC)
end
</RESOLUTION_TIME_ACTION>
<DURATION simple_duration="UntilEOT" />
<TRIGGERED_ABILITY replacement_effect="1" resource_id="2">
<TRIGGER value="SOURCE_DEALS_DAMAGE" pre_trigger="1">
return TriggerObject() == EffectDC():Get_CardPtr(1)
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectController() ~= nil then
EffectController(): Damage():PreventAll() )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
</ACTIVATED_ABILITY>
-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by thefiremind » 24 Jul 2013, 08:54
None of that, you need to move thisMaster Necro wrote:P.S. What should I put instead of the delayedtrigger or should I delete the whole MTG():CreateDelayedTrigger(2, delayDC) altogether?
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1" resource_id="2">
<TRIGGER value="SOURCE_DEALS_DAMAGE" pre_trigger="1">
return TriggerObject() == EffectDC():Get_CardPtr(1)
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectController() ~= nil then
EffectController(): Damage():PreventAll() )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>

Last edited by thefiremind on 24 Jul 2013, 08:57, 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 Master Necro » 24 Jul 2013, 08:56
thefiremind wrote:None of that, you need to move thisMaster Necro wrote:P.S. What should I put instead of the delayedtrigger or should I delete the whole MTG():CreateDelayedTrigger(2, delayDC) altogether?out of the ACTIVATED_ABILITY: have you ever seen an ability inside another ability?
- Code: Select all
<TRIGGERED_ABILITY replacement_effect="1" resource_id="2">
<TRIGGER value="SOURCE_DEALS_DAMAGE" pre_trigger="1">
return TriggerObject() == EffectDC():Get_CardPtr(1)
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectController() ~= nil then
EffectController(): Damage():PreventAll() )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>

-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by thefiremind » 24 Jul 2013, 08:57
I was about to forget another important thing:

This will make our mods incompatible as soon as I update mine... let the usual "hey your card X doesn't work" "it's working fine for me" begin...Master Necro wrote:I've already copied all of your functions in my function folder.

< 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 Master Necro » 24 Jul 2013, 09:07
Don't worry as soon as you update I will update mine.thefiremind wrote:I was about to forget another important thing:This will make our mods incompatible as soon as I update mine... let the usual "hey your card X doesn't work" "it's working fine for me" begin...Master Necro wrote:I've already copied all of your functions in my function folder.

On a sadder note I still can't activate Prahv ability.
- Code: Select all
<ACTIVATED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{4}{W}{U} , {T}: Prevent all damage a source of your choice would deal this turn.]]></LOCALISED_TEXT>
<COST mana_cost="{4}{W}{U}" type="Mana" />
<COST type="TapSelf" />
<TARGET tag="CARD_QUERY_CHOOSE_SOURCE_PREVENT_DAMAGE" definition="1" compartment="0" count="1" />
<TARGET_DEFINITION id="1">
local filter = ClearFilter()
filter:SetFilterType( FILTER_TYPE_CARDS )
filter:Add( FE_ZONE, OP_IS, ZONE_ANY)
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION layer="6">
local target = EffectDC():Get_Targets(1):Get_CardPtr(0)
if target ~= nil then
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_CardPtr(0, target)
MTG():CreateDelayedTrigger(2, delayDC)
end
</RESOLUTION_TIME_ACTION>
<DURATION simple_duration="UntilEOT" />
</ACTIVATED_ABILITY>
<TRIGGERED_ABILITY replacement_effect="1" resource_id="2">
<TRIGGER value="SOURCE_DEALS_DAMAGE" pre_trigger="1">
return TriggerObject() == EffectDC():Get_CardPtr(1)
</TRIGGER>
<RESOLUTION_TIME_ACTION>
if EffectController() ~= nil then
EffectController(): Damage():PreventAll() )
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by thefiremind » 24 Jul 2013, 09:17
This means that Rith's Charm doesn't work, either... I think that it can't be coded if someone doesn't find an idea to make a query that precedes target selection.
I just noticed that you are using register #1 both for the target and for the delayed chest, but this has nothing to do with being able to activate the ability.
I just noticed that you are using register #1 both for the target and for the delayed chest, but this has nothing to do with being able to activate the 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: 722 times
Re: Formal Request Thread
by Master Necro » 24 Jul 2013, 09:20
Than I am truly sad that I will not have Prahv in my deck...thefiremind wrote:This means that Rith's Charm doesn't work, either... I think that it can't be coded if someone doesn't find an idea to make a query that precedes target selection.
I just noticed that you are using register #1 both for the target and for the delayed chest, but this has nothing to do with being able to activate the ability.
-
Master Necro - Posts: 259
- Joined: 24 Apr 2013, 18:25
- Has thanked: 83 times
- Been thanked: 21 times
Re: Formal Request Thread
by MC Brodie » 24 Jul 2013, 10:15
I think I have successfully coded Sigarda, Host of Herons (by coded I mean convert thefiremind's 2013 card to a 2014 card) but I don't know why it does anything.
And to make sure I understand the rules correctly, an opponent could still cast a card like Diabolic Edict on you, you would have to choose a creature and edict would resolve but nothing would happen.
- Sigarda, Host of Herons | Open
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1" active_zone="ZONE_BATTLEFIELD" >
<TRIGGER value="SACRIFICE" simple_qualifier="objectyoucontrol" pre_trigger="1" />
local last_caster = LinkedDC():Get_PlayerPtr(0)
if last_caster ~= nil and last_caster:GetTeam() ~= EffectController():GetTeam() then
return true
end
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<TRIGGER value="ABILITY_PLAYED" >
LinkedDC():Set_PlayerPtr(0, TriggerPlayer() )
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<TRIGGER value="SPELL_PLAYED" >
LinkedDC():Set_PlayerPtr(0, TriggerPlayer() )
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<TRIGGER value="ABILITY_RESOLVED" >
LinkedDC():Set_PlayerPtr(0, nil )
return false
</TRIGGER>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<TRIGGER value="SPELL_RESOLVED" >
LinkedDC():Set_PlayerPtr(0, nil )
return false
</TRIGGER>
</TRIGGERED_ABILITY>
And to make sure I understand the rules correctly, an opponent could still cast a card like Diabolic Edict on you, you would have to choose a creature and edict would resolve but nothing would happen.
-----------------------------------------------------------------------
Song of the Day: 46 and 2 (cover)
Song of the Day: 46 and 2 (cover)
Re: Formal Request Thread
by thefiremind » 24 Jul 2013, 11:17
The first trigger is wrong: you closed the TRIGGER block without including the code that follows, and in that code there's no "return false" for when the condition isn't verified. It should be:
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
<TRIGGER value="SACRIFICE" simple_qualifier="objectyoucontrol" pre_trigger="1">
local last_caster = LinkedDC():Get_PlayerPtr(0)
if last_caster ~= nil and last_caster:GetTeam() ~= EffectController():GetTeam() then
return true
end
return false
</TRIGGER>
</TRIGGERED_ABILITY>
When a TRIGGERED_ABILITY has replacement_effect="1" (or internal="1" in the previous DotP games) and pre_trigger="1" and no resolution, its trigger implicitly overrides the event that caused the trigger. This particular trigger, for example, overrides the sacrifice.MC Brodie wrote:I understand how the 2nd - 5th triggers work with the first one, but what I don't understand is how the first trigger does anything without a Resolution TIme Action block?
That's right, anyway there are some scenarios that this implementation doesn't take into account (look at the rulings on the Gatherer page), so be aware that the card will have some wrong interactions with other cards.MC Brodie wrote:And to make sure I understand the rules correctly, an opponent could still cast a card like Diabolic Edict on you, you would have to choose a creature and edict would resolve but nothing would happen.
< 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 RiiakShiNal » 24 Jul 2013, 12:00
Though in DotP 2014 we need to explicitly override the event with:thefiremind wrote:When a TRIGGERED_ABILITY has replacement_effect="1" (or internal="1" in the previous DotP games) and pre_trigger="1" and no resolution, its trigger implicitly overrides the event that caused the trigger. This particular trigger, for example, overrides the sacrifice.
- Code: Select all
MTG():OverrideEvent()
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 thefiremind » 24 Jul 2013, 12:04
I'm almost sure that MTG():OverrideEvent() is mandatory only if there's a RESOLUTION_TIME_ACTION: without that, and under the conditions I wrote, the override happens anyway.
< 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 RiiakShiNal » 24 Jul 2013, 12:58
So you're saying that AEther Storm and Sulfuric Vortex have it even though it is unnecessary in those circumstances?thefiremind wrote:I'm almost sure that MTG():OverrideEvent() is mandatory only if there's a RESOLUTION_TIME_ACTION: without that, and under the conditions I wrote, the override happens anyway.
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
Who is online
Users browsing this forum: No registered users and 10 guests