Issue 113 Converting Hardcoded Cards to AFs/Trigger
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Chris H. » 16 Feb 2011, 11:45
`jeffwadsworth wrote:I will start with the ? cards.
Thank you Jeff.

-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by friarsol » 17 Feb 2011, 17:09
Here are some Instants in CF_Instant that I think can be moved over
- Code: Select all
Pongify
Peel from Reality
Crib Swap
Sprout Swarm (although it's Convoke still doesn't work)
Life Burst
Accumulated Knowledge
Overwhelming Intellect
Stroke of Genius
Windstorm
Starstorm
Vitalizing Cascade (If the Math doesn't work. We can do the ugly GainLife X with a GainLife 3 subability.)
Burst Lightning
Berserk
Agony Warp
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by friarsol » 17 Feb 2011, 17:50
And the Sorceries:
- Code: Select all
Lab Rats
Roiling Terrain
Plague Wind
Wheel of Fortune (if Discard works)
Deep Analysis
Grizzly Fate (Threshold 4.2)
Delirium Skeins
Ichor Slick
Reminisce
Innocent Blood
Identity Crisis
Bestial Menace
Exhume?
Prosperity
Hurricane
Earthquake
Rolling Earthquake
Savage Twister
Stream of Life
Lavalanche
Psychic Drain
Channel the Suns
Perish the Thought(this is a changeZone not a Discard)
Burning Inquiry
Reanimate
Ashes to Ashes
Last Stand
Decree of Justice
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by jeffwadsworth » 18 Feb 2011, 04:59
I will start with this list. All are done except for Overwhelming Intellect which I can't get to recognize the targeted counted spell. Berserk wasn't in there.friarsol wrote:Here are some Instants in CF_Instant that I think can be moved over
- Code: Select all
Pongify
Peel from Reality
Crib Swap
Sprout Swarm (although it's Convoke still doesn't work)
Life Burst
Accumulated Knowledge
Overwhelming Intellect
Stroke of Genius
Windstorm
Starstorm
Vitalizing Cascade (If the Math doesn't work. We can do the ugly GainLife X with a GainLife 3 subability.)
Burst Lightning
Berserk
Agony Warp
Last edited by jeffwadsworth on 19 Feb 2011, 05:50, edited 1 time 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: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by friarsol » 18 Feb 2011, 05:50
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Chris H. » 18 Feb 2011, 23:29
I am trying to convert Mongrel Pack but I can't limit the activating phase. The card file is below and it does not not matter when this card hits the graveyard, 4 tokens get put on the battlefield:
- Mongrel Pack card | Open
- Name:Mongrel Pack
ManaCost:3 G
Types:Creature Hound
Text:no text
PT:4/1
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigToken | ActivatingPhases$ BeginCombat->EndCombat | TriggerDescription$ When CARDNAME is put into a graveyard from the battlefield during combat, put four 1/1 green Hound creature tokens onto the battlefield.
SVar:TrigToken:AB$Token | Cost$ 0 | TokenAmount$ 4 | TokenName$ Hound | TokenTypes$ Creature,Hound | TokenOwner$ Controller | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mongrel_pack.jpg
SetInfo:TMP|Rare|http://magiccards.info/scans/en/tp/131.jpg
End
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Hellfish » 18 Feb 2011, 23:37
Triggers can't be limited to phases currently. I'll try to implement that tomorrow morning/possibly evening.
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: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Chris H. » 18 Feb 2011, 23:58
`Hellfish wrote:Triggers can't be limited to phases currently. I'll try to implement that tomorrow morning/possibly evening.
OK, no problem, I figured that had not yet been implemented.

-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by jeffwadsworth » 19 Feb 2011, 05:48
I will get these.friarsol wrote:And the Sorceries:
- Code: Select all
Lab Rats
Roiling Terrain
Plague Wind
Wheel of Fortune (if Discard works)
Deep Analysis
Grizzly Fate (Threshold 4.2)
Delirium Skeins
Ichor Slick
Reminisce
Innocent Blood
Identity Crisis
Bestial Menace
Exhume?
Prosperity
Hurricane
Earthquake
Rolling Earthquake
Savage Twister
Stream of Life
Lavalanche
Psychic Drain
Channel the Suns
Perish the Thought(this is a changeZone not a Discard)
Burning Inquiry
Reanimate
Ashes to Ashes
Last Stand
Decree of Justice
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Hellfish » 19 Feb 2011, 10:58
Triggers can now be limited to phases using a comma-separated list of phases in the TriggerPhases$ parameter.Phase names for reference:
- Code: Select all
Untap
Upkeep
Draw
Main1
BeginCombat
Declare Attackers
Declare Attackers - Play Instants and Abilities
Declare Blockers
Declare Blockers - Play Instants and Abilities
Combat Damage
First Strike Damage
EndCombat
Main2
End of Turn
Cleanup
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: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by friarsol » 19 Feb 2011, 14:31
Could you also handle "->" the way it works for AFs? This would make things like InCombat so much cleaner.Hellfish wrote:Triggers can now be limited to phases using a comma-separated list of phases in the TriggerPhases$ parameter.Phase names for reference:
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Hellfish » 19 Feb 2011, 14:44
Shamelessly copied from AbilityFactory.
Done!

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: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Chris H. » 19 Feb 2011, 17:06
`Hellfish wrote:Triggers can now be limited to phases using a comma-separated list of phases in the TriggerPhases$ parameter.
I updated my local copy to the new r6561 with the TriggerPhases$ code. I re-tried the Mongrel Pack mod and there is still no limitations taking place. The 4 Hound tokens are appearing wether it is during combat or not.
Aha! Eureka!

I initially failed to see that "ActivatingPhases$' is for normal non-trigged abs and we have to use "TriggerPhases$" for the new triggers.

-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Chris H. » 21 Feb 2011, 00:20
I have one here for Hellfish. I have converted sooo many cards over the last couple of months that I may have made a simple mistake ... or the spell counter AF may need some adjustments to make this conversion work:
- Mystic Snake | Open
- Name:Mystic Snake
ManaCost:1 G U U
Types:Creature Snake
Text:no text
PT:2/2
K:Flash
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigCounterspell | TriggerDescription$ When CARDNAME enters the battlefield, counter target spell.
SVar:TrigCounterspell:AB$Counter | Cost$ 0 | Type$ Spell | Destination$ Graveyard
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mystic_snake.jpg
SetInfo:APC|Rare|http://magiccards.info/scans/en/ap/112.jpg
SetInfo:TSB|Special|http://magiccards.info/scans/en/tsts/97.jpg
End
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Hellfish » 21 Feb 2011, 00:41
I think the problem with Mystic Snake lies in how AF_Countermagic uses a custom input state to choose which spellability on the stack to counter. I don't think it plays nice with the trigger system. Gimme a day or so, I'll look into it.
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 65 guests