It is currently 14 Sep 2025, 22:15
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Card Development Questions

Postby jeffwadsworth » 21 Jun 2011, 00:14

Script for Unstoppable Ash

| Open
Name:Unstoppable Ash
ManaCost:3 G
Types:Creature Treefolk Warrior
Text:no text
PT:5/5
K:Trample
K:Champion:Treefolk,Warrior:Treefolk or Warrior
T:Mode$ AttackerBlocked | ValidCard$ Creature.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Whenever a creature you control becomes blocked, it gets +0/+5 until end of turn.
SVar:TrigPump:AB$Pump | Cost$ 0 | Defined$ TriggeredAttacker | NumDef$ +5
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/unstoppable_ash.jpg
End


Error when the block occurs

| Open
Version:
Forge -- official beta: $Date: 2011-01-06 10:34:48 -0600 (Thu, 06 Jan 2011) $, SVN revision: $Revision: 4891 $

OS: Windows 7 Version: 6.1 Architecture: amd64

Java Version: 1.6.0_22 Vendor: Sun Microsystems Inc.

Detailed error trace:
java.lang.NullPointerException
at forge.card.abilityFactory.AbilityFactory.getDefinedCards(AbilityFactory.java:1047)
at forge.CombatUtil.predictPowerBonusOfBlocker(CombatUtil.java:921)
at forge.CombatUtil.canDestroyBlocker(CombatUtil.java:1177)
at forge.ComputerUtil_Block2.getSafeBlockers(ComputerUtil_Block2.java:35)
at forge.ComputerUtil_Block2.makeGoodBlocks(ComputerUtil_Block2.java:106)
at forge.ComputerUtil_Block2.getBlockers(ComputerUtil_Block2.java:402)
at forge.ComputerAI_General.declare_blockers(ComputerAI_General.java:284)
at forge.gui.input.InputControl.updateInput(InputControl.java:116)
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:517)
at forge.gui.input.Input_PassPriority.selectButtonOK(Input_PassPriority.java:42)
at forge.GuiInput.selectButtonOK(GuiInput.java:37)
at forge.GuiDisplay4.okButtonActionPerformed(GuiDisplay4.java:977)
at forge.GuiDisplay4.access$3(GuiDisplay4.java:976)
at forge.GuiDisplay4$28.actionPerformed(GuiDisplay4.java:764)
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

Postby Sloth » 21 Jun 2011, 08:35

jeffwadsworth wrote:Script for Unstoppable Ash

| Open
Name:Unstoppable Ash
ManaCost:3 G
Types:Creature Treefolk Warrior
Text:no text
PT:5/5
K:Trample
K:Champion:Treefolk,Warrior:Treefolk or Warrior
T:Mode$ AttackerBlocked | ValidCard$ Creature.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Whenever a creature you control becomes blocked, it gets +0/+5 until end of turn.
SVar:TrigPump:AB$Pump | Cost$ 0 | Defined$ TriggeredAttacker | NumDef$ +5
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/unstoppable_ash.jpg
End


Error when the block occurs

| Open
Version:
Forge -- official beta: $Date: 2011-01-06 10:34:48 -0600 (Thu, 06 Jan 2011) $, SVN revision: $Revision: 4891 $

OS: Windows 7 Version: 6.1 Architecture: amd64

Java Version: 1.6.0_22 Vendor: Sun Microsystems Inc.

Detailed error trace:
java.lang.NullPointerException
at forge.card.abilityFactory.AbilityFactory.getDefinedCards(AbilityFactory.java:1047)
at forge.CombatUtil.predictPowerBonusOfBlocker(CombatUtil.java:921)
at forge.CombatUtil.canDestroyBlocker(CombatUtil.java:1177)
at forge.ComputerUtil_Block2.getSafeBlockers(ComputerUtil_Block2.java:35)
at forge.ComputerUtil_Block2.makeGoodBlocks(ComputerUtil_Block2.java:106)
at forge.ComputerUtil_Block2.getBlockers(ComputerUtil_Block2.java:402)
at forge.ComputerAI_General.declare_blockers(ComputerAI_General.java:284)
at forge.gui.input.InputControl.updateInput(InputControl.java:116)
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:517)
at forge.gui.input.Input_PassPriority.selectButtonOK(Input_PassPriority.java:42)
at forge.GuiInput.selectButtonOK(GuiInput.java:37)
at forge.GuiDisplay4.okButtonActionPerformed(GuiDisplay4.java:977)
at forge.GuiDisplay4.access$3(GuiDisplay4.java:976)
at forge.GuiDisplay4$28.actionPerformed(GuiDisplay4.java:764)
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)
I will fix this up. The Script is ok.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby Sloth » 21 Jun 2011, 11:21

OK Jeff. Now your card should be ok.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby jeffwadsworth » 21 Jun 2011, 15:38

Sloth wrote:OK Jeff. Now your card should be ok.
Hmm, I still get this error when after declare attackers step:

| Open
null


Version:
Forge -- official beta: $Date: 2011-01-06 10:34:48 -0600 (Thu, 06 Jan 2011) $, SVN revision: $Revision: 4891 $

OS: Windows 7 Version: 6.1 Architecture: x86

Java Version: 1.6.0_24 Vendor: Sun Microsystems Inc.

Detailed error trace:
java.lang.NullPointerException
at forge.card.abilityFactory.AbilityFactory.getDefinedCards(AbilityFactory.java:1047)
at forge.CombatUtil.predictPowerBonusOfBlocker(CombatUtil.java:925)
at forge.CombatUtil.canDestroyBlocker(CombatUtil.java:1203)
at forge.ComputerUtil_Block2.getSafeBlockers(ComputerUtil_Block2.java:35)
at forge.ComputerUtil_Block2.makeGoodBlocks(ComputerUtil_Block2.java:106)
at forge.ComputerUtil_Block2.getBlockers(ComputerUtil_Block2.java:402)
at forge.ComputerAI_General.declare_blockers(ComputerAI_General.java:284)
at forge.gui.input.InputControl.updateInput(InputControl.java:116)
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:517)
at forge.gui.input.Input_PassPriority.selectButtonOK(Input_PassPriority.java:42)
at forge.GuiInput.selectButtonOK(GuiInput.java:37)
at forge.GuiDisplay4.okButtonActionPerformed(GuiDisplay4.java:977)
at forge.GuiDisplay4.access$3(GuiDisplay4.java:976)
at forge.GuiDisplay4$28.actionPerformed(GuiDisplay4.java:764)
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.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(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)



The board set up is attached.
Attachments
board.png
Board position during error.
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

Postby Sloth » 21 Jun 2011, 16:41

jeffwadsworth wrote:
Sloth wrote:OK Jeff. Now your card should be ok.
Hmm, I still get this error when after declare attackers step:
Ah, sorry. Fixed now in the right place.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby jeffwadsworth » 21 Jun 2011, 16:51

Sloth wrote:
jeffwadsworth wrote:
Sloth wrote:OK Jeff. Now your card should be ok.
Hmm, I still get this error when after declare attackers step:
Ah, sorry. Fixed now in the right place.
Works perfectly now. Thanks!
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

Postby jeffwadsworth » 23 Jun 2011, 16:51

Land's Edge script:

| Open
Name:Land's Edge
ManaCost:1 R R
Types:World Enchantment
Text:no text
A:AB$ DealDamage | Cost$ Discard<1/Card> | ConditionDefined$ Discarded | ConditionPresent$ Land | ConditionCompare$ EQ1 | NumDmg$ 2 | ValidTgts$ Player | TgtPrompt$ Select target player | AnyPlayer$ True | SpellDescription$ If the discarded card is a land card, CARDNAME deals 2 damage to target player. Any player may activate this ability.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/lands_edge.jpg
End


After a card is discarded , the stack locks up. Discarded appears to be a valid defined...
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

Postby jeffwadsworth » 23 Jun 2011, 22:01

Script for Teleport.

| Open
Name:Teleport
ManaCost:U U U
Types:Instant
Text:no text
A:SP$ Pump | Cost$ U U U | ActivationPhases$ Declare Attackers - Play Instants and Abilities | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ Unblockable | SpellDescription$ Cast CARDNAME only during the declare attackers step. Target creature is unblockable this turn.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/teleport.jpg
End


This should work, but it can't be cast during that specified phase. Anyone see the issue?
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

Postby SoulStorm » 28 Jun 2011, 12:25

Could someone please tell me why Sadistic Sacrament doesn't work? Kicked or otherwise, the spell does nothing when it resolves.

Ok, tested the card again, this time cards were exiled, but I wasn't able to choose the cards. I could have sworn it didn't work at all the last time I tested it.

Code: Select all
Name:Sadistic Sacrament
ManaCost:B B B
Types:Sorcery
Text:no text
A:SP$ ChangeZone | Cost$ 7 B B B | Origin$ Library | Destination$ Exile | ValidTgts$ Player | ChangeType$ Card | ChangeNum$ 15 | IsCurse$ True | SpellDescription$ Kicker 7 (You may pay an additional 7 as you cast this spell.)
A:SP$ ChangeZone | Cost$ B B B | Origin$ Library | Destination$ Exile | ValidTgts$ Player | ChangeType$ Card | ChangeNum$ 3 | IsCurse$ True | SpellDescription$ Search target player's library for up to three cards, exile them, then that player shuffles his or her library. If Sadistic Sacrament was kicked, instead search that player's library for up to fifteen cards, exile them, then that player shuffles his or her library.
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sadistic_sacrament.jpg
End
SoulStorm
 
Posts: 423
Joined: 24 Jun 2010, 22:48
Has thanked: 16 times
Been thanked: 11 times

Re: Card Development Questions

Postby friarsol » 28 Jun 2011, 14:03

SoulStorm,
Probably what is happening is the AI is choosing the cards as the Target of the spell. Take a look to see how Jester's Cap works and compare the differences.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby SoulStorm » 28 Jun 2011, 20:39

I looked at Jester's Cap Sol. I couldn't see any differences, so I tested Jester's Cap and it also doesn't let you choose the cards to be exiled.
SoulStorm
 
Posts: 423
Joined: 24 Jun 2010, 22:48
Has thanked: 16 times
Been thanked: 11 times

Re: Card Development Questions

Postby Sloth » 28 Jun 2011, 20:46

SoulStorm wrote:I looked at Jester's Cap Sol. I couldn't see any differences, so I tested Jester's Cap and it also doesn't let you choose the cards to be exiled.
You are correct, Jester's Cap is wrong. Look at Rootwater Thief instead.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby SoulStorm » 28 Jun 2011, 21:35

Works fine now, thanks Sloth!
SoulStorm
 
Posts: 423
Joined: 24 Jun 2010, 22:48
Has thanked: 16 times
Been thanked: 11 times

Re: Card Development Questions

Postby friarsol » 28 Jun 2011, 21:56

Bah. Jester's Cap used to work.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby SoulStorm » 28 Jun 2011, 22:59

friarsol wrote:Bah. Jester's Cap used to work.
If I had a nickel for every time I've said that about a card! :D
SoulStorm
 
Posts: 423
Joined: 24 Jun 2010, 22:48
Has thanked: 16 times
Been thanked: 11 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 53 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 53 users online :: 0 registered, 0 hidden and 53 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 53 guests

Login Form