Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by friarsol » 05 Dec 2011, 13:06
Soulstorm and Marc,
Did anyone try SubCounter<All/P1P1> and CostCountersRemoved as the SVar?
Did anyone try SubCounter<All/P1P1> and CostCountersRemoved as the SVar?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by SoulStorm » 05 Dec 2011, 13:10
No, didn't even know you could do that. I'll give it a shot and let you know how it goes.friarsol wrote:Soulstorm and Marc,
Did anyone try SubCounter<All/P1P1> and CostCountersRemoved as the SVar?
Re: Card Development Questions
by friarsol » 05 Dec 2011, 13:20
I see it in the code, not sure if it's copied over for the StackInstance. At least that's how it will be available if it doesn't quite work now.SoulStorm wrote:No, didn't even know you could do that. I'll give it a shot and let you know how it goes.friarsol wrote:Soulstorm and Marc,
Did anyone try SubCounter<All/P1P1> and CostCountersRemoved as the SVar?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by moomarc » 05 Dec 2011, 13:46
The 'All' variable's a new one for me to. Unfortunately it doesn't seem to work yet. Tried all the variations I could think of:friarsol wrote:I see it in the code, not sure if it's copied over for the StackInstance. At least that's how it will be available if it doesn't quite work now.SoulStorm wrote:No, didn't even know you could do that. I'll give it a shot and let you know how it goes.friarsol wrote:Soulstorm and Marc,
Did anyone try SubCounter<All/P1P1> and CostCountersRemoved as the SVar?
- Code: Select all
SVar:X:CostCountersRemoved
SVar:X:CostCountersRemoved$Amount
SVar:X:Count$CostCountersRemoved
SVar:X:Number$CostCountersRemoved

- | Open
- Name:Vish Kal, Blood Arbiter
ManaCost:4 W B B
Types:Legendary Creature Vampire
Text:no text
PT:5/5
K:Flying
K:Lifelink
A:AB$ PutCounter | Cost$ Sac<1/Creature> | Defined$ Self | CounterType$ P1P1 | CounterNum$ Y | SpellDescription$ Put X +1/+1 counters on CARDNAME, where X is the sacrificed creature's power.
A:AB$ Pump | Cost$ SubCounter<All/P1P1> | CostDesc$ Remove all +1/+1 counters from Vish Kal: | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ -X | NumDef$ -X | IsCurse$ True | SpellDescription$ Target creature gets -1/-1 until end of turn for each +1/+1 counter removed this way.
SVar:Y:Sacrificed$CardPower
SVar:X:CostCountersRemoved$Amount
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/vish_kal_blood_arbiter.jpg
SetInfo:COM|Rare|http://magiccards.info/scans/en/cmd/234.jpg
Oracle:Flying, lifelink\nSacrifice a creature: Put X +1/+1 counters on Vish Kal, Blood Arbiter, where X is the sacrificed creature's power.\nRemove all +1/+1 counters from Vish Kal: Target creature gets -1/-1 until end of turn for each +1/+1 counter removed this way.
End
Last edited by moomarc on 05 Dec 2011, 13:51, 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 SoulStorm » 05 Dec 2011, 13:48
Assuming I understood your instructions correctly, it doesn't work. The counters are removed, but nothing happens to the target. Here's the script in case I did something wrong.
- Code: Select all
Name:Vish Kal, Blood Arbiter
ManaCost:4 W B B
Types:Legendary Creature Vampire
Text:no text
PT:5/5
K:Flying
K:Lifelink
A:AB$PutCounter | Cost$ Sac<1/Creature> | Defined$ Self | CounterType$ P1P1 | CounterNum$ Y | SpellDescription$ Put X +1/+1 counters on Vish Kal, Blood Arbiter, where X is the sacrificed creature's power.
A:AB$ Pump | Cost$ SubCounter<All/P1P1> | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ -X | NumDef$ -X | SpellDescription$ Remove all +1/+1 counters from Vish Kal: Target creature gets -1/-1 until end of turn for each +1/+1 counter removed this way.
SVar:Y:Sacrificed$CardPower
SVar:X:CostCountersRemoved
SVar:RemAIDeck:True
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/vish_kal_blood_arbiter.jpg
End
Re: Card Development Questions
by Hellfish » 05 Dec 2011, 14:07
AFAICT, the CostRemoveCounter class puts the amount of counters removed in a new SVar called CostCountersRemoved as a simple Number$. So the correct way to access it would be
), reference CostCountersRemoved directly in the abilities instead of X.
- Code: Select all
SVar:X:SVar$CostCountersRemoved

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 SoulStorm » 05 Dec 2011, 14:52
Works perfectly Hellfish, many thanks!Hellfish wrote:AFAICT, the CostRemoveCounter class puts the amount of counters removed in a new SVar called CostCountersRemoved as a simple Number$. So the correct way to access it would beor, for a more direct/less clear way(or just more direct
- Code: Select all
SVar:X:SVar$CostCountersRemoved
), reference CostCountersRemoved directly in the abilities instead of X.
Re: Card Development Questions
by friarsol » 05 Dec 2011, 16:03
Yea, sorry if I wasn't clear: the direct way Hellfish mentions is what I meant by just using CostCountersRemoved for your SVar.
"All" isn't really a variable. When I re-did the costs, amounts now come in as strings, which can be special (such as All here) or an SVar to be referenced further in the code, or just a number as most cases.
"All" isn't really a variable. When I re-did the costs, amounts now come in as strings, which can be special (such as All here) or an SVar to be referenced further in the code, or just a number as most cases.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by jeffwadsworth » 08 Dec 2011, 20:05
Testing Brand of Ill Omen. Does Caster$ support EnchantedController?
- | Open
- Name:Brand of Ill Omen
ManaCost:3 R
Types:Enchantment Aura
Text:no text
K:Cumulative upkeep:R
A:SP$ Attach | Cost$ 3 R | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ CantBeCast | ValidCard$ Creature | Caster$ EnchantedController | Description$ Enchanted creature's controller can't cast creature spells.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/brand_of_ill_omen.jpg
End
- 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 Sloth » 08 Dec 2011, 20:28
Not yet...jeffwadsworth wrote:Testing Brand of Ill Omen. Does Caster$ support EnchantedController?
- | Open
- Name:Brand of Ill Omen
ManaCost:3 R
Types:Enchantment Aura
Text:no text
K:Cumulative upkeep:R
A:SP$ Attach | Cost$ 3 R | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ CantBeCast | ValidCard$ Creature | Caster$ EnchantedController | Description$ Enchanted creature's controller can't cast creature spells.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/brand_of_ill_omen.jpg
End
Finished and added your Brand of Ill Omen (which was my test object).
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by jeffwadsworth » 09 Dec 2011, 23:06
Testing one of the ugliest cards in magic...Phantasmal Mount.
This works fine if the targeted creature changes zones, but if the Phantasmal Mount changes zones, the trigger does not fire. Does someone spot the problem? It is Friday and my eyes are getting blurry.
- | Open
- Name:Phantasmal Mount
ManaCost:1 U
Types:Creature Illusion Horse
Text:no text
PT:1/1
K:Flying
A:AB$ Pump | Cost$ T | ValidTgts$ Creature.YouCtrl+toughnessLE2 | TgtPrompt$ Select target creature you control with toughness 2 or less | RememberTargets$ True | KW$ Flying | NumAtt$ 1 | NumDef$ 1 | SubAbility$ DBAnimate | SpellDescription$ Target creature you control with toughness 2 or less gets +1/+1 and gains flying until end of turn. When CARDNAME leaves the battlefield this turn, sacrifice that creature. When the creature leaves the battlefield this turn, sacrifice CARDNAME.
SVar:DBAnimate:DB$ Animate | Triggers$ TrigLeavesPlayPM,TrigLeavesPlayCreature | sVars$ TrigSacCreature,TrigSacPM,DBCleanup
SVar:TrigLeavesPlayPM:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Any | Execute$ TrigSacCreature | TriggerDescription$ When CARDNAME leaves the battlefield this turn, sacrifice that creature.
SVar:TrigSacCreature:AB$ Destroy | Cost$ 0 | Defined$ Card.IsRemembered | Sacrifice$ True | SubAbility$ DBCleanup
SVar:TrigLeavesPlayCreature:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Battlefield | Destination$ Any | Execute$ TrigSacPM | TriggerDescription$ When the creature leaves the battlefield this turn, sacrifice CARDNAME.
SVar:TrigSacPM:AB$ Destroy | Cost$ 0 | Sacrifice$ True
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/phantasmal_mount.jpg
End
This works fine if the targeted creature changes zones, but if the Phantasmal Mount changes zones, the trigger does not fire. Does someone spot the problem? It is Friday and my eyes are getting blurry.
- 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 Sloth » 10 Dec 2011, 10:04
Does the trigger not fire or does it fire and nothing happens?jeffwadsworth wrote:Testing one of the ugliest cards in magic...Phantasmal Mount.
- | Open
- Name:Phantasmal Mount
ManaCost:1 U
Types:Creature Illusion Horse
Text:no text
PT:1/1
K:Flying
A:AB$ Pump | Cost$ T | ValidTgts$ Creature.YouCtrl+toughnessLE2 | TgtPrompt$ Select target creature you control with toughness 2 or less | RememberTargets$ True | KW$ Flying | NumAtt$ 1 | NumDef$ 1 | SubAbility$ DBAnimate | SpellDescription$ Target creature you control with toughness 2 or less gets +1/+1 and gains flying until end of turn. When CARDNAME leaves the battlefield this turn, sacrifice that creature. When the creature leaves the battlefield this turn, sacrifice CARDNAME.
SVar:DBAnimate:DB$ Animate | Triggers$ TrigLeavesPlayPM,TrigLeavesPlayCreature | sVars$ TrigSacCreature,TrigSacPM,DBCleanup
SVar:TrigLeavesPlayPM:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Battlefield | Destination$ Any | Execute$ TrigSacCreature | TriggerDescription$ When CARDNAME leaves the battlefield this turn, sacrifice that creature.
SVar:TrigSacCreature:AB$ Destroy | Cost$ 0 | Defined$ Card.IsRemembered | Sacrifice$ True | SubAbility$ DBCleanup
SVar:TrigLeavesPlayCreature:Mode$ ChangesZone | ValidCard$ Card.IsRemembered | Origin$ Battlefield | Destination$ Any | Execute$ TrigSacPM | TriggerDescription$ When the creature leaves the battlefield this turn, sacrifice CARDNAME.
SVar:TrigSacPM:AB$ Destroy | Cost$ 0 | Sacrifice$ True
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/phantasmal_mount.jpg
End
This works fine if the targeted creature changes zones, but if the Phantasmal Mount changes zones, the trigger does not fire. Does someone spot the problem? It is Friday and my eyes are getting blurry.
Anyway, this line is incorrect:
- Code: Select all
SVar:TrigSacCreature:AB$ Destroy | Cost$ 0 | Defined$ Card.IsRemembered | Sacrifice$ True | SubAbility$ DBCleanup
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by squee1968 » 11 Dec 2011, 15:10
Hello, Devs.
I believe I have a card to contribute. Surgespanner. I've playtested it, and it seems like it's working ok, except the card picture doesn't show for some reason after downloading it.
I believe I have a card to contribute. Surgespanner. I've playtested it, and it seems like it's working ok, except the card picture doesn't show for some reason after downloading it.
- Code: Select all
Name:Surgespanner
ManaCost:2 U U
Types:Creature Merfolk Wizard
Text:no text
PT:2/2
T:Mode$ Taps | ValidCard$ Card.Self | OptionalDecider$ You | TriggerZones$ Battlefield | Execute$ TrigBounce | TriggerDescription$ Whenever Surgespanner becomes tapped, you may pay 1U. If you do, return target permanent to its owner’s hand.
SVar:TrigBounce:AB$ChangeZone | Cost$ 1 U | ValidTgts$ Permanent | TgtPrompt$ Select target permanent | Origin$ Battlefield | Destination$ Hand
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/surgespanner.jpg
SetInfo:LRW|Rare|http://magiccards.info/scans/en/lw/92.jpg
Oracle:Whenever Surgespanner becomes tapped, you may pay 1U. If you do, return target permanent to its owner's hand.
End
Re: Card Development Questions
by Sloth » 11 Dec 2011, 18:49
Looks fine. I've added it to the developer version. Thanks squee1968.squee1968 wrote:Hello, Devs.
I believe I have a card to contribute. Surgespanner. I've playtested it, and it seems like it's working ok, except the card picture doesn't show for some reason after downloading it.Feel free to fix and add to Forge.
- Code: Select all
Name:Surgespanner
ManaCost:2 U U
Types:Creature Merfolk Wizard
Text:no text
PT:2/2
T:Mode$ Taps | ValidCard$ Card.Self | OptionalDecider$ You | TriggerZones$ Battlefield | Execute$ TrigBounce | TriggerDescription$ Whenever Surgespanner becomes tapped, you may pay 1U. If you do, return target permanent to its owner’s hand.
SVar:TrigBounce:AB$ChangeZone | Cost$ 1 U | ValidTgts$ Permanent | TgtPrompt$ Select target permanent | Origin$ Battlefield | Destination$ Hand
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/surgespanner.jpg
SetInfo:LRW|Rare|http://magiccards.info/scans/en/lw/92.jpg
Oracle:Whenever Surgespanner becomes tapped, you may pay 1U. If you do, return target permanent to its owner's hand.
End
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by squee1968 » 12 Dec 2011, 02:47
Here's Hunter Sliver, seems to do what it's supposed to, but for some reason provoke is not working. I even made a quick deck with provoke cards that were already in forge (Krosan Vorine, Brontotherium, etc.) and could not get them to trigger, either. Aren't the triggers supposed to go on the stack automatically as soon as attackers are declared? Or is there something I'm supposed to be doing? Someone please check into this.
- Code: Select all
Name:Hunter Sliver
ManaCost:1 R
Types:Creature Sliver
Text:no text
PT:1/1
S:Mode$ Continuous | Affected$ Sliver | AddKeyword$ Provoke | Description$ All Slivers have provoke.
SVar:PlayMain1:TRUE
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/hunter_sliver.jpg
SetInfo:LGN|Common|http://magiccards.info/scans/en/le/102.jpg
Oracle:All Slivers have provoke. (When this attacks, you may have target creature defending player controls untap and block it if able.)
End
Who is online
Users browsing this forum: No registered users and 53 guests