Trigger discussion (was WheneverKeyword reference)
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Trigger discussion (was WheneverKeyword reference)
by Hellfish » 19 Jan 2011, 23:22
It's a good start, some pointers though:
I fixed those points up and ended up with this:

As sol points out though, this won't work in the beta for several reasons. Mostly due to the raw state of the triggersystem.
EDIT: Beaten like a drum.
But I got the commit 
- Don't put spaces after the colons on each line, they will be included in that variable.
- All card txt files must end with a line with nothing but "End" on.
- The code will automatically grab the TriggerDescription to put in the card's text box. General rule of thumb: if there is no hardcoded functionality, there is no need to put anything but "no text" on the "Text:" line.
- When using triggered abilities, what you put in the SVar referenced by the trigger line should indeed be an ability, and not a spell.Also, the leading "A:" that spells and abilities have when they're on their own line should not be there.
- Again, when using Triggers, unless the card in question will be what sets off the trigger (i.e. if the trigger is "When CARDNAME enters the battlefield") you should specify the TriggerZones parameter; basically where the card should be located for it to care about the trigger.(in this case, the Battlefield)
- You don't HAVE to enter the SetInfo line(s). We have a script for that often tedious work
You can if you have nothing better to do though
- This may just be me, but for convention I try to use the wizards.com/global/images/etc... address for the Picture SVar, i.e. the one you've commented out.
- Tiny nitpick: It's generally easier to read an abilityfactory line if you place a space after each dollarsign and on either side of each pipe.
I fixed those points up and ended up with this:
- Code: Select all
Name:Merrow Commerce
ManaCost:1 U
Types:Tribal Enchantment Merfolk
Text:no text
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ UntapMerfolk | TriggerDescription$ At the beginning of your end step, untap all Merfolk you control.
SVar:UntapMerfolk:AB$UntapAll | Cost$ 0 | ValidCards$ Merfolk.YouCtrl | SpellDescription$ Untap all Merfolk you control.
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/merrow_commerce.jpg
SetInfo:LRW|Uncommon|http://magiccards.info/scans/en/lw/72.jpg
End

As sol points out though, this won't work in the beta for several reasons. Mostly due to the raw state of the triggersystem.
EDIT: Beaten like a drum.


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: Trigger discussion (was WheneverKeyword reference)
by Zirbert » 19 Jan 2011, 23:47
Thanks, guys! I appreciate the corrections!
I completely forgot about adding "End" as the last line, and honestly had no clue about spacing, etc.
I was really unsure whether to use ASP$ or AB$, and had written it both ways in my draft version. I flipped a coin, and obviously came up wrong. Hopefully I'll remember the difference next time.
Am I correct that the Execute$ trigger variable name (UntapMerfolk, in this case) is more or less arbitrary, and should just be something descriptive? I was worried about using a keyword there that would mean something to the Java engine and causing a train wreck...
I don't mind digging up SetInfo; it's one of the few areas of the process where I feel I know what I'm doing.
And I had no idea that I had commented out an SVar line... the card I cribbed that from before changing the target had the hash at the start of the line, and not knowing what it meant I left it there!
Thanks, Hellfish and Sol - I'll try to give you less stuff to fix in my next effort! (Although I'll certainly appreciate any fixing you, or anyone else, provide!)
-Zirbert
I completely forgot about adding "End" as the last line, and honestly had no clue about spacing, etc.
I was really unsure whether to use ASP$ or AB$, and had written it both ways in my draft version. I flipped a coin, and obviously came up wrong. Hopefully I'll remember the difference next time.
Am I correct that the Execute$ trigger variable name (UntapMerfolk, in this case) is more or less arbitrary, and should just be something descriptive? I was worried about using a keyword there that would mean something to the Java engine and causing a train wreck...
I don't mind digging up SetInfo; it's one of the few areas of the process where I feel I know what I'm doing.
And I had no idea that I had commented out an SVar line... the card I cribbed that from before changing the target had the hash at the start of the line, and not knowing what it meant I left it there!
Thanks, Hellfish and Sol - I'll try to give you less stuff to fix in my next effort! (Although I'll certainly appreciate any fixing you, or anyone else, provide!)
-Zirbert
Re: Trigger discussion (was WheneverKeyword reference)
by Hellfish » 19 Jan 2011, 23:53
Yep, the name of the SVar can be anything made up of only alphabetical characters. And yeah, # at the beginning of the line (But only at the beginning) will cause that line to be ignored.At least you're learning 
Maybe we should start up a dedicated Card Contribution topic?

Maybe we should start up a dedicated Card Contribution topic?
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: Trigger discussion (was WheneverKeyword reference)
by Zirbert » 20 Jan 2011, 00:03
I'd like that - I'm really not sure where to post this stuff. It would be nice for newbs like me to have somewhere to take wild swings. This topic seemed like a natural fit for Merrow Commerce, but I wouldn't know where to go with my next one. I already feel like a kid sneaking to the grownups table just by being in Developer's Corner - I'd feel really awkward starting a new topic every time I tried another card.Hellfish wrote:
Maybe we should start up a dedicated Card Contribution topic?
On another note, but still oddly on-topic in "Trigger discussion" - I don't know who to point this out to, but I've been reading the changelogs, and I think there's a mistake in r5380 (http://code.google.com/p/cardforge/source/detail?r=5380). It was committed by Deepsloth, but if they have an account here, it doesn't appear to be under the same username. Unless I'm misreading it, Aura Shards, as currently coded, is only going to trigger from blue creatures entering the battlefield. Here's the problematic line:
- Code: Select all
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Blue+YouCtrl | TriggerZones$ Battlefield | Optional$ True | Execute$
-Zirbert, Slow But Occasionally Dedicated Learner
Re: Trigger discussion (was WheneverKeyword reference)
by jeffwadsworth » 20 Jan 2011, 02:57
Deleted.
Last edited by jeffwadsworth on 20 Jan 2011, 04:45, edited 2 times in total.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: Trigger discussion (was WheneverKeyword reference)
by Zirbert » 20 Jan 2011, 04:28
Might the triggering-from-hand problem be a matter of needing to addjeffwadsworth wrote:By the way, the dreaded quad-stacking reared its head while testing this card. The trigger will go off while the card is still in your hand.
R.5391
Code: Select all
Name:Mortuary
ManaCost:3 B
Types:Enchantment
Text:no text
T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Creature | Execute$ TrigBounce | TriggerDescription$ Whenever any creature is put into your graveyard from play, put that creature on top of your library.
SVar:TrigBounce:AB$ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Library | LibraryPosition$ 0
- Code: Select all
TriggerZones$ Battlefield
to the T:Mode$ line, like Hellfish had to add to Merrow Commerce a few posts back?
-Zirbert
Re: Trigger discussion (was WheneverKeyword reference)
by jeffwadsworth » 20 Jan 2011, 04:38
Good point. That explains the 4 stacked issue. I should read more. Thanks.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: Trigger discussion (was WheneverKeyword reference)
by Sloth » 20 Jan 2011, 13:27
Fixed! Thanks for pointing out Zirbert.Zirbert wrote:On another note, but still oddly on-topic in "Trigger discussion" - I don't know who to point this out to, but I've been reading the changelogs, and I think there's a mistake in r5380 (http://code.google.com/p/cardforge/source/detail?r=5380). It was committed by Deepsloth, but if they have an account here, it doesn't appear to be under the same username. Unless I'm misreading it, Aura Shards, as currently coded, is only going to trigger from blue creatures entering the battlefield. Here's the problematic line:I think the "Blue+" needs to come out of the ValidCard$ parameter...
- Code: Select all
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Blue+YouCtrl | TriggerZones$ Battlefield | Optional$ True | Execute$
-Zirbert, Slow But Occasionally Dedicated Learner
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Trigger discussion (was WheneverKeyword reference)
by friarsol » 20 Jan 2011, 19:31
I was looking at SpellAbilityCast to see if I could do Frost Titan. Is the SpellAbility that caused the trigger in anyhow available to the AF during resolution? I didn't notice any functionality for that now, so if it doesn't exist something to look forward on.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Trigger discussion (was WheneverKeyword reference)
by Hellfish » 20 Jan 2011, 19:35
Not yet, but that is in my head. 
I was considering something Defined-like for cards as well as a similar way to get at the triggerdata. Nothing concrete yet though.

I was considering something Defined-like for cards as well as a similar way to get at the triggerdata. Nothing concrete yet though.
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: Trigger discussion (was WheneverKeyword reference)
by friarsol » 20 Jan 2011, 19:43
I figured as much, but thought I'd check. There are still tons of cards to convert/add that we don't need to rush along to the next thing before this is stabilized.Hellfish wrote:Not yet, but that is in my head.
I was considering something Defined-like for cards as well as a similar way to get at the triggerdata. Nothing concrete yet though.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Trigger discussion (was WheneverKeyword reference)
by friarsol » 20 Jan 2011, 20:57
Cards with Triggers shouldn't trigger if they are face down. (I'll submit Raven Guild Master in a few minutes here to show you what I mean)
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Trigger discussion (was WheneverKeyword reference)
by Hellfish » 20 Jan 2011, 21:15
No need to submit it here, I know just what you mean. I just didn't think about it before
There are no special cases (Pumps notwithstanding) where a facedown card can have abilities,right?

There are no special cases (Pumps notwithstanding) where a facedown card can have abilities,right?
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: Trigger discussion (was WheneverKeyword reference)
by friarsol » 20 Jan 2011, 21:25
If a static ability grants it, but that should grant it as an extrinsic <what-have-you>. A faceDown card has no text to give it abilities, so should only have what other things grant it.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Trigger discussion (was WheneverKeyword reference)
by Hellfish » 20 Jan 2011, 21:29
Right, that complicates things a bit. Not much, just a bit
I'll just commit this conversion batch first, then dig in.

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
Who is online
Users browsing this forum: No registered users and 41 guests