Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by slapshot5 » 14 May 2011, 22:00
The infrastructure isn't there. We just need to implement "valid" checking for all zones. That would fix this.SoulStorm wrote:Based upon your suggestion Slapshot, I tried the following code, but now no cards can be put into play. Other suggestions, or do you believe the infrastructure necessary isn't in place yet?
- Code: Select all
Name:Protean Hulk
ManaCost:5 G G
Types:Creature Beast
Text:no text
PT:6/6
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigChange | TriggerDescription$ When CARDNAME is put into a graveyard from the battlefield, search you libray for any number of creature cards with total converted mana cost 6 or less and put them onto the battlefield. Then shuffle your library.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Battlefield | ChangeType$ Creature.cmcLE6 | ChangeNum$ XFetch
SVar:XFetch:Count$cmcLE6
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/protean_hulk.jpg
End
-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 SoulStorm » 15 May 2011, 12:22
Here's another one that may be premature, but I thought I'd give it a shot anyway. It crashes when played. I'm sure the x variable is the problem, but I don't know if there's a way to fix it. I also considered trying this card using Animate, but every example targets. Is there a way to make this work, or am I being premature again?
- Code: Select all
Name:Opalescence
ManaCost:2 W W
Types:Enchantment
Text:no text
K:stPumpAll:Enchantment.nonAura:0/0/Types=Creature:No Condition:Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost. It's still an enchantment.
K:stPumpAll:Enchantment.nonAura:x/x:No Condition:Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost. It's still an enchantment.
SVar:X:CardManaCost
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/opalescence.jpg
End
Re: Card Development Questions
by slapshot5 » 15 May 2011, 13:10
Does it crash because you're using lower case "x" in stPumpAll vs upper case "X" in SVar? Can you post the crash?SoulStorm wrote:Here's another one that may be premature, but I thought I'd give it a shot anyway. It crashes when played. I'm sure the x variable is the problem, but I don't know if there's a way to fix it. I also considered trying this card using Animate, but every example targets. Is there a way to make this work, or am I being premature again?
- Code: Select all
Name:Opalescence
ManaCost:2 W W
Types:Enchantment
Text:no text
K:stPumpAll:Enchantment.nonAura:0/0/Types=Creature:No Condition:Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost. It's still an enchantment.
K:stPumpAll:Enchantment.nonAura:x/x:No Condition:Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost. It's still an enchantment.
SVar:X:CardManaCost
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/opalescence.jpg
End
We don't have an elegant way to do static animates right now, like Living Lands too, but this doesn't seem wholly unreasonable...
-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 SoulStorm » 15 May 2011, 13:20
Whoops, I'll try it with an uppercase X.
Also, while playing around with Followed Footsteps, I discovered that if I played it on an AI controlled creature, the token came into play under the AI's control. I know AB$Token has TokenOwner$, will that work with CopyPermanent, or does it need to be implemented?
Also, while playing around with Followed Footsteps, I discovered that if I played it on an AI controlled creature, the token came into play under the AI's control. I know AB$Token has TokenOwner$, will that work with CopyPermanent, or does it need to be implemented?
Re: Card Development Questions
by SoulStorm » 15 May 2011, 13:28
Tested Opalescence with upper case fix, here's the error report:
Also tested Followed Footsteps with TokenOwner$ You, but it doesn't work. Didn't think it would, but gave it a shot anyway.
Detailed error trace:
java.lang.ArrayIndexOutOfBoundsException: 1
at forge.GameActionUtil$5.execute(GameActionUtil.java:5776)
at forge.GameAction.checkStateEffects(GameAction.java:507)
at forge.MagicStack.resolveStack(MagicStack.java:798)
at forge.Phase.passPriority(Phase.java:537)
at forge.ComputerAI_General.stackResponse(ComputerAI_General.java:346)
at forge.ComputerAI_General.stack_not_empty(ComputerAI_General.java:285)
at forge.gui.input.InputControl.updateInput(InputControl.java:151)
at forge.GuiInput.update(GuiInput.java:21)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.MyObservable.updateObservers(MyObservable.java:9)
at forge.gui.input.InputControl.resetInput(InputControl.java:58)
at forge.Phase.passPriority(Phase.java:527)
at forge.gui.input.Input_PassPriority.selectButtonOK(Input_PassPriority.java:42)
at forge.GuiInput.selectButtonOK(GuiInput.java:37)
at forge.GuiDisplay4.okButtonActionPerformed(GuiDisplay4.java:954)
at forge.GuiDisplay4.access$3(GuiDisplay4.java:953)
at forge.GuiDisplay4$25.actionPerformed(GuiDisplay4.java:741)
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 org.jvnet.substance.utils.RolloverButtonListener.mouseReleased(RolloverButtonListener.java:111)
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)
Also tested Followed Footsteps with TokenOwner$ You, but it doesn't work. Didn't think it would, but gave it a shot anyway.
Detailed error trace:
java.lang.ArrayIndexOutOfBoundsException: 1
at forge.GameActionUtil$5.execute(GameActionUtil.java:5776)
at forge.GameAction.checkStateEffects(GameAction.java:507)
at forge.MagicStack.resolveStack(MagicStack.java:798)
at forge.Phase.passPriority(Phase.java:537)
at forge.ComputerAI_General.stackResponse(ComputerAI_General.java:346)
at forge.ComputerAI_General.stack_not_empty(ComputerAI_General.java:285)
at forge.gui.input.InputControl.updateInput(InputControl.java:151)
at forge.GuiInput.update(GuiInput.java:21)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.MyObservable.updateObservers(MyObservable.java:9)
at forge.gui.input.InputControl.resetInput(InputControl.java:58)
at forge.Phase.passPriority(Phase.java:527)
at forge.gui.input.Input_PassPriority.selectButtonOK(Input_PassPriority.java:42)
at forge.GuiInput.selectButtonOK(GuiInput.java:37)
at forge.GuiDisplay4.okButtonActionPerformed(GuiDisplay4.java:954)
at forge.GuiDisplay4.access$3(GuiDisplay4.java:953)
at forge.GuiDisplay4$25.actionPerformed(GuiDisplay4.java:741)
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 org.jvnet.substance.utils.RolloverButtonListener.mouseReleased(RolloverButtonListener.java:111)
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
by slapshot5 » 15 May 2011, 13:49
Well, that exception is because SVar needs to have SVar:X:Count$CardManaCostSoulStorm wrote:Tested Opalescence upper case fix, here's the error report:
Also tested Followed Footsteps with TokenOwner$ You, but it doesn't work. Didn't think it would, but gave it a shot anyway.
Detailed error trace:
java.lang.ArrayIndexOutOfBoundsException: 1
at forge.GameActionUtil$5.execute(GameActionUtil.java:5776)
at forge.GameAction.checkStateEffects(GameAction.java:507)
at forge.MagicStack.resolveStack(MagicStack.java:798)
at forge.Phase.passPriority(Phase.java:537)
<snip />
at java.awt.EventDispatchThread.run(Unknown Source)
But I ran into this problem yesterday with Phyrexian Ingester. stPump will use the Opalescence CMC in this case, not the CMC of the pumped card.
This may not be too far away from being correct though. Let me look into it a bit.
- 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 slapshot5 » 15 May 2011, 13:57
Here's what I just used:
-slapshot5
- Code: Select all
Name:Opalescence
ManaCost:2 W W
Types:Enchantment
Text:no text
K:stPumpAll:Enchantment.nonAura+Other:0/0/Types=Creature:No Condition:Each other non-Aura enchantment is a creature with power and toughness each equal to its converted mana cost. It's still an enchantment.
K:stPumpAll:Enchantment.nonAura+Other:X/X:No Condition:no text
SVar:X:Count$CardManaCost
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/opalescence.jpg
End
-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 SoulStorm » 15 May 2011, 14:57
Looks great! I actually missed the "Other" variable until I noticed that you added it.
Re: Card Development Questions
by slapshot5 » 15 May 2011, 15:03
And I should be able to get that all on one line. Just need to change the order of stuff in code probably.
Now, let me see if I can get the correct P/T in there...
-slapshot5
Now, let me see if I can get the correct P/T in there...
-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 SoulStorm » 15 May 2011, 15:42
That would be awesome! If you can get the P/T correct, we should be able to add March of the Machines as well.
Re: Card Development Questions
by slapshot5 » 15 May 2011, 15:50
Well, the is going to take more work than I feared. This needs to be a stSetPT instead of a stPump keyword. Just look what happens if you have 2 Opalescences in play.
-slapshot5
-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 Sloth » 15 May 2011, 15:51
Note that euipment that becomes a creature will fall off.SoulStorm wrote:That would be awesome! If you can get the P/T correct, we should be able to add March of the Machines as well.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by SoulStorm » 15 May 2011, 15:57
Duh, I didn't think of what would happen with 2 Opalescence in play either. Well, that's why you guys get paid the big bucks. 

Who is online
Users browsing this forum: No registered users and 38 guests