checkTargetingEffects +SpellAbilityCast Triggers not working
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
11 posts
• Page 1 of 1
checkTargetingEffects +SpellAbilityCast Triggers not working
by 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?
Has something changed the targeting here?
Last edited by Sloth on 22 Jun 2011, 17:32, edited 1 time in total.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: checkTargetingEffects not working
by 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.
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.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: checkTargetingEffects +SpellAbilityCast Triggers not wor
by 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
by 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
by 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
by Sloth » 23 Jun 2011, 07:39
I did some testing (Angelic Protector, Dormant Gomazoa and Mirozel) and everything worked fine. Thanks a lot Sol.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 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.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: checkTargetingEffects +SpellAbilityCast Triggers not wor
by 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
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
-

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
by Sloth » 23 Jun 2011, 10:15
Thanks Hellfish.Hellfish wrote:I'll look into it. *Superhero pose*
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: checkTargetingEffects +SpellAbilityCast Triggers not wor
by 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
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
-

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
by Sloth » 23 Jun 2011, 15:12
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.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.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: checkTargetingEffects +SpellAbilityCast Triggers not wor
by 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.
What were you targeting?
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.
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
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
-

Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
11 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 25 guests