Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by Sloth » 19 Nov 2011, 08:06
Ok, this should be scriptable now. The last ability can look like:moomarc wrote:
- Ashling's Prerogative | Open
- Name:Ashling's Prerogative
ManaCost:1 R
Types:Enchantment
Text:no text
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseMode | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose odd or even. (Zero is even.)
SVar:ChooseMode:AB$ ChooseNumber | Cost$ 0 | Defined$ You | Min$ 0 | Max$ 1
S:Mode$ Continuous | Affected$ Creature.cmc/Mod.2EQX | AffectedZone$ Hand,Stack,Battlefield,Graveyard,Exile | AddKeyword$ Haste | Description$ Each creature with converted mana cost of the chosen value has haste.
S:Mode$ Continuous | Affected$ Creature.cmc/Mod.2NEX | AffectedZone$ Hand,Stack,Battlefield,Graveyard,Exile | AddKeyword$ CARDNAME enters the battlefield tapped. | Description$ Each creature without converted mana cost of the chosen value enters the battlefield tapped.
SVar:X:Count$ChosenNumber
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/ashlings_prerogative.jpg
SetInfo:LRW|Rare|http://magiccards.info/scans/en/lw/150.jpg
Oracle:As Ashling's Prerogative enters the battlefield, choose odd or even. (Zero is even.)\nEach creature with converted mana cost of the chosen value has haste.\nEach creature without converted mana cost of the chosen value enters the battlefield tapped.
End
The math function in the affected restriction doesn't work. Is there a different syntax for an in-line function or can they only be used in xCount and Number SVars (in which case I can't see a way to make this card work)? At the moment only creatures with 0 casting cost get the first ability (regardless of chosen number), so I guess the cmc is being nullified completely with the current syntax. The other issue is that the 'CARDNAME enters the battlefield tapped' keyword isn't working. The creatures get the wording, but don't actually tap. So is it one of those that can't be added?
- Code: Select all
S:Mode$ ETBTapped | ValidCard$ Creature.cmcM2Y | Description$ Each creature without converted mana cost of the chosen value enters the battlefield tapped.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by moomarc » 19 Nov 2011, 08:48
Thanks Sloth. When I get back home this evening I'll make the final changes. BTW, Y actually had to be Count$ChosenNumber/Plus.1/Mod.2 otherwise Y equals 2 when odd is chosen.Sloth wrote:Ok, this should be scriptable now. The last ability can look like:moomarc wrote:
- Ashling's Prerogative | Open
- Name:Ashling's Prerogative
ManaCost:1 R
Types:Enchantment
Text:no text
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseMode | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose odd or even. (Zero is even.)
SVar:ChooseMode:AB$ ChooseNumber | Cost$ 0 | Defined$ You | Min$ 0 | Max$ 1
S:Mode$ Continuous | Affected$ Creature.cmc/Mod.2EQX | AffectedZone$ Hand,Stack,Battlefield,Graveyard,Exile | AddKeyword$ Haste | Description$ Each creature with converted mana cost of the chosen value has haste.
S:Mode$ Continuous | Affected$ Creature.cmc/Mod.2NEX | AffectedZone$ Hand,Stack,Battlefield,Graveyard,Exile | AddKeyword$ CARDNAME enters the battlefield tapped. | Description$ Each creature without converted mana cost of the chosen value enters the battlefield tapped.
SVar:X:Count$ChosenNumber
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/ashlings_prerogative.jpg
SetInfo:LRW|Rare|http://magiccards.info/scans/en/lw/150.jpg
Oracle:As Ashling's Prerogative enters the battlefield, choose odd or even. (Zero is even.)\nEach creature with converted mana cost of the chosen value has haste.\nEach creature without converted mana cost of the chosen value enters the battlefield tapped.
End
The math function in the affected restriction doesn't work. Is there a different syntax for an in-line function or can they only be used in xCount and Number SVars (in which case I can't see a way to make this card work)? At the moment only creatures with 0 casting cost get the first ability (regardless of chosen number), so I guess the cmc is being nullified completely with the current syntax. The other issue is that the 'CARDNAME enters the battlefield tapped' keyword isn't working. The creatures get the wording, but don't actually tap. So is it one of those that can't be added?and Y should be X+1.
- Code: Select all
S:Mode$ ETBTapped | ValidCard$ Creature.cmcM2Y | Description$ Each creature without converted mana cost of the chosen value enters the battlefield tapped.
-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 » 19 Nov 2011, 10:05
Y can be 2, because the new M2 comparator compars the left side modulo 2 with the right side modulo 2.moomarc wrote:Thanks Sloth. When I get back home this evening I'll make the final changes. BTW, Y actually had to be Count$ChosenNumber/Plus.1/Mod.2 otherwise Y equals 2 when odd is chosen.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by jeffwadsworth » 20 Nov 2011, 15:40
No, but thanks for the reply. The correct form is there, it just doesn't work. Oh well.moomarc wrote:SVar:X:Number$A/Plus.B should fix the first problem.
- 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 » 20 Nov 2011, 16:14
I've just tried the normal form and it works:jeffwadsworth wrote:No, but thanks for the reply. The correct form is there, it just doesn't work. Oh well.moomarc wrote:SVar:X:Number$A/Plus.B should fix the first problem.
- | Open
- Name:Ulasht, the Hate Seed
ManaCost:2 R G
Types:Legendary Creature Hellion Hydra
Text:Ulasht, the Hate Seed enters the battlefield with a +1/+1 counter on it for each other red creature you control and a +1/+1 counter on it for each other green creature you control.
PT:0/0
K:etbCounter:P1P1:X
A:AB$ Charm | Cost$ 1 SubCounter<1/P1P1> | Choices$ DBDamage,DBPutCounter | SpellDescription$ Choose one : Ulasht deals 1 damage to target creature; or put a 1/1 green Saproling creature token onto the battlefield.
SVar:DBDamage:DB$ DealDamage | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 1 | SpellDescription$ Choose one — Ulasht deals 1 damage to target creature;
SVar:DBPutCounter:DB$ Token | TokenAmount$ 1 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1 | TokenOwner$ You | SpellDescription$ or put a 1/1 green Saproling creature token onto the battlefield.
SVar:X:Count$Valid Creature.YouCtrl+Red+Other/Plus.B
SVar:B:Count$Valid Creature.YouCtrl+Green+Other
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/ulasht_the_hate_seed.jpg
End
I have no clue about the charm bug though.

EDIT: I think the whole AF Charm needs some fixing. I'm not sure how this is supposed to work.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by Iran » 25 Nov 2011, 00:09
About Plague of Vermin, Lantern of Insight, Timesifter, Orim's Chant, Rakdos Riteknife, Shirei, Shizo's Caretaker, Crypt Champion and Cunning Wish.
Any of these cards are scriptabled (doable)?
I think Lantern of Insight is possible, but how can I show the top card of my library and AI's library?
I think Plague of Vermin is possible, but the problem is AI pay the life cost to put 1/1 Black Rat creature token.
I think Orim's Chant,Rakdos Riteknife and Crypt Champion is possible, but How can I do these scripts?
In case Rakdos Riteknife, Exists in forge blood counter?
I thank for the possible answers.
Forge is amazing game, the best.
Any of these cards are scriptabled (doable)?
I think Lantern of Insight is possible, but how can I show the top card of my library and AI's library?
I think Plague of Vermin is possible, but the problem is AI pay the life cost to put 1/1 Black Rat creature token.
I think Orim's Chant,Rakdos Riteknife and Crypt Champion is possible, but How can I do these scripts?
In case Rakdos Riteknife, Exists in forge blood counter?
I thank for the possible answers.
Forge is amazing game, the best.
Re: Card Development Questions
by moomarc » 25 Nov 2011, 12:24
- Riku of Two Reflections | Open
- Name:Riku of Two Reflections
ManaCost:2 U R G
Types:Legendary Creature Human Wizard
Text:no text
PT:2/2
T:Mode$ SpellCast | ValidCard$ Instant,Sorcery | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigCopySpell | TriggerDescription$ Whenever you cast an instant or sorcery spell, you may pay U R. If you do, copy that spell. You may choose new targets for the copy.
SVar:TrigCopySpell:AB$CopySpell | Cost$ U R | Defined$ TriggeredSpellAbility
T:Mode$ ChangesZone | ValidCard$ Creature.Other+nonToken+YouCtrl | Origin$ Any | Destination$ Battlefield | TriggerZones$ Battlefield | Execute$ TrigCopyCreature | OptionalDecider$ You | TriggerDescription$ Whenever another nontoken creature enters the battlefield under your control, you may pay G U. If you do, put a token that's a copy of that creature onto the battlefield.
SVar:TrigCopyCreature:AB$CopyPermanent | Cost$ G U | Defined$ TriggeredCard
SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/riku_of_two_reflections.jpg
SetInfo:COM|Mythic|http://magiccards.info/scans/en/cmd/220.jpg
Oracle:Whenever you cast an instant or sorcery spell, you may pay{R}. If you do, copy that spell. You may choose new targets for the copy.\nWhenever another nontoken creature enters the battlefield under your control, you may pay
{U}. If you do, put a token that's a copy of that creature onto the battlefield.
End
- If you cast a second Riku with one in play, the second ability triggers before the legend rule is applied so you end up with a token Riku in play with the two originals in the grave. Is this correct?
- There seems to be a general problem with copySpell where only the first target is accepted/remembered. Should I commit anyway or wait until that issue has been resolved?
-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 » 25 Nov 2011, 13:47
That's right. The second Legendary creature hits the battlefield, triggers happen going on the stack. State based actions happen, putting both Legends in the graveyard. Trigger resolves putting a token of the Legendary creature into play.moomarc wrote:- If you cast a second Riku with one in play, the second ability triggers before the legend rule is applied so you end up with a token Riku in play with the two originals in the grave. Is this correct?
- 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 » 28 Nov 2011, 18:29
Attempted to code Tatsumasa, the Dragon's Fang, but ran into a problem. The token generation works fine and exiles Tatsumasa, the Dragon's Fang correctly, but when the token dies, Tatsumasa, the Dragon's Fang doesn't return from exile. Thanks for the help as always.
- Code: Select all
Name:Tatsumasa, the Dragon's Fang
ManaCost:6
Types:Legendary Artifact Equipment
Text:Equipped creature gets +5/+5.
K:eqPump 3:+5/+5
A:AB$ Token | Cost$ 6 Exile<1/CARDNAME> | TokenAmount$ 1 | TokenName$ Dragon Spirit | TokenTypes$ Creature,Dragon,Spirit | TokenOwner$ You | TokenColors$ Blue | TokenPower$ 5 | TokenToughness$ 5 | TokenKeywords$ Flying | TokenTriggers$ TriggerJunior | TokenSVars$ TrigReturn| SpellDescription$ Put a 5/5 blue Dragon Spirit creature token with flying onto the battlefield. Return Tatsumasa to the battlefield under its owner's control when that token dies.
SVar:TriggerJunior:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigReturn | TriggerDescription$ Return Tatsumasa to the battlefield under its owner's control when that token dies.
SVar:TrigReturn:AB$ChangeZone | Cost$ 0 | ChangeType$ Card.namedTatsumasa, the Dragon's Fang | ChangeNum$ 1 | Origin$ Exile | Destination$ Battlefield | Hidden$ True | SpellDescription$ Return Tatsumasa to the battlefield under its owner's control when that token dies.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/tatsumasa_the_dragons_fang.jpg
End
Re: Card Development Questions
by moomarc » 28 Nov 2011, 19:55
After TokenSVars$ TrigReturn, there's no space between TrigReturn and the pipe splitter. As far as I recall that will stop the svar from being added so will fail to trigger. I can't test it right now but hope that helps. My own attempt to do this card ended in failure because of 'remember' timing issues, so hope your's works.SoulStorm wrote:Attempted to code Tatsumasa, the Dragon's Fang, but ran into a problem. The token generation works fine and exiles Tatsumasa, the Dragon's Fang correctly, but when the token dies, Tatsumasa, the Dragon's Fang doesn't return from exile. Thanks for the help as always.
- Code: Select all
Name:Tatsumasa, the Dragon's Fang
ManaCost:6
Types:Legendary Artifact Equipment
Text:Equipped creature gets +5/+5.
K:eqPump 3:+5/+5
A:AB$ Token | Cost$ 6 Exile<1/CARDNAME> | TokenAmount$ 1 | TokenName$ Dragon Spirit | TokenTypes$ Creature,Dragon,Spirit | TokenOwner$ You | TokenColors$ Blue | TokenPower$ 5 | TokenToughness$ 5 | TokenKeywords$ Flying | TokenTriggers$ TriggerJunior | TokenSVars$ TrigReturn| SpellDescription$ Put a 5/5 blue Dragon Spirit creature token with flying onto the battlefield. Return Tatsumasa to the battlefield under its owner's control when that token dies.
SVar:TriggerJunior:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigReturn | TriggerDescription$ Return Tatsumasa to the battlefield under its owner's control when that token dies.
SVar:TrigReturn:AB$ChangeZone | Cost$ 0 | ChangeType$ Card.namedTatsumasa, the Dragon's Fang | ChangeNum$ 1 | Origin$ Exile | Destination$ Battlefield | Hidden$ True | SpellDescription$ Return Tatsumasa to the battlefield under its owner's control when that token dies.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/tatsumasa_the_dragons_fang.jpg
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 moomarc » 29 Nov 2011, 18:15
Is this implementation of Quillmane Baku correct?
So should I commit?
Secondly, there was never a reply to the last question I posted about Riku of Two Reflections regarding the problems with copied spell targeting. The problem can become quite pronounced with this card because of its two abilities' interactions. Should he be committed anyway?
- Quillmane Baku | Open
- Code: Select all
Name:Quillmane Baku
ManaCost:4 U
Types:Creature Spirit
Text:no text
PT:3/3
T:Mode$ SpellCast | ValidCard$ Spirit,Arcane | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigPutCounter | TriggerDescription$ Whenever you cast a Spirit or Arcane spell, you may put a ki counter on CARDNAME.
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ KI | CounterNum$ 1
A:AB$ ChangeZone | Cost$ 1 T SubCounter<X/KI> | Origin$ Battlefield | Destination$ Hand | ValidTgts$ Creature | ChangeNum$ 1 | SpellDescription$ Return target creature with converted mana cost X or less to its owner's hand.
SVar:X:Targeted$CardManaCost
RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/quillmane_baku.jpg
SetInfo:BOK|Common|http://magiccards.info/scans/en/bok/48.jpg
Oracle:Whenever you cast a Spirit or Arcane spell, you may put a ki counter on Quillmane Baku.\n{1}, {T}, Remove X ki counters from Quillmane Baku: Return target creature with converted mana cost X or less to its owner's hand.
End
So should I commit?
Secondly, there was never a reply to the last question I posted about Riku of Two Reflections regarding the problems with copied spell targeting. The problem can become quite pronounced with this card because of its two abilities' interactions. Should he be committed anyway?
-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 » 29 Nov 2011, 18:37
I would say it's ok. Maybe in the future we can improve this.moomarc wrote:Is this implementation of Quillmane Baku correct?
Copying spells and permanents is one of the only gameplay features that i'm not involved with (protecting myself from feeling responsible for everything).moomarc wrote:Secondly, there was never a reply to the last question I posted about Riku of Two Reflections regarding the problems with copied spell targeting. The problem can become quite pronounced with this card because of its two abilities' interactions. Should he be committed anyway?

-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by friarsol » 29 Nov 2011, 19:17
A wise decision.Sloth wrote:Copying spells and permanents is one of the only gameplay features that i'm not involved with (protecting myself from feeling responsible for everything).
Marc, what's the exact scenario that this is popping up in? Just give me a way I can reproduce it with the any card scripts I need to add, and I'll try to test it sometime this week. I haven't looked at copy spell stuff, but I did due the Targeting stuff, so I might be able to see what's going on.
- 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 » 29 Nov 2011, 20:00
I can't remember exactly and can't test right now, but I know I first noticed it with casting Flicker with Riku in play. Target any creature then use Riku to copy Flicker targeting another creature. As each resolves use Riku's other ability to copy the creatures that just entered play. Both will resolve as copies of the creature first targeted by Flicker. But if you've worked on the targeting issues over the last few days then maybe its fixed already.friarsol wrote:A wise decision.Sloth wrote:Copying spells and permanents is one of the only gameplay features that i'm not involved with (protecting myself from feeling responsible for everything).
Marc, what's the exact scenario that this is popping up in? Just give me a way I can reproduce it with the any card scripts I need to add, and I'll try to test it sometime this week. I haven't looked at copy spell stuff, but I did due the Targeting stuff, so I might be able to see what's going on.
If not the following scenarios exist with that card combo:
- Both copies of Flicker target creatures you control: you get two tokens that are copies of the creature targeted first.
- first tgt is creature opponent controls, 2nd is your's: you get no tokens
- 1st tgt your creature, then opp creature: you get 2 tokens of your targeted creature (I seem to remember this, but it doesn't make sense because you wouldn't be able to activate Riku's creature copy until after the first one resolved, so I might be wrong)
- both copies tgt opp creatures: nothing special (iirc) because his creature copy never comes into play.

Thanks for looking into it. (Its a mean card with Doubling Season and Flicker)
- Edit: Riku of Two Reflections script | Open
- Code: Select all
Name:Riku of Two Reflections
ManaCost:2 U R G
Types:Legendary Creature Human Wizard
Text:no text
PT:2/2
T:Mode$ SpellCast | ValidCard$ Instant,Sorcery | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigCopySpell | TriggerDescription$ Whenever you cast an instant or sorcery spell, you may pay U R. If you do, copy that spell. You may choose new targets for the copy.
SVar:TrigCopySpell:AB$CopySpell | Cost$ U R | Defined$ TriggeredSpellAbility
T:Mode$ ChangesZone | ValidCard$ Creature.Other+nonToken+YouCtrl | Origin$ Any | Destination$ Battlefield | TriggerZones$ Battlefield | Execute$ TrigCopyCreature | OptionalDecider$ You | TriggerDescription$ Whenever another nontoken creature enters the battlefield under your control, you may pay G U. If you do, put a token that's a copy of that creature onto the battlefield.
SVar:TrigCopyCreature:AB$CopyPermanent | Cost$ G U | Defined$ TriggeredCard
SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/riku_of_two_reflections.jpg
SetInfo:COM|Mythic|http://magiccards.info/scans/en/cmd/220.jpg
Oracle:Whenever you cast an instant or sorcery spell, you may pay {U}{R}. If you do, copy that spell. You may choose new targets for the copy.\nWhenever another nontoken creature enters the battlefield under your control, you may pay {G}{U}. If you do, put a token that's a copy of that creature onto the battlefield.
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 friarsol » 29 Nov 2011, 20:23
No I haven't coded much in Forge at all lately. Been way too busy with work and real-life stuff. I wrote the current version of the Targeting objects, but from what you describe it sounds more like something to do with the copy not grabbing the appropriate SpellAbilityStackInstance (if I had to guess)
- 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 34 guests