Page 12 of 24

Re: TFM&G2K's Planeswalkers Pool v8 (15/Aug/2014)

PostPosted: 15 Aug 2014, 21:14
by volrathxp
thefiremind wrote:The Chain Veil is now inside the pool! Enjoy and let me know of any problems.
Seems to be working pretty good so far. It infinites properly so that is good.

Re: TFM&G2K's Planeswalkers Pool v8b (15/Aug/2014)

PostPosted: 17 Aug 2014, 11:54
by gorem2k
Upcoming planeswalker from Commander 2014 set.
Teferi, Temporal Archmage | Open
Image


Now we will have to replace <sorcery_time="1"> with :
Code: Select all
    <AVAILABILITY>
    local player = EffectController()
    local teferi_emblem = PLW_MyPlayerDC( player ):Get_Int(PLW_TEFERI_EMBLEM)
    if player:MyTurn() and
       (MTG():GetStep() == STEP_MAIN_1 or MTG():GetStep() == STEP_MAIN_2) and
       teferi_emblem ~= 1 then
       return true
    elseif teferi_emblem == 1 then
       return true
    end
    return false
    </AVAILABILITY>
=P~ =P~ =P~ =P~ =P~

Re: TFM&G2K's Planeswalkers Pool v8b (15/Aug/2014)

PostPosted: 17 Aug 2014, 12:26
by thefiremind
There is a player:IsSorceryTime() function, if you want to shorten the code:
Code: Select all
    <AVAILABILITY>
    local player = EffectController()
    local teferi_emblem = PLW_MyPlayerDC(player):Get_Int(PLW_TEFERI_EMBLEM)
    return teferi_emblem == 1 or player:IsSorceryTime()
    </AVAILABILITY>
Anyway, this would require to set proper AI_AVAILABILITY blocks for each and every loyalty ability... a daunting task. 8-[

Re: TFM&G2K's Planeswalkers Pool v8b (15/Aug/2014)

PostPosted: 17 Aug 2014, 12:59
by gorem2k
thefiremind wrote:There is a player:IsSorceryTime() function, if you want to shorten the code:
Great, that's much better. and replace player with EffectController() to make it only two lines.
thefiremind wrote:Anyway, this would require to set proper AI_AVAILABILITY blocks for each and every loyalty ability... a daunting task. 8-[
Is there a post or a wiki that explains how AI_AVAILABILITY works? I've never examined that functionality.

Re: TFM&G2K's Planeswalkers Pool v8b (15/Aug/2014)

PostPosted: 17 Aug 2014, 14:16
by thefiremind
gorem2k wrote:Is there a post or a wiki that explains how AI_AVAILABILITY works? I've never examined that functionality.
Simply put, you need to tell the AI when it is best to use instant-speed spells and abilities, otherwise it will try and evaluate their usage every single time it can, slowing down the game a lot.

Re: TFM&G2K's Planeswalkers Pool v5e (31/Jan/2014)

PostPosted: 18 Aug 2014, 16:47
by braquio
thefiremind wrote:
MasterXploder7 wrote:garruk the veil cursed is buggy, you dont sacrifice anything even though you pick a creature, its just targeted and then the ability resolves as normal without sacrificing, doesnt seem fair
There was indeed a problem with his +1 ability, even though I would have expected the effect to be the opposite (sacrifice the creature without searching), anyway it should be fixed now.
I still have the same problem
Looking it's code i see:
Code: Select all
<RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       EffectDC():Set_Int(2, 1)
       target:Sacrifice()
    end
    </RESOLUTION_TIME_ACTION>
Sacrifice() is not a player function? May be if we write something like this:
Code: Select all
<RESOLUTION_TIME_ACTION>
   if EffectDC():Get_Targets(0) ~= nil then
       local target =  EffectDC():Get_Targets(0):Get_CardPtr(0)
       if target ~= nil then
          EffectDC():Set_Int(2, 1)
          EffectController():Sacrifice(target)
       end
   end
    </RESOLUTION_TIME_ACTION>

Re: TFM&G2K's Planeswalkers Pool v8c (18/Aug/2014)

PostPosted: 18 Aug 2014, 18:05
by thefiremind
DotP2012 allowed to call the Sacrifice function from objects as well, that's why I often make that mistake without being able to spot it afterwards. Anyway it's fixed now.
Note that
Code: Select all
local target = EffectDC():Get_Targets(0) and EffectDC():Get_Targets(0):Get_CardPtr(0)
is perfectly fine and very useful: if EffectDC():Get_Targets(0) is nil, the "and" evaluation will give up without throwing errors for calling Get_CardPtr on a nil value.

Re: TFM&G2K's Planeswalkers Pool v8c (18/Aug/2014)

PostPosted: 19 Aug 2014, 07:13
by TQP
Hello. I think, "Tezzeret, Agent of Bolas" does not work correctly. If I cast -1 abbility, artifact become a 5/5 creature, yea, opponent can kill him with some spells (like "Murder"), but this 5/5 "creature" cant block or attack.

Re: TFM&G2K's Planeswalkers Pool v8c (18/Aug/2014)

PostPosted: 19 Aug 2014, 08:05
by thefiremind
TQP wrote:Hello. I think, "Tezzeret, Agent of Bolas" does not work correctly. If I cast -1 abbility, artifact become a 5/5 creature, yea, opponent can kill him with some spells (like "Murder"), but this 5/5 "creature" cant block or attack.
I can't see any possible reason for this problem: the creature type addition is managed exactly the same as all cards that do it. Are you sure there wasn't anything else on the battlefield that disables attacking/blocking?

Re: TFM&G2K's Planeswalkers Pool v8c (18/Aug/2014)

PostPosted: 19 Aug 2014, 10:49
by volrathxp
thefiremind wrote:
TQP wrote:Hello. I think, "Tezzeret, Agent of Bolas" does not work correctly. If I cast -1 abbility, artifact become a 5/5 creature, yea, opponent can kill him with some spells (like "Murder"), but this 5/5 "creature" cant block or attack.
I can't see any possible reason for this problem: the creature type addition is managed exactly the same as all cards that do it. Are you sure there wasn't anything else on the battlefield that disables attacking/blocking?
Strange. I didn't have this issue with Tezz either when I was playing around with him.

Re: TFM&G2K's Planeswalkers Pool v8c (18/Aug/2014)

PostPosted: 19 Aug 2014, 15:20
by Kithkin
volrathxp wrote:
thefiremind wrote:
TQP wrote:Hello. I think, "Tezzeret, Agent of Bolas" does not work correctly. If I cast -1 abbility, artifact become a 5/5 creature, yea, opponent can kill him with some spells (like "Murder"), but this 5/5 "creature" cant block or attack.
I can't see any possible reason for this problem: the creature type addition is managed exactly the same as all cards that do it. Are you sure there wasn't anything else on the battlefield that disables attacking/blocking?
Strange. I didn't have this issue with Tezz either when I was playing around with him.
I just played a deck with Tezzeret, Agent of Bolas, and it worked just fine.

Re: TFM&G2K's Planeswalkers Pool v8c (18/Aug/2014)

PostPosted: 19 Aug 2014, 19:54
by TQP
thefiremind wrote:
TQP wrote:Hello. I think, "Tezzeret, Agent of Bolas" does not work correctly. If I cast -1 abbility, artifact become a 5/5 creature, yea, opponent can kill him with some spells (like "Murder"), but this 5/5 "creature" cant block or attack.
I can't see any possible reason for this problem: the creature type addition is managed exactly the same as all cards that do it. Are you sure there wasn't anything else on the battlefield that disables attacking/blocking?
Aw, sorry, now it's work fine, that was my bad :oops:

Re: TFM&G2K's Planeswalkers Pool v6d (05/Jun/2014)

PostPosted: 20 Aug 2014, 11:48
by gorem2k
thefiremind wrote:
MasterXploder7 wrote:Is there anything i could do to use the PW without having that lag? I run the game on a laptop so i would have to assume the processor isnt that high powered. but none the less i hope there is an easy work around
This in _PLANESWALKERS_MANAGER_991800002:
| Open
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">
    return GetAmount() &lt;1 and CounterTypeIndex() == MTG():GetCountersType("Loyalty")
    </TRIGGER>
    <FILTER filter_id="0">
    local filter = ClearFilter()
    filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
    PLW_FilterNameSet(filter, "PLANESWALKERS", true)
    </FILTER>
    <RESOLUTION_TIME_ACTION filter_id="0">
    if FilteredCard() ~= nil and FilteredCard():CountCounters( MTG():GetCountersType("Loyalty") ) == 0 then
       FilteredCard():PutInGraveyard()
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
Will greatly improve the performance. I also happen to have lag when I have lots of planewalkers in play. And my machine is not a top of the line, but not that old either, (dual core 2.9GHZ)

I suppose STATE_BASED_EFFECTS does check for a plethora of unneeded conditions whereas COUNTERS_CHANGED should just do what it has to. I'm not sure what TFM think about this, and why he decided not to use that trigger since he used it a couple of times in his mod.

Re: TFM&G2K's Planeswalkers Pool v6d (05/Jun/2014)

PostPosted: 20 Aug 2014, 12:13
by thefiremind
gorem2k wrote:I suppose STATE_BASED_EFFECTS does check for a plethora of unneeded conditions whereas COUNTERS_CHANGED should just do what it has to. I'm not sure what TFM think about this, and why he decided not to use that trigger since he used it a couple of times in his mod.
The reason was that I wanted to include the scenario of Planeswalkers that could enter the battlefield with 0 loyalty: in that case, no COUNTER_CHANGED trigger would fire. But since Wizards created no Planeswalker that starts with variable loyalty, I guess it would be fine to use COUNTERS_CHANGED.

Re: TFM&G2K's Planeswalkers Pool v6d (05/Jun/2014)

PostPosted: 20 Aug 2014, 13:19
by gorem2k
thefiremind wrote:
gorem2k wrote:I suppose STATE_BASED_EFFECTS does check for a plethora of unneeded conditions whereas COUNTERS_CHANGED should just do what it has to. I'm not sure what TFM think about this, and why he decided not to use that trigger since he used it a couple of times in his mod.
The reason was that I wanted to include the scenario of Planeswalkers that could enter the battlefield with 0 loyalty: in that case, no COUNTER_CHANGED trigger would fire. But since Wizards created no Planeswalker that starts with variable loyalty, I guess it would be fine to use COUNTERS_CHANGED.
Wait, I am currently testing this and it failed this time, I had Dack Fayden with 2 loyalty on it, AI attacked him with a 3/3 flying, I couldn't block it and Dack Fayden didn't go to graveyard #-o I think it's missing something in the <TRIGGER> block, maybe it should go through a planeswalkers filter first?

ok i think it's this
Code: Select all
filter:Add( FE_CONTROLLER, OP_IS, EffectController() )
Not sure because manager is on both side. (or is it?, if AI isn't planeswalkers, does he have an invisible token?) Anyway, I will test by removing this line first

That did the trick (so far) :
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">
    return GetAmount() &lt;0 and
       CounterTypeIndex() == MTG():GetCountersType("Loyalty") and
       TriggerObject():CountCounters( MTG():GetCountersType("Loyalty") ) &lt; 1
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    if TriggerObject() ~= nil then
       TriggerObject():PutInGraveyard()
    end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
No need to update/release a new version, unless more people complains about the lag.