It is currently 29 Oct 2025, 00:46
   
Text Size

checkTargetingEffects +SpellAbilityCast Triggers not working

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

checkTargetingEffects +SpellAbilityCast Triggers not working

Postby Sloth » 22 Jun 2011, 14:46

At the moment neither the old keywords using checkTargetingEffects ("When CARDNAME becomes the target of a spell or ability, ...") nor modern triggers with ValidTarget (Angelic Protector) are working at the moment.
Has something changed the targeting here?
Last edited by Sloth on 22 Jun 2011, 17:32, edited 1 time in total.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: checkTargetingEffects not working

Postby Sloth » 22 Jun 2011, 17:30

After some more testing, I can say for sure that all "SpellAbilityCast" and "SpellCast" triggers won't trigger if they have a "TargetsValid" parameter.
My guess is that the target are not properly set when the triggers are called or the format the triggers are stored in has changed.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

Postby friarsol » 22 Jun 2011, 17:38

I did change how targeting works with my Multi-targeting fixes, it's possible it's related to that.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

Postby friarsol » 23 Jun 2011, 03:56

I see what the issue is. It looks like the Trigger is run after the SA is added to the stack, which is also after when the Target gets cleared from the SA (since the Target lives in the StackInstance now). I'll see if I can fix this with a one-liner, otherwise it'll have to wait till Friday for some real debugging when I have time.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

Postby friarsol » 23 Jun 2011, 04:03

Ok, I was able to successfully test this working with a deck of Angelic Protector and Elvish Fury. If you could do some more robust testing Sloth it would be greatly appreciated.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

Postby Sloth » 23 Jun 2011, 07:39

friarsol wrote:Ok, I was able to successfully test this working with a deck of Angelic Protector and Elvish Fury. If you could do some more robust testing Sloth it would be greatly appreciated.
I did some testing (Angelic Protector, Dormant Gomazoa and Mirozel) and everything worked fine. Thanks a lot Sol.

I will try to continue removing the remains of checkTargetingEffects (Cowardice and Horobi, Death's Wail), but it needs a new option for "Defined" in the abilities triggered by SpellAbilityCast: "TriggeredTarget".

Update: Converting these cards to trigger is more difficult than I thought. I'm afraid SpellAbilityCast can't really handle it, since a triggered ability has to go on the stack for each target of the spell. Maybe we need to create a new trigger "BecomesTarget". I'm not volunteering.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

Postby Hellfish » 23 Jun 2011, 08:36

I'll look into it. *Superhero pose*
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

Postby Sloth » 23 Jun 2011, 10:15

Hellfish wrote:I'll look into it. *Superhero pose*
Thanks Hellfish.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

Postby Hellfish » 23 Jun 2011, 14:18

Okay, I got a working version of a BecomesTarget trigger that works with Cowardice + Arc Trail among others. Converted Cowardice to start. Check r9985.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

Postby Sloth » 23 Jun 2011, 15:12

Hellfish wrote:Okay, I got a working version of a BecomesTarget trigger that works with Cowardice + Arc Trail among others. Converted Cowardice to start. Check r9985.
I just did a test with Cowardice + Arc Trail and only the first target was returned to hand. Same with Horobi, Death's Wail and Glarewielder.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: checkTargetingEffects +SpellAbilityCast Triggers not wor

Postby Hellfish » 23 Jun 2011, 15:23

That's... weird. It returned two steel walls fine for me.Gimme a sec.
EDIT:Yep, definitely worked here. I'm dubious to this other thought, but I'm gonna check if somehow using Setup Game State meddles with the result.

EDIT2:Nope,works fine with dummy decks too. :-s What were you targeting?
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 25 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 25 users online :: 0 registered, 0 hidden and 25 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 25 guests

Login Form