Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by moomarc » 13 Nov 2012, 12:40
I'm trying to convert Sarpadian Empires, Vol. VII to script and it's working perfectly. Just a few quick questions. I had to use the generic text field to add the ability text because otherwise it wouldn't show until after the card is on the battlefield. This switches the order of the two text pieces in the card panel. Does this bother anyone particularly (could make it more Oracle-compliant if we had a way to force linebreaks in a SpellDescription - maybe something similar to how CARDNAME is replaced).
The other minor issue is that the AI picks white Citizen by default, although I don't think its really an issue seeing as the hardcoded SEVol7 made the AI choose Thrull without any further checks.
Anything I haven't thought of?

The other minor issue is that the AI picks white Citizen by default, although I don't think its really an issue seeing as the hardcoded SEVol7 made the AI choose Thrull without any further checks.
Anything I haven't thought of?
- Sarpadian Empires, Vol. VII | Open
- Code: Select all
Name:Sarpadian Empires, Vol. VII
ManaCost:3
Types:Artifact
Text:3, Tap: Put a 1/1 creature token of the chosen color and type onto the battlefield.
SVar:Rarity:Rare
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseToken | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.
SVar:ChooseToken:AB$ GenericChoice | Cost$ 0 | Choices$ Citizen,Camarid,Thrull,Goblin,Saproling | Defined$ You
SVar:Citizen:DB$ Animate | Defined$ Self | Abilities$ WToken | Permanent$ True | ChoiceDescription$ White Citizen
SVar:Camarid:DB$ Animate | Defined$ Self | Abilities$ UToken | Permanent$ True | ChoiceDescription$ Blue Camarid
SVar:Thrull:DB$ Animate | Defined$ Self | Abilities$ BToken | Permanent$ True | ChoiceDescription$ Black Thrull
SVar:Goblin:DB$ Animate | Defined$ Self | Abilities$ RToken | Permanent$ True | ChoiceDescription$ Red Goblin
SVar:Saproling:DB$ Animate | Defined$ Self | Abilities$ GToken | Permanent$ True | ChoiceDescription$ Green Saproling
SVar:WToken:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Citizen | TokenTypes$ Creature,Citizen | TokenOwner$ You | TokenColors$ White | TokenPower$ 1 | TokenToughness$ 1
SVar:UToken:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Camarid | TokenTypes$ Creature,Camarid | TokenOwner$ You | TokenColors$ Blue | TokenPower$ 1 | TokenToughness$ 1
SVar:BToken:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Thrull | TokenTypes$ Creature,Thrull | TokenOwner$ You | TokenColors$ Black | TokenPower$ 1 | TokenToughness$ 1
SVar:GToken:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Goblin | TokenTypes$ Creature,Goblin | TokenOwner$ You | TokenColors$ Red | TokenPower$ 1 | TokenToughness$ 1
SVar:RToken:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1
SVar:Picture:http://www.wizards.com/global/images/magic/general/sarpadian_empires_vol_vii.jpg
SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/263.jpg
Oracle:As Sarpadian Empires, Vol. VII enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.\n{3}, {T}: Put a 1/1 creature token of the chosen color and type 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 Sloth » 13 Nov 2012, 20:07
The only problem i see with Sarpadian Empires, Vol. VII is when it somehow gets another ability (for example if you make it creature with March of the Machines and then cast Shoving Match), the token ability will have no description to choose from. But this is reeaally minor. So i would say commit.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by moomarc » 15 Nov 2012, 20:19
Status update on Sarpadian Empires, Vol. VII: I've tried setting it up with a token ability for each color with an activation restriction based on the chosen color. Unfortunately I can't get the restriction working and can't seem to work out what I did wrong.
- Current script | Open
- Name:Sarpadian Empires, Vol. VII
ManaCost:3
Types:Artifact
Text:no text
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseColor | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | AILogic$ MostProminentInGame
# Went for MostProminenInGame logic to give the AI a possible out for situations where it might be locked down based on its colors
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Citizen | TokenTypes$ Creature,Citizen | TokenOwner$ You | TokenColors$ white | TokenPower$ 1 | TokenToughness$ 1 | ActivationChosenColor$ white | SpellDescription$ Put a 1/1 creature token of the chosen color and type onto the battlefield.
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Camarid | TokenTypes$ Creature,Camarid | TokenOwner$ You | TokenColors$ blue | TokenPower$ 1 | TokenToughness$ 1 | ActivationChosenColor$ blue
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Thrull | TokenTypes$ Creature,Thrull | TokenOwner$ You | TokenColors$ black | TokenPower$ 1 | TokenToughness$ 1 | ActivationChosenColor$ black
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Goblin | TokenTypes$ Creature,Goblin | TokenOwner$ You | TokenColors$ red | TokenPower$ 1 | TokenToughness$ 1 | ActivationChosenColor$ red
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenColors$ green | TokenPower$ 1 | TokenToughness$ 1 | ActivationChosenColor$ green
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sarpadian_empires_vol_vii.jpg
SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/263.jpg
Oracle:As Sarpadian Empires, Vol. VII enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.\n{3},: Put a 1/1 creature token of the chosen color and type onto the battlefield.
End
- the various bits for SpellAbilityVariables | Open
- Code: Select all
this.chosenColors = sav.getColorToCheck();
- Code: Select all
/** The chosen colors string. */
private String chosenColors = "";
- Code: Select all
/**
* <p>
* Setter for the field <code>ColorToCheck</code>.
* </p>
*
* @param s
* a {@link java.lang.String} object.
*/
public final void setColorToCheck(final String s) {
this.chosenColors = s;
}
/**
* <p>
* Getter for the field <code>ColorToCheck</code>.
* </p>
*
* @return a {@link java.lang.String} object.
*/
public final String getColorToCheck() {
return this.chosenColors;
}
- Bits from SpellAbilityRestriction | Open
- In setRestrictions():
- Code: Select all
if (params.containsKey("ActivationColorChosen")) {
this.setColorToCheck(params.get("ActivationColorChosen"));
}
- Code: Select all
if (this.getColorToCheck() != "") {
if (!sa.getSourceCard().getChosenColor().contains(this.getColorToCheck())) {
return false;
}
}
-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 » 22 Nov 2012, 16:13
Does Conditionals not work on Triggered Abilities? Maybe I'm just using the wrong Conditional, but I thought it was right.
Anyway, I was trying to convert Erg Raiders and it seems to be dealing damage to me the first turn I control it. Here's the conversion if someone wants to fiddle with it some more.
Anyway, I was trying to convert Erg Raiders and it seems to be dealing damage to me the first turn I control it. Here's the conversion if someone wants to fiddle with it some more.
- Erg Raiders | Open
- T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDamage | IsPresent$ Creature.Self+notAttackedThisTurn | TriggerDescription$ At the beginning of your end step, if CARDNAME didn't attack this turn, CARDNAME deals 2 damage to you unless it came under your control this turn.
SVar:TrigDamage:AB$ DealDamage | Cost$ 0 | Defined$ You | NumDmg$ 2 | ConditionSVar$ ErgAttacked | ConditionSVarCompare$ EQ1
SVar:ErgAttacked:Valid Creature.Self+notFirstTurnControlled
- 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 » 22 Nov 2012, 22:00
I think it's "ConditionCheckSVar" instead of "ConditionSVar".friarsol wrote:Does Conditionals not work on Triggered Abilities? Maybe I'm just using the wrong Conditional, but I thought it was right.
Anyway, I was trying to convert Erg Raiders and it seems to be dealing damage to me the first turn I control it. Here's the conversion if someone wants to fiddle with it some more.
- Erg Raiders | Open
- T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDamage | IsPresent$ Creature.Self+notAttackedThisTurn | TriggerDescription$ At the beginning of your end step, if CARDNAME didn't attack this turn, CARDNAME deals 2 damage to you unless it came under your control this turn.
SVar:TrigDamage:AB$ DealDamage | Cost$ 0 | Defined$ You | NumDmg$ 2 | ConditionSVar$ ErgAttacked | ConditionSVarCompare$ EQ1
SVar:ErgAttacked:Valid Creature.Self+notFirstTurnControlled
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by ArsenalNut » 28 Nov 2012, 04:32
I tried to script Cut the Tethers but it doesn't really work.
I don't think anythings wrong with the script but the UI didn't seem handle the human player correctly. It seemed to work for the AI though.
Here's the two test decks I used
To test, I waited until both players had several spirits in play then cast Cut the Tethers.
- Cut the Tethers | Open
- Name:Cut the Tethers
ManaCost:2 U U
Types:Sorcery
Text:no text
A:SP$ RepeatEach | Cost$ 2 U U | RepeatSubAbility$ DBReturn | RepeatCards$ Creature.Spirit | SpellDescription$ For each Spirit, return it to its owner's hand unless that player pays 3.
SVar:DBReturn:DB$ ChangeZone | Origin$ Battlefield | Destination$ Hand | Defined$ Remembered | UnlessCost$ 3 | UnlessPayer$ RememberedController
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/cut_the_tethers.jpg
End
I don't think anythings wrong with the script but the UI didn't seem handle the human player correctly. It seemed to work for the AI though.
Here's the two test decks I used
- ai spirit test deck | Open
- [metadata]
Name=ai spirit
[main]
1 Emissary of Hope|DST
1 Geist of Saint Traft|ISD
1 Lingering Souls|DKA
4 Scrubland|LEA
4 Tundra|LEA
[sideboard]
- test cut tethers deck | Open
- [metadata]
Name=test cut tethers
[main]
1 Cut the Tethers
1 Emissary of Hope|DST
1 Gloom Surgeon|AVR
1 Lingering Souls|DKA
1 Niblis of the Breath|DKA
4 Scrubland|LEA
4 Tundra|LEA
[sideboard]
To test, I waited until both players had several spirits in play then cast Cut the Tethers.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Card Development Questions
by friarsol » 28 Nov 2012, 13:12
Yea I had some problems when trying to script Fade Away in a similar manner. It seems like the spell was finishing resolving instead of waiting for the repeat to be handled, which caused issues with things. I'm not sure if there's anything we can do about that right now.ArsenalNut wrote:I tried to script Cut the Tethers but it doesn't really work.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Corwin72 » 28 Nov 2012, 21:41
So am I the only one running into the issue where player and AI lands are put into the graveyard at end of turn. This happens on both builds 2 days ago and yesterday.
-
Corwin72 - Posts: 793
- Joined: 15 Sep 2009, 13:26
- Location: Grayson, Ga
- Has thanked: 25 times
- Been thanked: 9 times
Re: Card Development Questions
by RumbleBBU » 30 Nov 2012, 10:48
It seems that Goblin Welder is not currently included in Forge?
I saw a Goblin Welder card contribution in a thread, but since it apparently hasn't been added, I take it that there are issues why it wouldn't work properly?
...yeah, I'm a cheeseball, but currently (thanks to Agetian's great contributions like the Circles of Protection and Drain Life), it's the unimplemented card I'm most interested in.
EDIT - this is where I saw a Goblin Welder contribution:
viewtopic.php?f=26&t=2091&p=48387&hilit=goblin+welder#p48387
I saw a Goblin Welder card contribution in a thread, but since it apparently hasn't been added, I take it that there are issues why it wouldn't work properly?
...yeah, I'm a cheeseball, but currently (thanks to Agetian's great contributions like the Circles of Protection and Drain Life), it's the unimplemented card I'm most interested in.

EDIT - this is where I saw a Goblin Welder contribution:
viewtopic.php?f=26&t=2091&p=48387&hilit=goblin+welder#p48387
Re: Card Development Questions
by friarsol » 30 Nov 2012, 13:24
That card isn't scripted correctly at all. Firstly, Welder doesn't sacrifice as a cost. Secondly, this Welder needs to target both artifacts, and also restrict one of the targeting to have the same owner as the first target controls (complex interaction). Next, both artifacts need to be be valid targets when the spell resolves, we don't really have a way of doing that either. Soooo... it's a very complex card with a bunch of restrictions that I don't think we can handle at this time.RumbleBBU wrote:EDIT - this is where I saw a Goblin Welder contribution:
viewtopic.php?f=26&t=2091&p=48387&hilit=goblin+welder#p48387
- 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 » 03 Dec 2012, 04:30
Anyone know why the s in Animate Params for staticAbilities and sVars are lower case? Especially since Effect has a capital S for StaticAbilities, it's definitely confusing (and I think I see at least one script that is incorrect due to this).
- 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 » 03 Dec 2012, 04:51
Alright, here's an Earthbind script that works for everything except for the fact that the ChangeZone trigger happens too early.
Basically what happens is:
1. Aura ETB
2. Trigger goes off and (incorrectly) checks its condition, which fails and doesn't go on the stack.
3. Aura attaches and finishes resolving.
4. Stack is empty.
What should happen is:
1. Aura ETB
2. Trigger goes off, but condition isn't checked yet because something is still resolving
3. Aura attaches and finishes resolving.
4. Trigger checks it's condition and goes on the stack.
5. Stack has the trigger on the stack.
If anyone can help me out that's familiar with Trigger stuff, it'd be appreciated. I'm almost curious if a second trigger fires due to the Aura ETB, if things would work properly.
Edit: This may also fix the reported issues with Valakut.
- Earthbind | Open
- A:SP$ Attach | Cost$ R | ValidTgts$ Creature | AILogic$ Curse | AITgts$ Creature.withFlying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | IsPresent$ Card.EnchantedBy+withFlying | PresentCompare$ EQ1 | Execute$ TrigDealDamage | TriggerDescription$ When CARDNAME enters the battlefield, if enchanted creature has flying, CARDNAME deals 2 damage to that creature and CARDNAME gains "Enchanted creature loses flying."
SVar:TrigDealDamage:AB$DealDamage | Cost$ 0 | Defined$ Valid Card.EnchantedBy | NumDmg$ 2 | SubAbility$ DBLoseFlying
SVar:DBLoseFlying:DB$ Animate | Defined$ Self | staticAbilities$ LoseFlyingStatic | Permanent$ True
SVar:LoseFlyingStatic:Mode$ Continuous | Affected$ Card.EnchantedBy | RemoveKeyword$ Flying | Description$ Enchanted creature loses flying.
Basically what happens is:
1. Aura ETB
2. Trigger goes off and (incorrectly) checks its condition, which fails and doesn't go on the stack.
3. Aura attaches and finishes resolving.
4. Stack is empty.
What should happen is:
1. Aura ETB
2. Trigger goes off, but condition isn't checked yet because something is still resolving
3. Aura attaches and finishes resolving.
4. Trigger checks it's condition and goes on the stack.
5. Stack has the trigger on the stack.
If anyone can help me out that's familiar with Trigger stuff, it'd be appreciated. I'm almost curious if a second trigger fires due to the Aura ETB, if things would work properly.
Edit: This may also fix the reported issues with Valakut.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by swordshine » 04 Dec 2012, 04:27
I tried to script Junk Golem, but the “UnlessCost$ SubCounter<1/P1P1>” did not work for human(it worked perfectly for AI)
- Junk Golem | Open
- Code: Select all
Name:Junk Golem
ManaCost:4
Types:Artifact Creature Golem
Text:no text
PT:0/0
K:etbCounter:P1P1:3
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerDescription$ At the beginning of your upkeep, sacrifice CARDNAME unless you remove a +1/+1 counter from it.
SVar:TrigSac:AB$ Sacrifice | Cost$ 0 | Defined$ Self | UnlessCost$ SubCounter<1/P1P1> | UnlessPayer$ You
A:AB$ PutCounter | Cost$ 1 Discard<1/Card> | CounterType$ P1P1 | CounterNum$ 1 | SpellDescription$ Put a +1/+1 counter on CARDNAME.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/junk_golem.jpg
End
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Card Development Questions
by friarsol » 07 Dec 2012, 04:17
Alright, I'll take a look at this since, I'm feeling proactive after solving the Animate Dead puzzle. I have something in right now that I think might do the trick. I need to do some smoke testing with other triggers to make sure it looks like it didn't break anything major. But it definitely lets Earthbind trigger properly.friarsol wrote:If anyone can help me out that's familiar with Trigger stuff, it'd be appreciated. I'm almost curious if a second trigger fires due to the Aura ETB, if things would work properly.
Edit: This may also fix the reported issues with Valakut.
Edit: Looks like it fixed Valakut triggers too, although seemed to break Venser. I'll have to figure out when delay triggers happen, and try to move it around a bit. Hopefully I'll be able to test it out this weekend.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by RumbleBBU » 11 Dec 2012, 07:32
Don't know which thread is the proper place for this, so I'm sticking it here...
What should happen if a player taps Fellwar Stone and the opponent has no lands in play?
Get
?
Get
?
Currently you get...
And that is obviously not the correct or expected game behavior.
I found this out when I was testing my deck against a newly-designed AI deck that uses almost entirely non-land mana base (creatures, artifacts) and regularly wrecks the opponent's mana base with Armageddon and the like.
The above happened once when the AI wanted to tap a Fellwar Stone for mana right after an Armageddon. It's also happened when the AI went first and got out a handful of mana artifacts out on its first turn (before I had one) and tried to tap a Fellwar Stone.
What should happen if a player taps Fellwar Stone and the opponent has no lands in play?
Get

Get

Currently you get...
- | Open
- a crash
And that is obviously not the correct or expected game behavior.

I found this out when I was testing my deck against a newly-designed AI deck that uses almost entirely non-land mana base (creatures, artifacts) and regularly wrecks the opponent's mana base with Armageddon and the like.
The above happened once when the AI wanted to tap a Fellwar Stone for mana right after an Armageddon. It's also happened when the AI went first and got out a handful of mana artifacts out on its first turn (before I had one) and tried to tap a Fellwar Stone.
Who is online
Users browsing this forum: No registered users and 35 guests