Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by friarsol » 31 Jan 2011, 19:08
Those should be the right ones. It looks like TimesKicked wasn't calling the doXMath function that everything else calls. I'm submitting the fix now.jeffwadsworth wrote:I am testing Deathforge Shaman and can not get it to double the damage using either Count$TimesKicked/Twice or Count$TimesKicked/Times.2
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Jaedayr » 31 Jan 2011, 19:53
Will this require more than text to work properly? Everything works except that the enchantment taps, not the creature. It seems similar to Gemhide Sliver.
- Code: Select all
Name:Utopia Vow
ManaCost:1 G
Types:Enchantment Aura
Text:no text
K:Enchant creature
K:enPumpCurse:HIDDEN CARDNAME can't attack or block.:Enchanted creature can't attack or block.
A:AB$ Mana | Cost$ T | Produced$ W | SpellDescription$ Add W to your mana pool.
A:AB$ Mana | Cost$ T | Produced$ U | SpellDescription$ Add U to your mana pool.
A:AB$ Mana | Cost$ T | Produced$ B | SpellDescription$ Add B to your mana pool.
A:AB$ Mana | Cost$ T | Produced$ R | SpellDescription$ Add R to your mana pool.
A:AB$ Mana | Cost$ T | Produced$ G | SpellDescription$ Add G to your mana pool.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/utopia_vow.jpg
SetInfo:PLC|Common|http://magiccards.info/scans/en/pc/142.jpg
End
Re: Card Development Questions
by friarsol » 31 Jan 2011, 20:15
Yea this doesn't really work since the enchanted creature is the one gaining the ability. Issue 99 (http://code.google.com/p/cardforge/issues/detail?id=99) is already recorded as a work item. Once we have the work item finished cards like this and Gemhide Sliver would not need any hardcoding.Jaedayr wrote:Will this require more than text to work properly? Everything works except that the enchantment taps, not the creature. It seems similar to Gemhide Sliver.
- Code: Select all
Name:Utopia Vow
ManaCost:1 G
Types:Enchantment Aura
Text:no text
K:Enchant creature
K:enPumpCurse:HIDDEN CARDNAME can't attack or block.:Enchanted creature can't attack or block.
A:AB$ Mana | Cost$ T | Produced$ W | SpellDescription$ Add W to your mana pool.
A:AB$ Mana | Cost$ T | Produced$ U | SpellDescription$ Add U to your mana pool.
A:AB$ Mana | Cost$ T | Produced$ B | SpellDescription$ Add B to your mana pool.
A:AB$ Mana | Cost$ T | Produced$ R | SpellDescription$ Add R to your mana pool.
A:AB$ Mana | Cost$ T | Produced$ G | SpellDescription$ Add G to your mana pool.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/utopia_vow.jpg
SetInfo:PLC|Common|http://magiccards.info/scans/en/pc/142.jpg
End
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Jaedayr » 31 Jan 2011, 20:41
Thanks for the quick response Sol. Next question. The card below appears to do everything it should including mana payment and creature selection, except the selected creature never changes zones from the graveyard to the battlefield. I am trying to use text from Debtors' Knell and Hymn of Rebirth. What am I missing here?
- Code: Select all
Name:Teneb, the Harvester
ManaCost:3 B G W
Types:Legendary Creature Dragon
Text:no text
PT:6/6
K:Flying
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | Execute$ TrigChange | CombatDamage$ True | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may pay 2 B. If you do, put target creature card from a graveyard onto the battlefield under your control.
SVar:TrigChange:AB$ChangeZone | Cost$ 2 B | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True | ChangeNum$ 1 | TgtPrompt$ Choose target creature card in a graveyard | ValidTgts$ Creature
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/teneb_the_harvester.jpg
SetInfo:PLC|Rare|http://magiccards.info/scans/en/pc/163.jpg
End
Re: Card Development Questions
by Zirbert » 31 Jan 2011, 21:03
Here's one I'm working on - Necromancer's Covenant (I do love me some zombies). I jigsawed it together mostly using bits of other cards with similar functions. It doesn't quite work yet, but I think I know why. Hopefully one of the coding gurus will be willing to give it a once-over, please:
I'm pretty sure the problem is that X, the number of cards exiled / zombies made, is being defined too late. I don't know how to tell it X is the number of creature cards in the target player's graveyard *before* the exiling.
I also don't have SetInfo and Picture info there yet, but even I can handle those - I wanted to get this "draft" version posted ASAP.
Anybody want to help me move that variable definition to the right place? I tried flipping the order of the triggered abilities - make X zombies, with X defined as Count$InTgtYard.Creature, then exiling all creatures from that graveyard (seems to me that would be functionally identical) - but that went off without asking me for the targeted player. Again, no zombies, and I don't know how to wedge a "choose target player" into the token-making trigger line...
- Code: Select all
Name:Necromancer's Covenant
ManaCost:3 W B B
Types:Enchantment
Text:no text
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExileGrave | TriggerDescription$ When CARDNAME enters the battlefield, exile all creature cards from target player's graveyard, then put a 2/2 black Zombie creature token onto the battlefield for each card exiled this way.
SVar:TrigExileGrave:AB$ChangeZoneAll | Cost$ 0 | ValidTgts$ Player | ChangeType$ Creature | Origin$ Graveyard | Destination$ Exile | ValidTgts$ Player | SubAbility$ SVar=MakeZombies
SVar:MakeZombies:AB$Token | Cost$ 0 | TokenImage$ B 2 2 Zombie | TokenName$ Zombie | TokenColors$ Black | TokenTypes$ Creature,Zombie | TokenPower$ 2 | TokenToughness$ 2 | TokenOwner$ Controller | TokenAmount$ X
SVar:X:Count$InTgtYard.Creature
K:stPumpAll:Creature.Zombie+YouCtrl:0/0/Lifelink:No Condition:Zombies you control have lifelink.
SVar:Rarity:Rare
SVar:Picture:
SetInfo:
End
I'm pretty sure the problem is that X, the number of cards exiled / zombies made, is being defined too late. I don't know how to tell it X is the number of creature cards in the target player's graveyard *before* the exiling.
I also don't have SetInfo and Picture info there yet, but even I can handle those - I wanted to get this "draft" version posted ASAP.
Anybody want to help me move that variable definition to the right place? I tried flipping the order of the triggered abilities - make X zombies, with X defined as Count$InTgtYard.Creature, then exiling all creatures from that graveyard (seems to me that would be functionally identical) - but that went off without asking me for the targeted player. Again, no zombies, and I don't know how to wedge a "choose target player" into the token-making trigger line...
Re: Card Development Questions
by friarsol » 31 Jan 2011, 22:53
Teneb looks ok to me, so there may be an issue with how Triggers interacts with Targeting. You don't need the ChangeNum line since you are targeting (you would use TargetMin and TargetMax for non-default values)Jaedayr wrote:Thanks for the quick response Sol. Next question. The card below appears to do everything it should including mana payment and creature selection, except the selected creature never changes zones from the graveyard to the battlefield. I am trying to use text from Debtors' Knell and Hymn of Rebirth. What am I missing here?
- 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 » 31 Jan 2011, 22:57
Yep that pretty much sums it up. If we make Remember more flexible than we can remember how many cards are exiled and then use that value with the next SubAbility. This would be good for things like Cleansing Meditation or Decree of Pain. (Although Destroyed this way might be a bit trickier)
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Zirbert » 31 Jan 2011, 23:46
Hmmm... so there isn't any way to just grab and define a variable, other than citing X in an ability line then defining it in the next? That is, there's no way to just, more or less anywhere, say "X = (definition)", then refer to it later?friarsol wrote:Yep that pretty much sums it up. If we make Remember more flexible than we can remember how many cards are exiled and then use that value with the next SubAbility. This would be good for things like Cleansing Meditation or Decree of Pain. (Although Destroyed this way might be a bit trickier)
I grew up programming in Basic (yup, I'm that old), so I wanted to write this card's ETB ability as something like this logical sequence:
- Code: Select all
X = number of creature cards in target players graveyard
Exile all creature cards from that graveyard ( = exile X creature cards from that graveyard)
Put X zombie tokens into play
Thanks,
Zirbert
Re: Card Development Questions
by friarsol » 01 Feb 2011, 00:10
What you wrote up is the way that does happen. But there's no way to do it "before" anything else. So when X is calculated, it's already in the SubAbility, after the creatures have been exiled. As I was saying before, by making Remember more flexible, we can remember all of the cards that were effected by the primary ability and then use those cards however we choose. Counting the number would be the most common thing to do in this case.
If we had a stand alone "Define Variable" AF this could cause nightmares with how the AI could play that card, since the primary ability handles most of the checks for whether or not the card should be played.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Zirbert » 01 Feb 2011, 03:00
OK, here's another work-in-progress that's creating triggering problems. Because no one demanded it, Giant Shark. Don't laugh - it let me try several abilities and triggers, and I figured it was a safe bet that no one was going to beat me to posting it:
However, it gets the bonus whenever it blocks *any* attacking creature, whether that attacker has taken damage this turn or not. I know (hope) the problem is in this part:
(Oh, and Hellfish - the new trigger example is great. I love the annotated explanations.)
-Zirbert
- Code: Select all
Name:Giant Shark
ManaCost:5 U
Types:Creature Fish
Text:no text
PT:4/4
T:Mode$ Blocks | ValidCard$ Creature.wasDealtDamageThisTurn | ValidAttacker$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigBlockedPump | TriggerDescription$ Whenever CARDNAME becomes blocked by a creature that has been dealt damage this turn, CARDNAME gets +2/+0 and gains trample until end of turn.
SVar:TrigBlockedPump:AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 2 | NumDef$ 0 | KW$ Trample
T:Mode$ Blocks | ValidCard$ Card.Self | ValidAttacker$ Creature.wasDealtDamageThisTurn | TriggerZones$ Battlefield | Execute$ TrigBlockingPump | TriggerDescription$ Whenever CARDNAME blocks a creature that has been dealt damage this turn, CARDNAME gets +2/+0 and gains trample until end of turn.
SVar:TrigBlockingPump:AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 2 | NumDef$ 0 | KW$ Trample
K:CARDNAME can't attack unless defending player controls an Island.
K:When you control no Islands, sacrifice CARDNAME.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/giant_shark.jpg
SetInfo:DRK|Common|http://magiccards.info/scans/en/dk/28.jpg
End
However, it gets the bonus whenever it blocks *any* attacking creature, whether that attacker has taken damage this turn or not. I know (hope) the problem is in this part:
- Code: Select all
T:Mode$ Blocks | ValidCard$ Card.Self | ValidAttacker$ Creature.wasDealtDamageThisTurn | TriggerZones$ Battlefield | Execute$ TrigBlockingPump | TriggerDescription$ Whenever CARDNAME blocks a creature that has been dealt damage this turn, CARDNAME gets +2/+0 and gains trample until end of turn.
SVar:TrigBlockingPump:AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 2 | NumDef$ 0 | KW$ Trample
(Oh, and Hellfish - the new trigger example is great. I love the annotated explanations.)
-Zirbert
Re: Card Development Questions
by Hellfish » 01 Feb 2011, 07:26
Ooh, I think this is a case of the wiki not keeping up with my changes. If you rename the ValidAttacker parameter to ValidBlocked it should work. I'll edit the wiki. 

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 jeffwadsworth » 01 Feb 2011, 17:30
There are quite a few optional cards out there that the AI should pretty much always accept. Lifegift is an example. Is there anyway to encourage its use? An opposite to IsCurse$ True, etc.
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: Card Development Questions
by friarsol » 01 Feb 2011, 17:56
This is the exact type of thing I'm working on related to triggers right now.jeffwadsworth wrote:There are quite a few optional cards out there that the AI should pretty much always accept. Lifegift is an example. Is there anyway to encourage its use? An opposite to IsCurse$ True, etc.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Zirbert » 01 Feb 2011, 21:24
That did the trick! Thanks to you, Forge can offer, at long last, a fully functional version of the card players have been clamoring for - Giant Shark.Hellfish wrote:Ooh, I think this is a case of the wiki not keeping up with my changes. If you rename the ValidAttacker parameter to ValidBlocked it should work. I'll edit the wiki.

I'll post the corrected card over on the Card Contributions thread. Hopefully some kind soul with a sense of humour will take mercy and add it to the SVN (Death Pit Offering, too, which nobody's committed yet).
-Zirbert
Re: Card Development Questions
by friarsol » 01 Feb 2011, 21:49
While definitely functional, I think it would be greatly advantageous for Death Pit Offering to wait for a SacrificeAllZirbert wrote:(Death Pit Offering, too, which nobody's committed yet)
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Who is online
Users browsing this forum: No registered users and 35 guests