It is currently 29 Apr 2017, 01:47
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, moomarc, Chris H., DennisBergkamp, Rob Cashwalker, friarsol, CCGHQ Admins

Re: Card Development Questions

Postby Hanmac » 07 Aug 2016, 15:27

i finally found what was wrong with Kilnspire District
the X variable was overwritten by something else.
by CardFactory.buildPlaneAbilities.
i try to use something else there like "PlanarDiceCostX", but it does not work as i wanted :/
(so it breaks the DiceCost)

i try to experiment a bit, but i will see how i can get it working.
==
Edit: fixed it via unorthodox way ;P
instead of setting the SVar to the card, i set it to the Ability XD
Hanmac
 
Posts: 923
Joined: 06 May 2013, 18:44
Has thanked: 223 times
Been thanked: 152 times

Re: Card Development Questions

Postby Hanmac » 08 Aug 2016, 20:13

hey you guys, i am currently trying to get Kodama of the Center Tree 's Soulshift X working ...
for that i am trying to create a game state before a DestroyAll spell does hit the field.

(my current work is to create a copy of the Battlefield zone with LKI copies of the cards)

it's not finish yet, and need to be written nicely, but thats my idea so far.

it does work for now for an destroy all spell, but i need to work on it more.
===

as "Payment" i need help by other developers.
i need to find the place why Zulaport Cutthroat or Wayward Disciple does work so different for some destroy all spells.

More info there:
viewtopic.php?f=52&t=6333&p=199331#p199331


Work:

does not Work:

in general it does look like: "destroy" works, "destroy, and X" works not.
(maybe something does mess with the triggers?)

i even did try to debug it with step by step debugger but i didn't find the culprit yet.

my last thought was about GameAction: line 273 with "c.setZone(zoneTo);" but then the others should not work too.
Hanmac
 
Posts: 923
Joined: 06 May 2013, 18:44
Has thanked: 223 times
Been thanked: 152 times

Re: Card Development Questions

Postby mastroego » 09 Aug 2016, 05:32

Is this in any way related to the Knight Exemplar problem (which I believe - not sure - is still present in Forge)?
I mean a board sweeper should only destroy the Knight Exemplar while leaving the other knights untouched by the destroy effect, but that wasn't what happened with Forge.
mastroego
 
Posts: 225
Joined: 22 Sep 2013, 14:04
Has thanked: 27 times
Been thanked: 16 times

Re: Card Development Questions

Postby Hanmac » 09 Aug 2016, 05:42

@mastroego maybe yes:
i noticed some bug that for the destroy spells where it's not working it depends on where the card is on the battlefield.

like for Life's Finale, if i have:

Zulaport Cutthroat does trigger for the other creatures.

while with

Zulaport Cutthroat does not.

For Knight Exemplar, you might checkout what board sweeper is it.
(like if it only destroy or if it does more.)
i might check it out too, but currently (as you can see) i have other things to do.
Hanmac
 
Posts: 923
Joined: 06 May 2013, 18:44
Has thanked: 223 times
Been thanked: 152 times

Re: Card Development Questions

Postby mastroego » 09 Aug 2016, 06:34

Yeah, no problem here, do your thing ;)
I just wondered if they were a different manifestation of a single underlying problem :)
mastroego
 
Posts: 225
Joined: 22 Sep 2013, 14:04
Has thanked: 27 times
Been thanked: 16 times

Re: Card Development Questions

Postby Hanmac » 09 Aug 2016, 08:49

i think i found the culprit of the Destroy problem:

AbilityUtils.resolveSubAbilities L1282
Revision: 31273
Author: @friarsol

Code: Select all
// Needed - Equip an untapped creature with Sword of the Paruns then cast Deadshot on it. Should deal 2 more damage.
game.getAction().checkStaticAbilities(); // this will refresh continuous abilities for players and permanents.
game.getTriggerHandler().resetActiveTriggers();
AbilityUtils.resolveApiAbility(abSub, game);
the resetActiveTriggers is the problem there .. while i understand why it is there, to prevent Landfall from Path to Exile
it does prevent other triggers from happening.

@friarsol can you might take a look and maybe you find a way to solve my problem.
Hanmac
 
Posts: 923
Joined: 06 May 2013, 18:44
Has thanked: 223 times
Been thanked: 152 times

Re: Card Development Questions

Postby friarsol » 09 Aug 2016, 13:25

Hanmac wrote:@friarsol can you might take a look and maybe you find a way to solve my problem.
I'm doubt I'll be able to do any serious debugging into triggers anytime soon.

Also, can we have a separate thread for this? It seems large enough discussion topic to not just be in Card Development Questions
friarsol
Global Moderator
 
Posts: 7026
Joined: 15 May 2010, 04:20
Has thanked: 224 times
Been thanked: 833 times

Re: Card Development Questions

Postby Hanmac » 09 Aug 2016, 14:53

Super News for EVERYONE!!

i got both problems fixed (with adding that LastStateBattlefield)

now the triggers does work correct for the "Destroy and X" spells.
(a Special Rule only for ChangesZone)
But Please does tell me if you guys find anything there it does not work. (we probably need more test cases for something like that)

and Kodama of the Center Tree does now also work with SoulshiftX (as far was i tested it)

Edit:
its not 100% perfect yet.
Grazing Gladehart sacrificed for Perilous Forays,
does cause it to trigger. but i will see how i can get it working.

i got this closes, but there might be more.
Last edited by Hanmac on 09 Aug 2016, 15:30, edited 1 time in total.
Hanmac
 
Posts: 923
Joined: 06 May 2013, 18:44
Has thanked: 223 times
Been thanked: 152 times

Re: Card Development Questions

Postby Agetian » 09 Aug 2016, 15:19

Hanmac wrote:Super News for EVERYONE!!

i got both problems fixed (with adding that LastStateBattlefield)

now the triggers does work correct for the "Destroy and X" spells.
(a Special Rule only for ChangesZone)
But Please does tell me if you guys find anything there it does not work. (we probably need more test cases for something like that)

and Kodama of the Center Tree does now also work with SoulshiftX (as far was i tested it)
This is really amazing, thanks a lot for your effort! As soon as I get a little free time I'll check it out and test it, if I see anything weird I'll report immediately! ;)
Again, thanks a lot for all your contributions! :)

- Agetian
Agetian
Programmer
 
Posts: 2530
Joined: 14 Mar 2011, 05:58
Has thanked: 497 times
Been thanked: 300 times

Re: Card Development Questions

Postby Agetian » 09 Aug 2016, 15:42

I started this thread to unload this one: viewtopic.php?f=52&t=18920
Feel free to pick up other issues from that thread as well (this is for anybody willing to do so). :)

- Agetian
Agetian
Programmer
 
Posts: 2530
Joined: 14 Mar 2011, 05:58
Has thanked: 497 times
Been thanked: 300 times

Re: Card Development Questions

Postby swordshine » 12 Aug 2016, 07:02

@Hanmac
Can Glimmervoid Basin target other spells in the stack? IIRC, this function was not implemented last time.
swordshine
 
Posts: 665
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 78 times

Re: Card Development Questions

Postby Hanmac » 12 Aug 2016, 07:28

@Swordshine: i thought it did.
(it can target the cards, but maybe not the SpellAbilities)
i need to see if i need to change more on that.

for if the Stack can be targeted:
TargetRestrictions.getAllCandidates does have special Logic for Stack.

===

i wanted to do Damping Engine, i read a bit how do to IgnoreCost.

the problems i had for now:
  • the IgnoreCost need to be done with the whole effect, but for that i need Cant Play Lands & Cant Cast.
  • IgnoreCost only works for StaticAbilityContinuous, Cant Play Lands & Cant Cast are done via StaticAbilityCantBeCast
  • StaticAbilityContinuous can add more StaticAbilities, but only to Creatures

my plan for now: do a combined Static Ability, which does grant the two of them to the Player.
For that the Player does need to have Properties to store them too.
all places where Cant Play Lands & Cant Cast is used, i need to check for Player abilities too.
Hanmac
 
Posts: 923
Joined: 06 May 2013, 18:44
Has thanked: 223 times
Been thanked: 152 times

Re: Card Development Questions

Postby swordshine » 13 Aug 2016, 03:12

Hanmac wrote:@Swordshine: i thought it did.
(it can target the cards, but maybe not the SpellAbilities)
i need to see if i need to change more on that.

for if the Stack can be targeted:
TargetRestrictions.getAllCandidates does have special Logic for Stack.
It doesn't work in my recent test. I'll do some debug in a few hours.
Situation: Give AI three creature spells and I cast Counterspell targeting one of them. No copies were created.
Here's the code that I usually test Planes.
Code: Select all
Name:For Test
ManaCost:0
Types:Artifact
T:Mode$ SpellCast | ValidCard$ Instant,Sorcery | IsSingleTarget$ True | Execute$ TrigCopy | TriggerZones$ Battlefield | TriggerDescription$ Whenever a player casts an instant or sorcery spell with a single target, he or she copies that spell for each other spell, permanent, card not on the battlefield, and/or player the spell could target. Each copy targets a different one of them.
SVar:TrigCopy:DB$ CopySpellAbility | Defined$ TriggeredSpellAbility | Controller$ TriggeredActivator | CopyForEachCanTarget$ Spell,Permanent,Card,Player
SVar:Picture:http://www.wizards.com/global/images/magic/general/glimmervoid_basin.jpg
Oracle:Whenever a player casts an instant or sorcery spell with a single target, he or she copies that spell for each other spell, permanent, card not on the battlefield, and/or player the spell could target. Each copy targets a different one of them.\nWhenever you roll {CHAOS}, choose target creature. Each player except that creature's controller puts a token that's a copy of that creature onto the battlefield.
swordshine
 
Posts: 665
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 78 times

Re: Card Development Questions

Postby Hanmac » 13 Aug 2016, 10:33

@swordshine: i will see what i can do,
currently TargetRestrictions.getAllCandidates does not return SpellAbilities,
and i don't know if i might break something when i have i return it.

===
Also checkout, i did Damping Engine ...
(but the code does still feel ugly)

it works with creating DetachedEffects, and they does hold the static abilities.

i tested it and it does work, but the view might not get updated as i wanted ...
Hanmac
 
Posts: 923
Joined: 06 May 2013, 18:44
Has thanked: 223 times
Been thanked: 152 times

Re: Card Development Questions

Postby Hanmac » 14 Aug 2016, 12:31

I did LastStateGraveyard similar to my LastStateBattlefield.

i use it for when a creature does enter the Battlefield with X +1/+1 counters depending on something in the graveyard where it does should count itself (and others too)

for example:
2 Diregraf Colossus returned from the graveyard to the Battlefield with Ever After.
both should count itself and the other one for counting (it was wrong first)
Hanmac
 
Posts: 923
Joined: 06 May 2013, 18:44
Has thanked: 223 times
Been thanked: 152 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 8 guests


Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 8 guests

Login Form