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)
2013




Thefiremind's DotP2013 DLC v9 (27/5/2013)
Moderator: CCGHQ Admins
Re: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by Threepwood » 08 Feb 2013, 00:26
I found a card with a bug!
Sorry for being so happy about it, but I consider myself lucky for picking up on this tiny error. (Well, actually Yeva / the AI found it.)
Souls of the Faultless unfortunately isn't faultless:
The attacking player is defined as the owner of the attacking creature during resolution time. If a player is feeling particularly sneaky he can get rid of this creature before the ability resolves, preventing any damage being dealt to him.
I think I solved this by assigning the player in the trigger (I had to remove an underscore to get through the forum's filters):
Sorry for being so happy about it, but I consider myself lucky for picking up on this tiny error. (Well, actually Yeva / the AI found it.)
Souls of the Faultless unfortunately isn't faultless:
The attacking player is defined as the owner of the attacking creature during resolution time. If a player is feeling particularly sneaky he can get rid of this creature before the ability resolves, preventing any damage being dealt to him.
I think I solved this by assigning the player in the trigger (I had to remove an underscore to get through the forum's filters):
- Code: Select all
<TRIGGER value="CREATURE_DEALS COMBAT_DAMAGE_TO_CREATURE">
if SecondaryObject() == Object() then
EffectDC():Set_PlayerPtr(0, TriggerObject():GetPlayer())
return true
end
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local attack_player = EffectDC():Get_PlayerPtr(0)
--------------------------------------------------------------------------------------------------
I like having low self-esteem, it makes me feel special.
I like having low self-esteem, it makes me feel special.
-
Threepwood - Posts: 22
- Joined: 22 Jul 2012, 13:57
- Has thanked: 4 times
- Been thanked: 4 times
Re: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by thefiremind » 08 Feb 2013, 09:50
That's a good point, thanks for the report! I'd also move the check to see if Souls of the Faultless is attacking into the trigger condition, so the complete ability would become:
- Code: Select all
<TRIGGER value="CREATURE_DEALS_COMBAT_DAMAGE_TO_CREATURE">
if SecondaryObject() == Object() then
local attack_player = TriggerObject():GetPlayer()
if Object():IsAttacking() ~= 0 then
-- this would mean that Souls of the Faultless somehow lost defender and I'm the attacking player.
attack_player = EffectController()
end
EffectDC():Set_PlayerPtr(0, attack_player)
return true
end
return false
</TRIGGER>
<RESOLUTION_TIME_ACTION>
local damage_amount = Damage():GetAmount()
local player = EffectController()
local attack_player = EffectDC():Get_PlayerPtr(0)
if player ~= nil then
player:GainLife(damage_amount)
end
if attack_player ~= nil then
attack_player:LoseLife(damage_amount)
end
</RESOLUTION_TIME_ACTION>
< 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: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by Threepwood » 09 Feb 2013, 00:10
Found another one;
Blizzard Spectre wasn't doing anything.
I've been staring at the code for ages and it turns out to be one of those flaws which cheekily hides in plain sight.
In this segment Make_Targets() should of course be Get_Targets():
Blizzard Spectre wasn't doing anything.
I've been staring at the code for ages and it turns out to be one of those flaws which cheekily hides in plain sight.
In this segment Make_Targets() should of course be Get_Targets():
- Code: Select all
<RESOLUTION_TIME_ACTION>
local target = nil
if EffectDC():Make_Targets(0) ~= nil then
target = EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
target:PutInHand()
end
elseif EffectDC():Make_Targets(1) ~= nil then
target = EffectDC():Get_Targets(1):Get_CardPtr(0)
if target ~= nil then
target:Discard()
end
end
</RESOLUTION_TIME_ACTION>
--------------------------------------------------------------------------------------------------
I like having low self-esteem, it makes me feel special.
I like having low self-esteem, it makes me feel special.
-
Threepwood - Posts: 22
- Joined: 22 Jul 2012, 13:57
- Has thanked: 4 times
- Been thanked: 4 times
Re: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by thefiremind » 09 Feb 2013, 13:13
Fix applied on the temporary patch, thanks again!
< 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: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by Threepwood » 09 Feb 2013, 23:40
It's me again. Found another bug. (I swear, I'm not hunting for them, I just seem to stumble across them lately.)
Volt Charge isn't proliferating. Got it to work by replacing EffectDC():Set_Int(1, 1) with ObjectDC():Set_Int(1, 1) in the following section.
Though, if EffectDC() works as I think it does, I don't understand how this could make any difference. But it does.
Volt Charge isn't proliferating. Got it to work by replacing EffectDC():Set_Int(1, 1) with ObjectDC():Set_Int(1, 1) in the following section.
Though, if EffectDC() works as I think it does, I don't understand how this could make any difference. But it does.
- Code: Select all
<RESOLUTION_TIME_ACTION ignore_filter="1">
local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
local source = EffectSource()
if source == nil then
source = Object()
end
if target_creature ~= nil then
ObjectDC():Set_Int(1, 1)
target_creature:DealDamage(3, source)
elseif target_player ~= nil then
ObjectDC():Set_Int(1, 1)
target_player:DealDamage(3, source)
end
</RESOLUTION_TIME_ACTION>
<FILTER>
return (Permanents())
</FILTER>
<RESOLUTION_TIME_ACTION>
if ObjectDC():Get_Int(1) == 1 then
local suitable_counter_type = 0
if FilteredCard():GetPlayer():GetTeam() == EffectController():GetTeam() then
suitable_counter_type = FilteredCard():GetBestOrWorstCounterType(1)
else
suitable_counter_type = FilteredCard():GetBestOrWorstCounterType(0)
end
if suitable_counter_type ~= 0 then
FilteredCard():AddCounters( suitable_counter_type, 1 )
end
end
</RESOLUTION_TIME_ACTION>
--------------------------------------------------------------------------------------------------
I like having low self-esteem, it makes me feel special.
I like having low self-esteem, it makes me feel special.
-
Threepwood - Posts: 22
- Joined: 22 Jul 2012, 13:57
- Has thanked: 4 times
- Been thanked: 4 times
Re: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by thefiremind » 10 Feb 2013, 00:04
When I was coding my Protean Hulk (before the official came out) I had a similar problem but it was due to the fact that I was using the same EffectDC register twice. It's not the case here, so I don't know what's the reason. I don't like to use ObjectDC for things that I don't need to save outside of the ability, so I'll investigate a little more on it before posting a fix. I'll use ObjectDC if I can't find another solution.
EDIT: The problem seems to be connected to the <FILTER> block, but I don't know why using it resets the EffectDC registers. This could arise problems in other cards as well, I have to be careful. Anyway I made a fix that uses filter evaluation instead of the <FILTER> block for proliferating.
EDIT: The problem seems to be connected to the <FILTER> block, but I don't know why using it resets the EffectDC registers. This could arise problems in other cards as well, I have to be careful. Anyway I made a fix that uses filter evaluation instead of the <FILTER> block for proliferating.
< 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: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by Threepwood » 13 Feb 2013, 19:56
Found a bug in Warstorm Surge while I was trying to get my own version of Electropotence to work.
When the triggering creature is no longer on the battlefield during resolution the value of its power is lost, even though you're using LKIShield_CardPtr() (I must admit, I don't really know how that thing works.)
I've tried copying some pieces of code (priority="-1", still not sure what it does) from Wild Pair , which didn't seem to have this problem. Works fine for vanilla damage from creature power, but abilities like deathtouch and infect aren't properly handled when the creature is in the graveyard, nor does it take the correct (most recent) power value if it was modified on the battlefield. (So it would seem the original Wild Pair is bugged as well)
Anyway... LKI doesn't seem to be working. Could you please show me how you fixed it, if/when you do? Thanks.
When the triggering creature is no longer on the battlefield during resolution the value of its power is lost, even though you're using LKIShield_CardPtr() (I must admit, I don't really know how that thing works.)
I've tried copying some pieces of code (priority="-1", still not sure what it does) from Wild Pair , which didn't seem to have this problem. Works fine for vanilla damage from creature power, but abilities like deathtouch and infect aren't properly handled when the creature is in the graveyard, nor does it take the correct (most recent) power value if it was modified on the battlefield. (So it would seem the original Wild Pair is bugged as well)
Anyway... LKI doesn't seem to be working. Could you please show me how you fixed it, if/when you do? Thanks.
--------------------------------------------------------------------------------------------------
I like having low self-esteem, it makes me feel special.
I like having low self-esteem, it makes me feel special.
-
Threepwood - Posts: 22
- Joined: 22 Jul 2012, 13:57
- Has thanked: 4 times
- Been thanked: 4 times
Re: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by thefiremind » 13 Feb 2013, 23:52
There are lots of cards that use LKIShield_CardPtr... I really can't believe that it doesn't work at all. Just to be sure... could you check if you have another copy of Warstorm Surge from another mod that happens to use the same Multiverse ID (278576) as mine?
Wild Pair doesn't use LKIShield_CardPtr so it doesn't surprise me, and I can include it in the core bug fixes as soon as we are sure about how to fix it.
If you want to try something, you could substitute GetCurrentPower() with GetCurrentCharacteristics():Power_Get() and see what happens. My only tested experience on the difference between the two functions was a Clone that still remembered its old copied values after death by using GetCurrentPower(), so it should seem that we are already using the best one for our purpose, but who knows, this game always surprises.
The priority tag simply makes up for the impossibility to order the triggers on the stack. Being 0 the default (when you don't use the tag), triggers with lower priority will resolve later, and triggers with higher priority will resolve sooner (be aware that the stack is FIFO, so the priority has a reversed effect on the order they are put on the stack, in case this matters for some reason). This is how Deathbringer Liege doesn't try to destroy first and tap later when you cast a white and black spell.
Wild Pair doesn't use LKIShield_CardPtr so it doesn't surprise me, and I can include it in the core bug fixes as soon as we are sure about how to fix it.
If you want to try something, you could substitute GetCurrentPower() with GetCurrentCharacteristics():Power_Get() and see what happens. My only tested experience on the difference between the two functions was a Clone that still remembered its old copied values after death by using GetCurrentPower(), so it should seem that we are already using the best one for our purpose, but who knows, this game always surprises.

The priority tag simply makes up for the impossibility to order the triggers on the stack. Being 0 the default (when you don't use the tag), triggers with lower priority will resolve later, and triggers with higher priority will resolve sooner (be aware that the stack is FIFO, so the priority has a reversed effect on the order they are put on the stack, in case this matters for some reason). This is how Deathbringer Liege doesn't try to destroy first and tap later when you cast a white and black spell.

< 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: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by Threepwood » 14 Feb 2013, 13:33
Indeed false alarm on the priority="-1". While trying this out I also changed the code so it didn't read the LKI, just TriggerObject(), which was the culprit. So a large section of my previous post is just pure gibberish
After trying a few different things I finally got it.
I tested GetCurrentCharacteristics():Power_Get() as you suggested, which turns out DOES read the LKI in this case.
I also replaced TriggedObject() with EffectDC():Get_CardPtr(1) in the following section, which ensures abilities like infect and deathtouch are handled correctly.

After trying a few different things I finally got it.
I tested GetCurrentCharacteristics():Power_Get() as you suggested, which turns out DOES read the LKI in this case.
I also replaced TriggedObject() with EffectDC():Get_CardPtr(1) in the following section, which ensures abilities like infect and deathtouch are handled correctly.
- Code: Select all
<RESOLUTION_TIME_ACTION>
local target_creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
local target_player = EffectDC():Get_Targets(0):Get_PlayerPtr(0)
local creature = EffectDC():Get_CardPtr(1)
local power = creature:GetCurrentCharacteristics():Power_Get()
if ( target_creature ~= nil ) then
target_creature:DealDamage(power, creature)
elseif ( target_player ~= nil ) then
target_player:DealDamage(power, creature)
end
</RESOLUTION_TIME_ACTION>
--------------------------------------------------------------------------------------------------
I like having low self-esteem, it makes me feel special.
I like having low self-esteem, it makes me feel special.
-
Threepwood - Posts: 22
- Joined: 22 Jul 2012, 13:57
- Has thanked: 4 times
- Been thanked: 4 times
Re: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by thefiremind » 14 Feb 2013, 15:04
Good, now we know how to fix it. And I think there are 4 cards in the core that need the same treatment: Archon of Redemption, Flayer of the Hatebound, Spikeshot Elder, Wild Pair. Better get down to business. 

< 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: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by NEMESiS » 17 Feb 2013, 17:45
Ghostway is not working properly, it has card:PutInHand() rather then card:putintoplay() I noticed this discrepancy when I was trying to make Mistmeadow Witch from your card.
EDIT:
Apparently, Zirilan of the Claw doesn't exile dragons that it tutors either.
EDIT:
Apparently, Zirilan of the Claw doesn't exile dragons that it tutors either.
-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by thefiremind » 17 Feb 2013, 17:50
NEMESiS wrote:Ghostway is not working properly, it has card:PutInHand() rather then card:putintoplay() I noticed this discrepancy when I was trying to make Mistmeadow Witch from your card.


It will be fixed as well.NEMESiS wrote:Apparently, Zirilan of the Claw doesn't exile dragons that it tutors either.
< 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: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by NEMESiS » 17 Feb 2013, 20:55
A friend told me that Devastating Dreams does not trigger for both players. I tried it myself and it does work for both players but its does not destroy the proper X amounts of lands. Just 1 for each player.
-
NEMESiS - Posts: 460
- Joined: 03 Jan 2013, 04:02
- Location: Pools of Becoming
- Has thanked: 70 times
- Been thanked: 21 times
Re: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by thefiremind » 17 Feb 2013, 21:09
OK, bug found, it will be fixed in the update. I think I'll wait at least until tomorrow before releasing it, though, so if you find other bugs I won't have to make a temporary patch shortly after the new release.NEMESiS wrote:A friend told me that Devastating Dreams does not trigger for both players. I tried it myself and it does work for both players but its does not destroy the proper X amounts of lands. Just 1 for each player.

< 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: Thefiremind's DotP2013 DLC v6 (15/12/2012)
by luh-koala » 18 Feb 2013, 13:27
Wow, the new decks are amazing! +1 to the Radkos Unleash system, very funny to spend some time with. Nice illustrations also, nice workaround with debug...
Proud of ya, dude! o/
One way closer to the best DLC pack ever did.. ^^
Proud of ya, dude! o/
One way closer to the best DLC pack ever did.. ^^
_______________________________
Nothing is true, everything is permited.
Nothing is true, everything is permited.
Who is online
Users browsing this forum: No registered users and 327 guests