It is currently 31 Jul 2025, 17:56
   
Text Size

TFM&G2K's Planeswalkers Pool v8g (12/Sep/2014)

Moderator: CCGHQ Admins

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby thefiremind » 25 Aug 2014, 22:01

The OBJECT_TAKES_DAMAGE trigger for non-creature Planeswalkers gets fired with FireTrigger, which allows me to pass TriggerObject and nothing else. I guess that damage_type="combat" would look at the Damage object that is usually shipped with the trigger in order to check whether it's combat damage or not, but with FireTrigger there's no damage object, so I'm afraid you can't use damage_type. You should try and check if the damage happens during the combat damage step instead. I'm also returning 0 if there's no damage amount rather than nil, because I thought it would be more intuitive (you proved me wrong though :lol:). Try it like this:
Code: Select all
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
    <TRIGGER value="OBJECT_TAKES_DAMAGE">
    return MTG():GetStep() == STEP_COMBAT_DAMAGE and PLW_GetLastDamageAmount(TriggerObject()) &gt; 0
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local damage = PLW_GetLastDamageAmount(TriggerObject())
    if damage &gt; 0 then
       EffectController():DrawCards(damage)
    end
    </RESOLUTION_TIME_ACTION>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby gorem2k » 26 Aug 2014, 10:15

thefiremind wrote:Try it like this:
didn't work.

EDIT2: i deleted my message because I realized it was bad arguments :oops:
Last edited by gorem2k on 26 Aug 2014, 11:42, edited 2 times in total.
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby thefiremind » 26 Aug 2014, 11:12

gorem2k wrote:i think you forgot to check if obj_chest is nil in LOL
The second argument set to "true" means that the chest will be created if needed (refer to RiiakShiNal's ObjectDC functions).

gorem2k wrote:also check only for the damage amount could be wrong if the creature with the granted 'draw cards' ability is not the last to damage a planeswalker. but I'm not sure, maybe it would be best to check if EffectSource() is the last damager as well...
I think you're right, but I would expect it to trigger too many times without that, rather than never, so the problem must be somewhere else.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby gorem2k » 26 Aug 2014, 11:59

this works:

Code: Select all
PLW_SetLastDamageInfo = function(victim, damager, amount)
-- Saves the last damager (and the last damage amount, if provided) of the victim using RSN's ObjectDC
   if RSN_GetObjectDC ~= nil then
          if RSN_GetObjectDC(victim, true):Get_Chest(PLW_LAST_DAMAGE_CHEST) == nil then
             RSN_GetObjectDC(victim, true):Make_Chest(PLW_LAST_DAMAGE_CHEST)
          end
      local damage_chest = RSN_GetObjectDC(victim, true):Get_Chest(PLW_LAST_DAMAGE_CHEST)
      damage_chest:Set_CardPtr(0, damager)
      if amount ~= nil then
         damage_chest:Set_Int(1, amount)
      end
   end
end
of course "RSN_GetObjectDC(victim, true)" could be defined in a local to reduce code..

like this | Open
Code: Select all
PLW_SetLastDamageInfo = function(victim, damager, amount)
-- Saves the last damager (and the last damage amount, if provided) of the victim using RSN's ObjectDC
   if RSN_GetObjectDC ~= nil then
      local obj_chest = RSN_GetObjectDC(victim, true)
      if obj_chest:Get_Chest(PLW_LAST_DAMAGE_CHEST) == nil then
         obj_chest:Make_Chest(PLW_LAST_DAMAGE_CHEST)
      end
      local damage_chest = obj_chest:Get_Chest(PLW_LAST_DAMAGE_CHEST)
      damage_chest:Set_CardPtr(0, damager)
      if amount ~= nil then
         damage_chest:Set_Int(1, amount)
      end
   end
end
Last edited by gorem2k on 26 Aug 2014, 12:08, edited 1 time in total.
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby thefiremind » 26 Aug 2014, 12:06

I was setting the damager and the amount in the wrong chest, the only needed fix for my code is to substitute the last 2 "obj_chest" with "damage_chest".
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby gorem2k » 26 Aug 2014, 12:23

and Hunter's Insight seems fine like this:
Code: Select all
    <CLEANUP fire_once="1" />
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
    <TRIGGER value="OBJECT_TAKES_DAMAGE">
    if MTG():GetStep() == STEP_COMBAT_DAMAGE and
       (PLW_GetLastDamager(TriggerObject()) == EffectSource() and
       PLW_GetLastDamageAmount(TriggerObject()) &gt; 0) then
       return true
    end
    return false
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local damage = PLW_GetLastDamageAmount(TriggerObject())
    if damage &gt; 0 then
       EffectController():DrawCards(damage)
    end
    </RESOLUTION_TIME_ACTION>
actually, not hehe, since RTA doesn't account for combat damage direct to player..
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby thefiremind » 26 Aug 2014, 13:06

gorem2k wrote:actually, not hehe, since RTA doesn't account for combat damage direct to player.
I think it's easier to use a register that tells us what happened, rather than making 2 different delayed triggers. Something like this:
Code: Select all
    <CLEANUP fire_once="1" />
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat">
    local damage = Damage() and Damage():GetAmount()
    if damage ~= nil and damage &gt; 0 then
       EffectDC():Set_Int(1, 1)
       return true
    end
    return false
    </TRIGGER>
    <TRIGGER value="OBJECT_TAKES_DAMAGE">
    if MTG():GetStep() == STEP_COMBAT_DAMAGE and
       (PLW_GetLastDamager(TriggerObject()) == EffectSource() and
       PLW_GetLastDamageAmount(TriggerObject()) &gt; 0) then
       EffectDC():Set_Int(1, 2)
       return true
    end
    return false
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local damage = 0
    local mode = EffectDC():Get_Int(1)
    if mode == 1 then
       damage = Damage():GetAmount()
    elseif mode == 2 then
       damage = PLW_GetLastDamageAmount(TriggerObject())
    end
    if damage &gt; 0 then
       EffectController():DrawCards(damage)
    end
    </RESOLUTION_TIME_ACTION>
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby gorem2k » 26 Aug 2014, 13:23

thefiremind wrote:
gorem2k wrote:actually, not hehe, since RTA doesn't account for combat damage direct to player.
I think it's easier to use a register that tells us what happened, rather than making 2 different delayed triggers. Something like this:
| Open
Code: Select all
    <CLEANUP fire_once="1" />
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat">
    local damage = Damage() and Damage():GetAmount()
    if damage ~= nil and damage &gt; 0 then
       EffectDC():Set_Int(1, 1)
       return true
    end
    return false
    </TRIGGER>
    <TRIGGER value="OBJECT_TAKES_DAMAGE">
    if MTG():GetStep() == STEP_COMBAT_DAMAGE and
       (PLW_GetLastDamager(TriggerObject()) == EffectSource() and
       PLW_GetLastDamageAmount(TriggerObject()) &gt; 0) then
       EffectDC():Set_Int(1, 2)
       return true
    end
    return false
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local damage = 0
    local mode = EffectDC():Get_Int(1)
    if mode == 1 then
       damage = Damage():GetAmount()
    elseif mode == 2 then
       damage = PLW_GetLastDamageAmount(TriggerObject())
    end
    if damage &gt; 0 then
       EffectController():DrawCards(damage)
    end
    </RESOLUTION_TIME_ACTION>
I tested with

| Open
Code: Select all
    <CLEANUP fire_once="1" />
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
    <TRIGGER value="OBJECT_TAKES_DAMAGE">
    if MTG():GetStep() == STEP_COMBAT_DAMAGE and
       (PLW_GetLastDamager(TriggerObject()) == EffectSource() and
       PLW_GetLastDamageAmount(TriggerObject()) &gt; 0) then
       return true
    end
    return false
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local damage = PLW_GetLastDamageAmount(TriggerObject())
    if damage &gt; 0 then
       EffectController():DrawCards(damage)
    else
       local player_damage = Damage():GetAmount()
       if player_damage ~= nil and player_damage &gt;0 then
          EffectController():DrawCards(player_damage)
       end
    end
    </RESOLUTION_TIME_ACTION>
It did work this time, attacked with 5 creatures, spread them to fight Elspeth and player, I had no additional trigger from any of them and correct draw cards amount.

at least if it fails I have plenty of solutions now. Thanks again for helping me out! Cheers

EDIT:not exactly, oh well I will just pick your code.

EDIT2: I had 5 creatures, one 2/1 attacked Elspeth and there was two 1/1 soldiers creatures attacking player. these two soldiers gave me 2 cards each instead of 1.

I think creatures attacking player are returning true in the wrong trigger. well my head is spinning from getting this right. I will just take a break for now

It looks like this
Code: Select all
    <CLEANUP fire_once="1" />
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
    <RESOLUTION_TIME_ACTION>
    EffectController():DrawCards(1)
    </RESOLUTION_TIME_ACTION>
does trigger once whenever a creature is attacking a planeswalker OR player ! and I thought when it was "combat" and attacking a planeswalker it wouldn't work but I tested and it works. change of plan!

I feel bad now because this simple:
Code: Select all
    <CLEANUP fire_once="1" />
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
    <RESOLUTION_TIME_ACTION>
    local damage = Damage():GetAmount()
    if damage ~= nil and damage &gt; 0 then
       EffectController():DrawCards(damage)
    end
    </RESOLUTION_TIME_ACTION>
was good enough. no need to check for last damager and amount. well maybe it be useful for later? Yikes :lol:
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby thefiremind » 26 Aug 2014, 19:01

gorem2k wrote:I feel bad now because this simple:
Code: Select all
    <CLEANUP fire_once="1" />
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
    <RESOLUTION_TIME_ACTION>
    local damage = Damage():GetAmount()
    if damage ~= nil and damage &gt; 0 then
       EffectController():DrawCards(damage)
    end
    </RESOLUTION_TIME_ACTION>
was good enough. no need to check for last damager and amount. well maybe it be useful for later? Yikes :lol:
This probably means that this trigger resolves before the Planeswalker damage redirection. None of us could have predicted such a behaviour. Well, the simpler the better! :D
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby gorem2k » 26 Aug 2014, 20:03

thefiremind wrote:
gorem2k wrote:I feel bad now because this simple:
Code: Select all
    <CLEANUP fire_once="1" />
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
    <RESOLUTION_TIME_ACTION>
    local damage = Damage():GetAmount()
    if damage ~= nil and damage &gt; 0 then
       EffectController():DrawCards(damage)
    end
    </RESOLUTION_TIME_ACTION>
was good enough. no need to check for last damager and amount. well maybe it be useful for later? Yikes :lol:
This probably means that this trigger resolves before the Planeswalker damage redirection. None of us could have predicted such a behaviour. Well, the simpler the better! :D
Yes it's good and not so good since now every "Whenever this creature deals damage to an opponent..." will also work when not attacking a player but a planeswalker! planeswalker <> player :roll:
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby ncshooter » 31 Aug 2014, 22:29

o7 all,

I'm still pretty new to the mod scene, but I'm having some issues with this mod in particular. When the WAD is present, CPU util will spike heavily in certain scenarios. For example, if I have "prey upon" card in the deck, the game will start stuttering if that card has the ability to activate. If you trigger something else, things return to normal. Same deal with having a planeswalker on deck -- everything is cool until they go yellow (have an ability to activate), then it slows down to a crawl.

If I remove the mod, everything is cool. Even if I don't have a planeswalker in the deck I'm currently using, it will still bog on certain cards (prey upon, sunbond are two I know offhand that will repro every time)

I can generate some dumps or thread profiling if you think that will help with the issue (assuming it's not a known issue).

thanks!
ncshooter
 
Posts: 1
Joined: 31 Aug 2014, 22:08
Has thanked: 0 time
Been thanked: 0 time

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby MasterXploder7 » 01 Sep 2014, 03:26

After i downloaded version 8d i stopped experiencing problems with Duck Fayden. In fact i had absolutely no lag in comparison. i am rather unsettled with downloading 8e seeing as how the game flows with the changes that came from 8d
"Hate is an everlasting wellspring from which it is eternally sustained." - Nirkana Revenant
MasterXploder7
 
Posts: 293
Joined: 18 Jan 2014, 10:55
Has thanked: 28 times
Been thanked: 11 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby thefiremind » 01 Sep 2014, 09:37

ncshooter wrote:I can generate some dumps or thread profiling if you think that will help with the issue (assuming it's not a known issue).
It is a known issue, but there's nothing I can do: any alternative solution leads to more problems.

MasterXploder7 wrote:After i downloaded version 8d i stopped experiencing problems with Duck Fayden. In fact i had absolutely no lag in comparison. i am rather unsettled with downloading 8e seeing as how the game flows with the changes that came from 8d
Be aware that the change I made on 8d was giving other problems (Planeswalkers that didn't die when having 0 loyalty or went to the graveyard when bounced back to hand). I wouldn't have reverted it otherwise.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby gorem2k » 01 Sep 2014, 13:11

there might still be hope,

Code: Select all
  <!-- 1. Planeswalker goes to the graveyard when it has no loyalty counters left -->
  <TRIGGERED_ABILITY replacement_effect="1">
    <COUNTER_REGISTRATION name="Loyalty" proliferate="11" />
    <TRIGGER value="COUNTERS_CHANGED" simple_qualifier="objectyoucontrol">
    return GetAmount() &lt; 0 and CounterTypeIndex() == MTG():GetCountersType("Loyalty") and PLW_IsInNameSet( TriggerObject(), "PLANESWALKERS" )
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    if TriggerObject() ~= nil and (TriggerObject():GetZone() == 1 and TriggerObject():CountCounters( MTG():GetCountersType("Loyalty") ) == 0) then
          TriggerObject():PutInGraveyard()
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
this works with ajani steadfast emblem (prevent 1 damage), normal combat damage, bouncing (tested with Æther Tradewinds), direct damage (cards that removes counters outside manager) tested with (Fated Conflagration),

nevermind, i think ajani emblem is somehow a pain in the xxx. though bouncing is not putting card in graveyard this time. i think it's because GetAmount condition is not met when it pass thru emblem. i'm not really sure if it needs to check GetAmount since the resolution already count all the counters remaining.


Code: Select all
  <!-- 1. Planeswalker goes to the graveyard when it has no loyalty counters left -->
  <TRIGGERED_ABILITY replacement_effect="1">
    <COUNTER_REGISTRATION name="Loyalty" proliferate="11" />
    <TRIGGER value="COUNTERS_CHANGED" simple_qualifier="objectyoucontrol">
    return GetAmount() &lt;1 and CounterTypeIndex() == MTG():GetCountersType("Loyalty")
    -- only planeswalker use these counters so i've removed PLW_IsInNameSet() from the trigger.
    -- GetZone() == 1 is to prevent it from going to graveyard if it get bounced/flickered.
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    if TriggerObject() ~= nil and
       (TriggerObject():GetZone() == 1 and
       TriggerObject():CountCounters(MTG():GetCountersType("Loyalty")) &lt; 1) then
       TriggerObject():PutInGraveyard()
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
only ajani cause problems now, so tfm, have you looked at my message here? I've posted both ajani steadfast and manager modifications. what you think about this? you could maybe use your 'prevent damage method' from ajani but put them in manager instead? because i dont think the priority works well when there's multiple SOURCE_DEAL_DAMAGE replacement at the same time.
gorem2k
 
Posts: 464
Joined: 01 Apr 2013, 04:21
Has thanked: 48 times
Been thanked: 33 times

Re: TFM&G2K's Planeswalkers Pool v8e (24/Aug/2014)

Postby MikalMooni » 07 Sep 2014, 05:59

:D Hey there, Mod Creators/Compilers. My name is Mike, and I am an experienced magic the gathering player who has downloaded your pool in order to compile some decks and enjoy playing with planeswalkers. However, as I was playing, I couldn't help but notice some critical errors in some of the cards' functions.

So far, I have noticed two errors. One is a rules oversight, which may be a result of the approximation, but the other one is almost 100% approximation error. Whether the second one is a mistake or an oversight, I am unsure, but both errors are detrimental to the playing experience, and should be looked into in any case.

Now, as some background information, the deck I am interested in is a Mardu (Dega) Midrange build, focused heavily on planeswalkers. The planeswalkers I am using are: Elspeth, Knight-Errant; Elspeth, Sun's Champion; Chandra, Pyromaster; Chandra, the Firebrand; Sorin, Lord of Innistrad; Ajani Vengeant; Ajani Steadfast; and Sarkhan the Mad.

Now, the first situation which causes issues is the interaction between Ajani Steadfast's ultimate and Sarkhan the mad's 0 ability. The issue is that when you use Ajani's ultimate, Sarkhan's 0 should only ever hit himself for 1 at most, no matter how high the CMC of the card is. However, this is not the case in game. When you use the 0 ability, it deals the "Correct" amount of damage while ignoring the prevention effect. As a suggested solution, is it at all possible to use a replacement effect there?

I don't do much work in LUA, but maybe a line that says "Check the damage dealt, assign to value D; -d+1, assign to value P; prevent source D, apply source P; End;" could work? Maybe you just didn't factor in a source of damage to a permanent being it's self?

That's a little annoying, because it would be accurate for it to happen, and it's a zany and fun interaction between the two walkers that is a strong selling point for the crazy synergies between the two. However, the next issue is far more severe.

The next issue is in Sorin, Lord of Innistrad it's self. As far as I have seen, whenever you ultimate Sorin at 7 loyalty or higher and then pass the turn, for as long as the planeswalker remains on the battlefield and you don't activate a minus ability, you can activate his +1 ability an arbitrarily high number of times in a single turn and then subsequently activate another one of his abilities. The string ends when you -2 or ultimate him, and the problem recurs over the rest of the game, every single turn.

As for this one, I am unsure as to what causes it, but my only logical guess would be that it's an error in the code for his +1 ability. It's only the plus one that is broken, too, not any other ability. Again, as soon as you activate another ability of his, the ability to spam his tokens goes away until the next turn.

So far, that is the extent of the issues I have seen with the planeswalker's pool thus far. I am unsure if the Chain veil works correctly, as I haven't tested it out much, but so far it's been an amazingly fun piece to play around with. Good job on the update! :)

Nissa was very well done.

Everything else is working fine.

As a quick question before I go, is Sorin Markov impossible to code? Maybe it's the taking an opponent's turn for them, isn't it?

Finally, I want to apologize if this was the incorrect place to post this. I am new to the forum so please excuse me if I was wrong to post it here. If I was, and one of the people reading wouldn't mind pointing me in the right direction, I would greatly appreciate it.

Thanks a million!

- Mike. :D
I have no idea what my signature should be, so I am writing this instead.
User avatar
MikalMooni
 
Posts: 8
Joined: 07 Sep 2014, 05:29
Has thanked: 3 times
Been thanked: 0 time

PreviousNext

Return to 2014

Who is online

Users browsing this forum: No registered users and 13 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 13 users online :: 0 registered, 0 hidden and 13 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 13 guests

Login Form