Page 13 of 141

Re: Card Development Questions

PostPosted: 30 Jan 2011, 02:44
by Hellfish
Soul Foundry currently needs hardcoding, as AF_Token can't handle copying cards.

Re: Card Development Questions

PostPosted: 30 Jan 2011, 16:30
by jeffwadsworth
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

Re: Card Development Questions

PostPosted: 30 Jan 2011, 17:12
by friarsol
Try removing the space after Count$

Re: Card Development Questions

PostPosted: 30 Jan 2011, 18:01
by Chris H.
Good catch Sol. :D 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.

Re: Card Development Questions

PostPosted: 30 Jan 2011, 20:44
by jeffwadsworth
Thanks Sol. That was it.

Re: Card Development Questions

PostPosted: 31 Jan 2011, 00:39
by jeffwadsworth
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)

Re: Card Development Questions

PostPosted: 31 Jan 2011, 03:16
by slapshot5
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)
Try:
Code: Select all
| ChangeType$ Land | ChangeNum$ 1 |
instead of ValidTgts$ and TgtPrompt$

-slapshot5

Re: Card Development Questions

PostPosted: 31 Jan 2011, 03:23
by jeffwadsworth
Thanks.

Re: Card Development Questions

PostPosted: 31 Jan 2011, 03:39
by slapshot5
jeffwadsworth wrote:Thanks. So much for following the wiki examples.
Yeah. I never know what to use for ChangeZone. I just search for a card with the same Origin$ and Destination$ and copy it.

-slapshot5

Re: Card Development Questions

PostPosted: 31 Jan 2011, 04:59
by friarsol
jeffwadsworth wrote:Thanks. So much for following the wiki examples.
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.

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.
For Hidden, things like ChangeType and ChangeNum are used to restrict what can ChangeZone, and how many do.
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.

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.

Re: Card Development Questions

PostPosted: 31 Jan 2011, 13:35
by lazylockie
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
But when I try to cast it with flashback, it attempts to exile the same creature it exiled first. If the creature isn't on battlefield anymore, it does nothing. I suspect it's related with Defined$ Remembered, but this parameter is necessary to bring back the creature. Any ideas?

Re: Card Development Questions

PostPosted: 31 Jan 2011, 14:02
by Hellfish
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.

Re: Card Development Questions

PostPosted: 31 Jan 2011, 18:09
by jeffwadsworth
@Sol. I was just trolling. The Forge Wiki is invaluable. I will read it more carefully next time.

Re: Card Development Questions

PostPosted: 31 Jan 2011, 18:11
by friarsol
jeffwadsworth wrote:@Sol. I was just trolling. The Forge Wiki is invaluable. I will read it more carefully next time.
Monday mornings are for troll slaying.

Re: Card Development Questions

PostPosted: 31 Jan 2011, 18:34
by jeffwadsworth
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.

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