Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by Hellfish » 30 Jan 2011, 02:44
Soul Foundry currently needs hardcoding, as AF_Token can't handle copying cards.
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 » 30 Jan 2011, 16:30
The ability of this test card will not work at all. Any ideas? Agadeem Occultist.
- Code: Select all
Name:Agadeem Occultist
ManaCost:2 B
Types:Creature Human Shaman Ally
Text:no text
PT:0/2
A:AB$ChangeZone | Cost$ T | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True | TgtPrompt$ Choose target creature card in your opponent's graveyard | ValidTgts$ Creature.YouDontCtrl+cmcLEX | ChangeNum$ 1 | SpellDescription$ Put target creature card from an opponent's graveyard onto the battlefield under your control if its converted mana cost is less than or equal to the number of Allies you control.
SVar:X:Count$ Valid Ally.YouCtrl
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/agadeem_occultist.jpg
End
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Chris H. » 30 Jan 2011, 18:01
Good catch Sol.
Unfortunately, the code for many of the keywords and SVars do not trim off the leading and trailing spaces.
A couple of years ago we noticed that some text editors have a "smart feature" which can add a space prior to the text that we paste in. Some of the keywords that we were adding after the ":" in the pump keyword would end up with a space between the ":" and the keyword.

A couple of years ago we noticed that some text editors have a "smart feature" which can add a space prior to the text that we paste in. Some of the keywords that we were adding after the ":" in the pump keyword would end up with a space between the ":" and the keyword.
-
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
- 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 jeffwadsworth » 31 Jan 2011, 00:39
This test card produces the error below after displaying a list of lands in your hand.
- Code: Select all
Name:Walking Atlas
ManaCost:2
Types:Creature Construct
Text:no text
PT:1/1
A:AB$ChangeZone | Cost$ T | Origin$ Hand | Destination$ Battlefield | ValidTgts$ Land.YouCtrl | TgtPrompt$ Select a target land from your hand. | Optional$ True | SpellDescription$ You may put a land card from your hand onto the battlefield.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/Walking_Atlas.jpg
End
- Code: Select all
Detailed error trace:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeHiddenOriginResolveHuman(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeHiddenOriginResolve(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeZoneResolve(Unknown Source)
at forge.AbilityFactory_ChangeZone.access$1(Unknown Source)
at forge.AbilityFactory_ChangeZone$1.resolve(Unknown Source)
at forge.MagicStack.resolveStack(Unknown Source)
at forge.Phase.passPriority(Unknown Source)
at forge.ComputerAI_General.stackResponse(Unknown Source)
at forge.ComputerAI_General.stack_not_empty(Unknown Source)
at forge.InputControl.updateInput(Unknown Source)
at forge.GuiInput.update(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.MyObservable.updateObservers(Unknown Source)
at forge.InputControl.resetInput(Unknown Source)
at forge.Phase.passPriority(Unknown Source)
at forge.Input_PassPriority.selectButtonOK(Unknown Source)
at forge.GuiInput.selectButtonOK(Unknown Source)
at forge.GuiDisplay4.okButtonActionPerformed(Unknown Source)
at forge.GuiDisplay4.access$3(Unknown Source)
at forge.GuiDisplay4$25.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
- 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 slapshot5 » 31 Jan 2011, 03:16
Try:jeffwadsworth wrote:This test card produces the error below after displaying a list of lands in your hand.
- Code: Select all
Name:Walking Atlas
ManaCost:2
Types:Creature Construct
Text:no text
PT:1/1
A:AB$ChangeZone | Cost$ T | Origin$ Hand | Destination$ Battlefield | ValidTgts$ Land.YouCtrl | TgtPrompt$ Select a target land from your hand. | Optional$ True | SpellDescription$ You may put a land card from your hand onto the battlefield.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/Walking_Atlas.jpg
End
- Code: Select all
Detailed error trace:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeHiddenOriginResolveHuman(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeHiddenOriginResolve(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeZoneResolve(Unknown Source)
at forge.AbilityFactory_ChangeZone.access$1(Unknown Source)
at forge.AbilityFactory_ChangeZone$1.resolve(Unknown Source)
at forge.MagicStack.resolveStack(Unknown Source)
at forge.Phase.passPriority(Unknown Source)
at forge.ComputerAI_General.stackResponse(Unknown Source)
at forge.ComputerAI_General.stack_not_empty(Unknown Source)
at forge.InputControl.updateInput(Unknown Source)
at forge.GuiInput.update(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.MyObservable.updateObservers(Unknown Source)
at forge.InputControl.resetInput(Unknown Source)
at forge.Phase.passPriority(Unknown Source)
at forge.Input_PassPriority.selectButtonOK(Unknown Source)
at forge.GuiInput.selectButtonOK(Unknown Source)
at forge.GuiDisplay4.okButtonActionPerformed(Unknown Source)
at forge.GuiDisplay4.access$3(Unknown Source)
at forge.GuiDisplay4$25.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
- Code: Select all
| ChangeType$ Land | ChangeNum$ 1 |
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Development Questions
by jeffwadsworth » 31 Jan 2011, 03:23
Thanks.
Last edited by jeffwadsworth on 31 Jan 2011, 14:36, 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: Card Development Questions
by slapshot5 » 31 Jan 2011, 03:39
Yeah. I never know what to use for ChangeZone. I just search for a card with the same Origin$ and Destination$ and copy it.jeffwadsworth wrote:Thanks. So much for following the wiki examples.
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Development Questions
by friarsol » 31 Jan 2011, 04:59
Just some clarification since I've done the most work on the wiki, and I'd like to make the docs as useful as possible. I understand the wiki isn't perfect and definitely can be fleshed out more.jeffwadsworth wrote:Thanks. So much for following the wiki examples.
However in this case:
The first is hidden, generally used for Origin zones that are not known information, like the Library or the Hand. The choice of "What card is changing zones?" happens during resolution.
ChangeZone (Hidden)
A:SP$ChangeZone | Cost$ W | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Artifact,Enchantment | ChangeNum$ 1 | SpellDescription$ Search your library for an artifact or enchantment card and reveal that card. Shuffle your library, then put the card on top of it.
Similarly, you will only use Targeting in AFs when the thing you want to target is in a known zone. Mostly the Battlfield, but also the Graveyard and rarely Exile.For Hidden, things like ChangeType and ChangeNum are used to restrict what can ChangeZone, and how many do.
I'm glad that you are looking through the Wiki and the examples. I've added an example with Origin$ Hand to hopefully be a bit more clear.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by lazylockie » 31 Jan 2011, 13:35
I've managed to code Ruin Ghost, then I thought Momentary Blink was the same:
- Code: Select all
Name:Momentary Blink
ManaCost:1 W
Types:Instant
Text:no text
K:Flashback:3 U
A:SP$ChangeZone | Cost$ 1 W | TargetMin$ 1 | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | RememberTargets$ True | ForgetOtherTargets$ True | Origin$ Battlefield | Destination$ Exile | SubAbility$ SVar=DBReturn | SpellDescription$ Exile target creature you control, then return it to the battlefield under your control.
SVar:DBReturn:DB$ChangeZone | Cost$ 0 | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/ruin_ghost.jpg
SVar:Rarity:Uncommon
SetInfo:WWK|Uncmmon|http://magiccards.info/scans/en/wwk/19.jpg
End
- lazylockie
- Posts: 508
- Joined: 13 Jul 2010, 22:44
- Has thanked: 74 times
- Been thanked: 15 times
Re: Card Development Questions
by Hellfish » 31 Jan 2011, 14:02
Hmm, you could try adding the ForgetOtherTargets parameter to the drawback. But technically, I guess it should forget on it's own when it goes to the graveyard.
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 » 31 Jan 2011, 18:09
@Sol. I was just trolling. The Forge Wiki is invaluable. I will read it more carefully next time.
- 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 » 31 Jan 2011, 18:11
Monday mornings are for troll slaying.jeffwadsworth wrote:@Sol. I was just trolling. The Forge Wiki is invaluable. I will read it more carefully next time.
- 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 » 31 Jan 2011, 18:34
I am testing Deathforge Shaman and can not get it to double the damage using either Count$TimesKicked/Twice or Count$TimesKicked/Times.2
I checked every card and do not see any other options.
I checked every card and do not see any other options.
- Code: Select all
Name:Deathforge Shaman
ManaCost:4 R
Types:Creature Ogre Shaman
Text:no text
PT:4/3
K:Multikicker R
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDamage | TriggerDescription$ When CARDNAME enters the battlefield, it deals damage to target player equal to twice the number of times it was kicked.
SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Tgt$ TgtP | NumDmg$ X
SVar:X:Count$TimesKicked/Twice
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/Deathforge_Shaman.jpg
End
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Who is online
Users browsing this forum: No registered users and 27 guests