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
TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)
Moderator: CCGHQ Admins
Re: TFM&G2K's Planeswalkers Pool v4 (2/Sep/2013)
by thefiremind » 10 Sep 2013, 18:10
This is strange... I often got attacked by only 1 creature in my tests, but I think I got attacked by 2 creatures a couple of times and everything went right. And it seems something that gorem2k (or anybody else) should have noticed at least once before now.Misplay wrote:The only issue I've got with your mod, it's when I attack a planeswalker with several creatures. In this case, only one of them seems to deal damage to the planeswalker.
I'd like to have more information:
- Did the game generate SCRIPT_LOG.TXT after playing?
- Which creature dealt damage and which ones didn't?
- Which Planeswalker were you attacking?
< 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: TFM&G2K's Planeswalkers Pool v4 (2/Sep/2013)
by Misplay » 10 Sep 2013, 23:49
> Did the game generate SCRIPT_LOG.TXT after playing?
No.
> Which Planeswalker were you attacking?
I tested several times with Chandra (Pyromaster) and then, with Garruk (Primal hunter).
In each case, there was only one planeswalker in play.
I never tested with both in play or with others planeswalkers...
> Which creature dealt damage and which ones didn't?
It's weird.
With Chandra, the LAST creature only does the damages.
Ex: I've got an eternal witness and a Llanowar elf in play. I attack with both. I tap the eternal witness first and then, the Elf. Chandra will lose 1 counter.
With Garruk, the FIRST creature only does the damages.
Ex: I've got a token wolf (2/2) and a Llanowar elf in play. I attack with both. I tap the token first and then, the Elf. Garruk will lose 2 counters.
BTW, I found another bug, when I use "pestilence demon". When I use his ability with a planeswalker on my side (Liliana [Dark realms]), I've got the choice to redirect the damages to my own planeswalker.
However, this is a minor bug, because I'm not a cheater and I always choose to not redirect the damages.
No.
> Which Planeswalker were you attacking?
I tested several times with Chandra (Pyromaster) and then, with Garruk (Primal hunter).
In each case, there was only one planeswalker in play.
I never tested with both in play or with others planeswalkers...
> Which creature dealt damage and which ones didn't?
It's weird.
With Chandra, the LAST creature only does the damages.
Ex: I've got an eternal witness and a Llanowar elf in play. I attack with both. I tap the eternal witness first and then, the Elf. Chandra will lose 1 counter.
With Garruk, the FIRST creature only does the damages.
Ex: I've got a token wolf (2/2) and a Llanowar elf in play. I attack with both. I tap the token first and then, the Elf. Garruk will lose 2 counters.
BTW, I found another bug, when I use "pestilence demon". When I use his ability with a planeswalker on my side (Liliana [Dark realms]), I've got the choice to redirect the damages to my own planeswalker.
However, this is a minor bug, because I'm not a cheater and I always choose to not redirect the damages.
Re: TFM&G2K's Planeswalkers Pool v4 (2/Sep/2013)
by gorem2k » 11 Sep 2013, 01:20
I confirm. this and effect like Slagstorm can redirect to owner's planeswalkers.Misplay wrote:BTW, I found another bug, when I use "pestilence demon".
as for other bug reported, I'm just about to test...
I confirm the combat damage as well.
planeswalker damage bug
I think the problem is with Damage():RedirectAllTo(target) as once this is called, looks like damage from other creatures in that delayDC is erased. I've REM that line and yes, the player lost 3 life (attacking with Llanowar Elves and Eternal Witness) and Chandra lost 3 counters. not 2 or 1.
- Code: Select all
...
<TRIGGERED_ABILITY replacement_effect="1" resource_id="1">
<CLEANUP>
return MTG():GetStep() == STEP_END_OF_COMBAT
</CLEANUP>
<COUNTER_REGISTRATION name="Loyalty" proliferate="11" />
<TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" damage_type="combat" pre_trigger="1">
if TriggerObject() == EffectDC():Get_CardPtr(0) then
local target = EffectDC():Get_CardPtr(1)
if target ~= nil then
EffectDC():Set_Int( 2, Damage():GetAmount() )
PLW_SetLastDamager( target, TriggerObject() )
-- Damage():RedirectAllTo(target)
end
return true
end
return false
-- APPROXIMATION: if the Planeswalker isn't a creature, damage triggers from the source won't trigger
</TRIGGER>
...
- Code: Select all
<TRIGGERED_ABILITY resource_id="1">
<CLEANUP>
return MTG():GetStep() == STEP_END_OF_COMBAT
</CLEANUP>
<COUNTER_REGISTRATION name="Loyalty" proliferate="11" />
<TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" damage_type="combat">
if TriggerObject() == EffectDC():Get_CardPtr(0) then
local target = EffectDC():Get_CardPtr(1)
if target ~= nil then
EffectDC():Set_Int( 2, Damage():GetAmount() )
PLW_SetLastDamager( target, TriggerObject() )
Damage():RedirectAllTo(target)
end
return true
end
return false
-- APPROXIMATION: if the Planeswalker isn't a creature, damage triggers from the source won't trigger
</TRIGGER>
Re: TFM&G2K's Planeswalkers Pool v4 (2/Sep/2013)
by thefiremind » 11 Sep 2013, 09:03
The Slagstorm problem should be easy to fix, I just never thought about that. About the RedirectAllTo, since it works only for creatures, we could use it only when the Planeswalker is also a creature... then we should test it with Gideon and unpreventable combat damage... or just live with that happily, since it's something that isn't very likely to happen.
Last edited by thefiremind on 12 Sep 2013, 08:29, edited 1 time in total.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
Re: TFM&G2K's Planeswalkers Pool v4 (2/Sep/2013)
by gorem2k » 11 Sep 2013, 12:05
I attacked a 5 loyalties Chandra, Pyromaster with both a 1/1 and a 2/1 creatures. she's lost only 1 counter.thefiremind wrote:Before moving it to first post, could someone test the bugs again on the new version? Just in case I did something stupid and the result is worse than before.
- | Open
- Code: Select all
<TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" damage_type="combat" pre_trigger="1">
if TriggerObject() == EffectDC():Get_CardPtr(0) then
local target = EffectDC():Get_CardPtr(1)
if target ~= nil then
EffectDC():Set_Int( 2, Damage():GetAmount() )
MTG():MessageAllPlayers("damage = "..EffectDC():Get_Int(2) )
PLW_SetLastDamager( target, TriggerObject() )
if target:GetCardType():Test(CARD_TYPE_CREATURE) then
Damage():RedirectAllTo(target)
else
Damage():Multiply(0)
end
end
return true
end
return false
-- APPROXIMATION: if the Planeswalker isn't a creature, damage triggers from the source won't trigger
</TRIGGER>
Last edited by gorem2k on 11 Sep 2013, 12:27, edited 1 time in total.
Re: TFM&G2K's Planeswalkers Pool v4 (2/Sep/2013)
by thefiremind » 11 Sep 2013, 12:23
Now I remember what I changed lately: everything was done inside the delayed trigger's TRIGGER block. I had to move the part that removes the counters into a RESOLUTION_TIME_ACTION because it wasn't triggering Vraska's COUNTERS_CHANGED otherwise. I don't know why this made the trigger work only once per combat, so I'm out of ideas right now.
< 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: TFM&G2K's Planeswalkers Pool v4 (2/Sep/2013)
by gorem2k » 11 Sep 2013, 12:35
I would say, put Vraska in the missing list for v4b. I'd rather want combat working than having one more planeswalker in the pool.thefiremind wrote:Now I remember what I changed lately: everything was done inside the delayed trigger's TRIGGER block. I had to move the part that removes the counters into a RESOLUTION_TIME_ACTION because it wasn't triggering Vraska's COUNTERS_CHANGED otherwise. I don't know why this made the trigger work only once per combat, so I'm out of ideas right now.
Re: TFM&G2K's Planeswalkers Pool v4 (2/Sep/2013)
by thefiremind » 12 Sep 2013, 08:21
I hope to find another way. At the moment, I have 2 ideas to test:gorem2k wrote:I would say, put Vraska in the missing list for v4b. I'd rather want combat working than having one more planeswalker in the pool.
Use a PLAY_TIME_ACTION rather than a RESOLUTION_TIME_ACTION. This shouldn't be different at all in a replacement_effect trigger, but who knows, weird bugs might be solved by weird solutions.PLAY_TIME_ACTIONs seem to be ignored in replacement_effect triggers.- Move the counter removing to the trigger condition again, then fire an OBJECT_TAKES_DAMAGE trigger inside the RESOLUTION_TIME_ACTION that will be caught by Vraska instead of catching COUNTERS_CHANGED. I can't set the damage with FireTrigger, but luckily Vraska doesn't need to know how much damage was dealt to her in order to destroy the creature. This might not work properly if the bug affects FireTrigger as well, and only 1 trigger gets fired when multiple creatures are involved.
< 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: TFM&G2K's Planeswalkers Pool v4b (12/Sep/2013)
by Misplay » 12 Sep 2013, 11:44
Incredible... Your new version works perfectly well.
- Vraska's first ability -> OK!
- Number of counters removed when several creatures attack -> OK!
Well done, Mr Phelps!!!
- Vraska's first ability -> OK!
- Number of counters removed when several creatures attack -> OK!
Well done, Mr Phelps!!!
Re: TFM&G2K's Planeswalkers Pool v4b (12/Sep/2013)
by Drakno » 12 Sep 2013, 13:04
So, when is karn coming out?
Re: TFM&G2K's Planeswalkers Pool v4b (12/Sep/2013)
by gorem2k » 14 Sep 2013, 16:28
tfm, if I have Mesa Enchantress in play and I cast a planeswalker, it let me draw a card, do you think it's possible to bypass Mesa trigger in your planeswalker manager?
Re: TFM&G2K's Planeswalkers Pool v4b (12/Sep/2013)
by thefiremind » 14 Sep 2013, 16:35
No, that demands a modification on Mesa Enchantress. If we could manipulate triggers of other cards, we would be able to code Torpor Orb... but unfortunately we can't.gorem2k wrote:tfm, if I have Mesa Enchantress in play and I cast a planeswalker, it let me draw a card, do you think it's possible to bypass Mesa trigger in your planeswalker manager?
< 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: TFM&G2K's Planeswalkers Pool v4b (12/Sep/2013)
by gorem2k » 14 Sep 2013, 19:29
OK, then I have a suggestion.
In manager:
In manager:
- Code: Select all
<RESOLUTION_TIME_ACTION>
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
if target ~= nil then
local defending = TriggerObject() and TriggerObject():GetPlayerAttacked()
if defending ~= nil then
defending:SetCustomQueryInstructionCardPtr(target)
defending:BeginNewMultipleChoice()
defending:AddMultipleChoiceAnswer("CONTROL_MB_CONFIRM")
defending:AskMultipleChoiceQuestion( "PLW_CARD_QUERY_ATTACKED_PLANESWALKER", TriggerObject() )
end
end
</RESOLUTION_TIME_ACTION>
Re: TFM&G2K's Planeswalkers Pool v4b (12/Sep/2013)
by thefiremind » 14 Sep 2013, 19:47
That's a good idea, I'll implement it.gorem2k wrote:you could set the query only if defending:IsHuman(), because AI doesnt need to know who we attack and sometimes there's a waiting for decision.
< 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: TFM&G2K's Planeswalkers Pool v4b (12/Sep/2013)
by gorem2k » 14 Sep 2013, 20:10
about this:
- Code: Select all
-- APPROXIMATION: in 2HG with both teammates using Planeswalkers, the question will be asked twice
- Code: Select all
if MTG():GetGameType() == GAME_TYPE_TWO_HEADED_GIANT then
Who is online
Users browsing this forum: No registered users and 27 guests