Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by moomarc » 02 Nov 2011, 06:13
jeffwadsworth wrote:As for the Saproling Burst, I do not believe it can be scripted right now. The tokens would have to have a staticability that would check the SB for its fade counters, etc. What if you have two or more. I believe you would need a way to reference the SB in script.


Edit: Victory! I sorted out the trigger and now the card works as expected! Happiness! The trigger needed to be
- Code: Select all
T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Creature.IsRemembered | Static$ True | Execute$ TrigAnimate
SVar:TrigAnimate:DB$ AnimateAll | Cost$ 0 | ValidCards$ Creature.IsRemembered | Power$ X | Toughness$ X | Permanent$ True
SVar:X:Count$CardCounters.FADE /*This count svar used for initial token generation as well
Edit 2: I fixed a problem where the saproling tokens would survive with their existing p/t if the had indestructible when SB left the battlefield. Now it will set the p/t of remembered tokens to 0 as part of its LTB effect. Last thing that I'm not sure about is the rulings on what happens to the fade counters on the SB if it gets Blink 'd. My understanding is that all counters would be removed, then as it comes back into play it would come into play with 7 fade counters again. In addition to this the SP should no longer remember the tokens created by it or visa-versa
- Rule 403.4 | Open
- 403.4. Whenever a permanent enters the battlefield, it becomes a new object and has no relationship to any previous permanent represented by the same card, except for the cases listed in rule 400.7. (This is also true for any objects entering any zone.)
Last edited by moomarc on 02 Nov 2011, 13:01, edited 5 times in total.
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Card Development Questions
by Sloth » 02 Nov 2011, 07:32
Do we have a way to switch off the intervening if clause for Mindstorm Crown?friarsol wrote:Mindstorm Crown and Daru Spiritualist should be fine.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by friarsol » 02 Nov 2011, 12:10
There is no intervening if. It's two conditionals.Sloth wrote:Do we have a way to switch off the intervening if clause for Mindstorm Crown?friarsol wrote:Mindstorm Crown and Daru Spiritualist should be fine.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by friarsol » 02 Nov 2011, 12:12
Marc, why aren't you using Static Pumping for this instead of what you are doing? Generate the tokens as 0/0s then Statically Pump them based on the Fade Counters. I like this method much better than an Always trigger. It's still not quite right, but it's closer.moomarc wrote:Edit: Victory! I sorted out the trigger and now the card works as expected! Happiness! The trigger needed to be
- Code: Select all
T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Creature.IsRemembered | Static$ True | Execute$ TrigAnimate
SVar:TrigAnimate:DB$ AnimateAll | Cost$ 0 | ValidCards$ Creature.IsRemembered | Power$ X | Toughness$ X | Permanent$ True
SVar:X:Count$CardCounters.FADE /*This count svar used for initial token generation as well
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Sloth » 02 Nov 2011, 12:43
How can we script these conditions?friarsol wrote:There is no intervening if. It's two conditionals.Sloth wrote:Do we have a way to switch off the intervening if clause for Mindstorm Crown?friarsol wrote:Mindstorm Crown and Daru Spiritualist should be fine.
My idea was to script two Phase triggers with opposing requirements checks. This way it will always trigger, the problem is the intervening if clause that checks requirements again.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by moomarc » 02 Nov 2011, 13:29
Its just lack of experience mostly. All the cards I'd done so far were predominantly trigger systems so I was just used to doing it that way. I'll look into the static pump and maybe I can get it commit-worthy (not sure how you handle hacked solutions even if they react like they're meant to). I'll get back with a new version soon.friarsol wrote:Marc, why aren't you using Static Pumping for this instead of what you are doing? Generate the tokens as 0/0s then Statically Pump them based on the Fade Counters. I like this method much better than an Always trigger. It's still not quite right, but it's closer.moomarc wrote:Edit: Victory! I sorted out the trigger and now the card works as expected! Happiness! The trigger needed to be
- Code: Select all
T:Mode$ Always | TriggerZones$ Battlefield | IsPresent$ Creature.IsRemembered | Static$ True | Execute$ TrigAnimate
SVar:TrigAnimate:DB$ AnimateAll | Cost$ 0 | ValidCards$ Creature.IsRemembered | Power$ X | Toughness$ X | Permanent$ True
SVar:X:Count$CardCounters.FADE /*This count svar used for initial token generation as well
On a side note I've committed Tooth and Claw to svn. There was nothing obscure so I felt comfortable committing without review here first.
On another point, I was trying Stone Idol Trap but don't think it's scriptable yet. The delayed trigger is "Exile it at the beginning of your next end step" and we only seem to support "Sacrifice at the beginning of the end step". Here's the base script so if anyone feels the urge to add the new delayed trigger (or if its already there and I don't know the correct phrasing) they can finish it off (should just need to replace the delayed trigger):
- Stone Idol Trap | Open
- Name:Stone Idol Trap
ManaCost:5 R
Types:Instant Trap
Text:CARDNAME costs 1 less to cast for each attacking creature.
A:SP$ Token | Cost$ 5 R | TokenAmount$ 1 | TokenName$ Construct | TokenTypes$ Artifact,Creature,Construct | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 6 | TokenToughness$ 12 | TokenKeywords$ Trample<>At the beginning of the end step, sacrifice CARDNAME. | SpellDescription$ Put a 6/12 colorless Construct artifact creature token with trample onto the battlefield. Exile it at the beginning of your next end step.
K:CostChange:Player:Less:X:Self:All:All:NoSpecial
SVar:X:Count$Valid Creature.attacking
SVar:Rarity:Rare
End
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Card Development Questions
by Hellfish » 02 Nov 2011, 13:46
Wouldn't giving the token a trigger to exile itself work?
EDIT: OR, failing that, remembering the token and having a DelayedTrigger subability on Stone Idol Trap itself?
EDIT: OR, failing that, remembering the token and having a DelayedTrigger subability on Stone Idol Trap itself?
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: Card Development Questions
by moomarc » 02 Nov 2011, 14:35
Firstly, here's the new script for Saproling Burst with the static pump. Thanks Sol. Definitely cleaner this way. It was a good script to learn some backroads though. It all works according to the rulings etc except that the pump is on the host rather than token. Let me know if it can be committed like this.
- Saproling Burst | Open
- Name:Saproling Burst
ManaCost:4 G
Types:Enchantment
Text:no text
K:Fading:7
A:AB$ Token | Cost$ SubCounter<1/FADE> | TokenAmount$ 1 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenImage$ G X X Saproling | TokenColors$ Green | TokenPower$ 0 | TokenToughness$ 0 | RememberTokens$ True | TokenKeywords$ This creature's power and toughness are each equal to the number of fade counters on CARDNAME. | SpellDescription$ Put a green Saproling creature token onto the battlefield. It has "This creature's power and toughness are each equal to the number of fade counters on CARDNAME."
S:Mode$ Continuous | Affected$ Creature.IsRemembered | AddPower$ X | AddToughness$ X | Description$ HIDDEN It has "This creature's power and toughness are each equal to the number of fade counters on Saproling Burst."
SVar:X:Count$CardCounters.FADE
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Any | Execute$ DestroyRemembered | TriggerDescription$ When CARDNAME leaves the battlefield, destroy all tokens put onto the battlefield with CARDNAME. They can't be regenerated.
SVar:DestroyRemembered:DB$DestroyAll | Cost$ 0 | ValidCards$ Creature.IsRemembered | NoRegen$ True | SubAbility$ DBCleanUp
SVar:DBCleanUp:DB$Cleanup | ClearRemembered$ True
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/saproling_burst.jpg
SetInfo:NMS|Rare|http://magiccards.info/scans/en/ne/113.jpg
Oracle:Fading 7 (This enchantment enters the battlefield with seven fade counters on it. At the beginning of your upkeep, remove a fade counter from it. If you can't, sacrifice it.)\nRemove a fade counter from Saproling Burst: Put a green Saproling creature token onto the battlefield. It has "This creature's power and toughness are each equal to the number of fade counters on Saproling Burst."\nWhen Saproling Burst leaves the battlefield, destroy all tokens put onto the battlefield with Saproling Burst. They can't be regenerated.
End
That was the general idea but I looked for sample code in the wrong cards. None of the ones I used (eg Balduvian Dead) had the actual DelayedTrigger. They instead call the specific phrase from TokenKeywords. So I'll have a look at finishing this then. Thanks Hellfish.Hellfish wrote:Wouldn't giving the token a trigger to exile itself work? OR, failing that, remembering the token and having a DelayedTrigger subability on Stone Idol Trap itself?
Last edited by moomarc on 02 Nov 2011, 16:09, edited 1 time in total.
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Card Development Questions
by friarsol » 02 Nov 2011, 14:39
Relooking at this card, the biggest issue here is the verbiage "at the beginning of this turn"Sloth wrote:How can we script these conditions?
My idea was to script two Phase triggers with opposing requirements checks. This way it will always trigger, the problem is the intervening if clause that checks requirements again.
12/1/2004: Mindstorm Crown's ability doesn't have an "intervening 'if' clause." It always goes onto the stack at the start of your upkeep.
12/1/2004: Mindstorm Crown cares about the number of cards in your hand at the time the turn started, not as the ability resolves. So if you have more than one Crown on the battlefield and no cards in your hand at the start of the turn, you draw a card for each Crown.
Well, it's just one trigger that always triggers. Basically at the beginning of your turn something would store how many cards you have. Then Mindstorm Crown would trigger, when it resolves it'll have a primary ability which draws you a card if the recorded hand size is 0. And a secondary ability which deals you damage if that recorded number is greater than zero.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Hellfish » 02 Nov 2011, 14:49
Might wanna remove the TokenKeywords$ parameter from Saproling Burst there, Marc, since it's no longer used and could potentially cause shenanigans if one somehow got FADE tokens on the tokens.
Also, Muraganda Petroglyphs rears it's ugly head again, didn't think about this before.. The tokens from this version would gain +2/+2 even though they should have a static ability.
Also, Muraganda Petroglyphs rears it's ugly head again, didn't think about this before.. The tokens from this version would gain +2/+2 even though they should have a static ability.

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: Card Development Questions
by moomarc » 02 Nov 2011, 16:48
Thanks for looking through it, but neither of these is actually an issue.Hellfish wrote:Might wanna remove the TokenKeywords$ parameter from Saproling Burst there, Marc, since it's no longer used and could potentially cause shenanigans if one somehow got FADE tokens on the tokens.
Also, Muraganda Petroglyphs rears it's ugly head again, didn't think about this before.. The tokens from this version would gain +2/+2 even though they should have a static ability.

- Saproling Burst test | Open
- Code: Select all
[metadata]
Name=TestSapBurst
Deck Type=Constructed
[main]
1 Allay|EXO
1 Darksteel Plate|MBS
1 Doubling Season|RAV
1 Eldrazi Monument|ZEN
1 Glorious Anthem|USG
1 Muraganda Petroglyphs|FUT
2 Saproling Burst|NMS
[sideboard]
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Card Development Questions
by Hellfish » 02 Nov 2011, 17:08
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: Card Development Questions
by moomarc » 03 Nov 2011, 05:59
Does that mean Saproling Burst can be committed?

I just can't seem to get the trigger to workmoomarc wrote:That was the general idea but I looked for sample code in the wrong cards. None of the ones I used (eg Balduvian Dead) had the actual DelayedTrigger. They instead call the specific phrase from TokenKeywords. So I'll have a look at finishing this then. Thanks Hellfish.Hellfish wrote:Wouldn't giving the token a trigger to exile itself work? OR, failing that, remembering the token and having a DelayedTrigger subability on Stone Idol Trap itself?
](./images/smilies/eusa_wall.gif)
- Stone Idol Trap | Open
- Code: Select all
Name:Stone Idol Trap
ManaCost:5 R
Types:Instant Trap
Text:CARDNAME costs 1 less to cast for each attacking creature.
A:SP$ Token | Cost$ 5 R | TokenAmount$ 1 | TokenName$ Construct | TokenTypes$ Artifact,Creature,Construct | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 6 | TokenToughness$ 12 | RememberTokens$ True | SubAbilities$ DelTrig | TokenKeywords$ Trample | SpellDescription$ Put a 6/12 colorless Construct artifact creature token with trample onto the battlefield. Exile it at the beginning of your next end step.
SVar:DelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | Execute$ TrigExile | TriggerDescription$ Exile Construct at the beginning of your next end step.
SVar:TrigExile:AB$ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Exile | ValidCards$ Creature.IsRemembered
K:CostChange:Player:Less:X:Self:All:All:NoSpecial
SVar:X:Count$Valid Creature.attacking
SVar:Rarity:Rare
End
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Card Development Questions
by Hellfish » 03 Nov 2011, 08:17
EDIT:I don't foresee any big problems with that Saproling Burst, but then again I am like the Lionel Hutz of Rules Lawyers so *shrug*
I got Stone Idol Trap working with a few changes:
I got Stone Idol Trap working with a few changes:
- Code: Select all
Name:Stone Idol Trap
ManaCost:5 R
Types:Instant Trap
Text:CARDNAME costs 1 less to cast for each attacking creature.
A:SP$ Token | Cost$ 5 R | TokenAmount$ 1 | TokenName$ Construct | TokenTypes$ Artifact,Creature,Construct | TokenOwner$ You | TokenColors$ Colorless | TokenPower$ 6 | TokenToughness$ 12 | RememberTokens$ True | SubAbility$ DelTrig | TokenKeywords$ Trample | SpellDescription$ Put a 6/12 colorless Construct artifact creature token with trample onto the battlefield. Exile it at the beginning of your next end step.
SVar:DelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | Execute$ TrigExile | TriggerDescription$ Exile Construct at the beginning of your next end step.
SVar:TrigExile:AB$ChangeZoneAll | Cost$ 0 | Origin$ Battlefield | Destination$ Exile | ChangeType$ Creature.IsRemembered
K:CostChange:Player:Less:X:Self:All:All:NoSpecial
SVar:X:Count$Valid Creature.attacking
SVar:Rarity:Rare
End
Last edited by Hellfish on 03 Nov 2011, 08:22, edited 2 times in total.
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: Card Development Questions
by moomarc » 03 Nov 2011, 08:22
Thanks so much!
Maybe you could help me with another. Also having a problem with the trigger on Basalt Golem. It works fine if SacValid has just Creature, but it has to be limited to the creature that actually blocked Basalt Golem. I've tried Creature.TriggeredBlocker, .BlockingSource and a few others. I also tried using Defined$ TriggeredBlocker (as used with Abomination etc) in conjunction with PlayerTurn$ True, but that didn't help at all. So could someone please let me know what the Creature.LIMITATION should be.
Maybe you could help me with another. Also having a problem with the trigger on Basalt Golem. It works fine if SacValid has just Creature, but it has to be limited to the creature that actually blocked Basalt Golem. I've tried Creature.TriggeredBlocker, .BlockingSource and a few others. I also tried using Defined$ TriggeredBlocker (as used with Abomination etc) in conjunction with PlayerTurn$ True, but that didn't help at all. So could someone please let me know what the Creature.LIMITATION should be.
- Basalt Golem | Open
- Code: Select all
Name:Basalt Golem
ManaCost:5
Types:Artifact Creature Golem
Text:CARDNAME can't be blocked by artifact creatures.
PT:2/4
K:CantBeBlockedBy Artifact.Creature
T:Mode$ Blocks | ValidCard$ Creature | ValidBlocked$ Card.Self | DelayedTrigger$ DelTrigBlocker | TriggerDescription$ Whenever CARDNAME becomes blocked by a creature, that creature's controller sacrifices it at end of combat. If the player does, he or she puts a 0/2 colorless Wall artifact creature token with defender onto the battlefield.
SVar:DelTrigBlocker:Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Each | Execute$ TrigSacBlocker | TriggerDescription$ Sacrifice blocking creature at end of combat. If the player does, he or she puts a 0/2 colorless Wall artifact creature token with defender onto the battlefield.
SVar:TrigSacBlocker:AB$Sacrifice | Cost$ 0 | Defined$ Opponent | SacValid$ Creature.TriggeredBlocker | SacMessage$ creature that blocked CARDNAME | SubAbility$ SVar=MakeToken
SVar:MakeToken:DB$Token | TokenImage$ C 0 2 Wall | TokenName$ Wall | TokenColors$ Colorless | TokenTypes$ Artifact,Creature,Wall | TokenPower$ 0 | TokenToughness$ 2 | TokenOwner$ Opponent | TokenAmount$ 1 | TokenKeywords$ Defender
SVar:Rarity:Uncommon
End
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Who is online
Users browsing this forum: No registered users and 35 guests