Page 4 of 8

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 19 Jan 2011, 23:22
by Hellfish
It's a good start, some pointers though:
  • 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
and then committed it. Congrats on your first addition ;)

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. :lol: But I got the commit :P

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 19 Jan 2011, 23:47
by Zirbert
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

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 19 Jan 2011, 23:53
by Hellfish
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?

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 00:03
by Zirbert
Hellfish wrote:
Maybe we should start up a dedicated Card Contribution topic?
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.

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$
I think the "Blue+" needs to come out of the ValidCard$ parameter...

-Zirbert, Slow But Occasionally Dedicated Learner

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 02:57
by jeffwadsworth
Deleted.

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 04:28
by Zirbert
jeffwadsworth 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
Might the triggering-from-hand problem be a matter of needing to add

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)

PostPosted: 20 Jan 2011, 04:38
by jeffwadsworth
Good point. That explains the 4 stacked issue. I should read more. Thanks.

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 13:27
by Sloth
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:

Code: Select all
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Creature.Blue+YouCtrl | TriggerZones$ Battlefield | Optional$ True | Execute$
I think the "Blue+" needs to come out of the ValidCard$ parameter...

-Zirbert, Slow But Occasionally Dedicated Learner
Fixed! Thanks for pointing out Zirbert.

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 19:31
by friarsol
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.

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 19:35
by Hellfish
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.

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 19:43
by friarsol
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.
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.

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 20:57
by friarsol
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)

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 21:15
by Hellfish
No need to submit it here, I know just what you mean. I just didn't think about it before :oops:

There are no special cases (Pumps notwithstanding) where a facedown card can have abilities,right?

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 21:25
by friarsol
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.

Re: Trigger discussion (was WheneverKeyword reference)

PostPosted: 20 Jan 2011, 21:29
by Hellfish
Right, that complicates things a bit. Not much, just a bit :P I'll just commit this conversion batch first, then dig in.