Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by moomarc » 14 Nov 2011, 12:27
- Flickering Ward | Open
- Name:Flickering Ward
ManaCost:W
Types:Enchantment Aura
Text:no text
K:Enchant creature
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseColor | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose a color.
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | AILogic$ MostProminentInHumanDeck
A:SP$ Attach | Cost$ W | ValidTgts$ Creature | AILogic$ Pump
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Protection:Card.ChosenColor:CARDNAME has protection from the chosen color. | Description$ Enchanted creature has protection from the chosen color. This effect doesn't remove Flickering Ward.
A:AB$ ChangeZone | Cost$ W | Origin$ Battlefield | Destination$ Hand | SpellDescription$ Return CARDNAME to its owner's hand.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/flickering_ward.jpg
End
Edit: Actually the second option is better because it won't cause any issues if the enchanted creature already has a chosen color.
-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 Iran » 15 Nov 2011, 04:10
Aeon Chronicler, Tomorrow, Azami's Familiar , Abundance, Possessed Portal, Terrarion, Semblance Anvil, Manamorphose, Spoils of the Vault, Journey of Discovery, Firespout, Worldheart Phoenix, Magewright's Stone and Malfegor.
Any of this cards are scriptable? Are these cards possible to be scripted?
Any of this cards are scriptable? Are these cards possible to be scripted?
Re: Card Development Questions
by moomarc » 15 Nov 2011, 12:15
Can anyone see the problem with this script.
I get the following NPE whenever it triggers:
- No Quarter | Open
- Name:No Quarter
ManaCost:3 R
Types:Enchantment
Text:no text
T:Mode$ Blocks | ValidCard$ Creature.powerLTX | ValidBlocked$ Creature | Execute$ DestroyBlocker | TriggerDescription$ Whenever a creature becomes blocked by a creature with lesser power, destroy the blocking creature.
T:Mode$ Blocks | ValidCard$ Creature | ValidBlocked$ Creature.powerLTY | Execute$ DestroyAttacker | TriggerDescription$ Whenever a creature blocks a creature with lesser power, destroy the attacking creature.
SVar:X:TriggeredAttacker$CardPower
SVar:Y:TriggeredBlocker$CardPower
SVar:DestroyBlocker:AB$Destroy | Cost$ 0 | Defined$ TriggeredBlocker
SVar:DestroyAttacker:AB$Destroy | Cost$ 0 | Defined$ TriggeredAttacker
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/no_quarter.jpg
End
I get the following NPE whenever it triggers:
- Error | Open
- This is a Crash Report. An error has occurred. Please save this message to a file.
Please follow the instructions at this address to submit this Crash Report, plus what you were doing at the time:
http://tinyurl.com/3zzrnyb
Reporting bugs in Forge is very important. We thank you for your time.
null
Version:
Forge version SVN
OS: Windows 7 Version: 6.1 Architecture: x86
Java Version: 1.6.0_29 Vendor: Sun Microsystems Inc.
Detailed error trace:
java.lang.NullPointerException
at forge.card.cardfactory.CardFactoryUtil.xCount(CardFactoryUtil.java:2874)
at forge.Card.hasProperty(Card.java:6649)
at forge.Card.isValid(Card.java:6284)
at forge.GameEntity.isValid(GameEntity.java:302)
at forge.card.trigger.Trigger.matchesValid(Trigger.java:531)
at forge.card.trigger.TriggerBlocks.performTest(TriggerBlocks.java:39)
at forge.card.trigger.TriggerHandler.runSingleTrigger(TriggerHandler.java:374)
at forge.card.trigger.TriggerHandler.runTrigger(TriggerHandler.java:300)
at forge.CombatUtil.checkBlockedAttackers(CombatUtil.java:2383)
at forge.PhaseUtil.handleDeclareBlockers(PhaseUtil.java:602)
at forge.Phase.handleBeginPhase(Phase.java:331)
at forge.gui.input.InputControl.updateInput(InputControl.java:183)
at forge.GuiInput.update(GuiInput.java:34)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.MyObservable.updateObservers(MyObservable.java:21)
at forge.Phase.nextPhase(Phase.java:509)
at forge.Phase.nextPhase(Phase.java:512)
at forge.GuiDisplay$33.actionPerformed(GuiDisplay.java:1144)
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)
-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 jeffwadsworth » 15 Nov 2011, 17:42
Looks like a timing issue with ValidBlocked$ Creature.powerLTY, etc in regards to xCount. Everything else looks okay.
- 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 » 15 Nov 2011, 17:48
Malfegor is doable. Look for it soon.Iran wrote:Aeon Chronicler, Tomorrow, Azami's Familiar , Abundance, Possessed Portal, Terrarion, Semblance Anvil, Manamorphose, Spoils of the Vault, Journey of Discovery, Firespout, Worldheart Phoenix, Magewright's Stone and Malfegor.
Any of this cards are scriptable? Are these cards possible to be scripted?
- 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 moomarc » 15 Nov 2011, 18:05
Timing issues have killed more cards than anything else.jeffwadsworth wrote:Looks like a timing issue with ValidBlocked$ Creature.powerLTY, etc in regards to xCount. Everything else looks okay.

-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 Iran » 16 Nov 2011, 13:32
Trying to script Manamorphose. I thought of something this way, but unfortunately it doesn't work.
- "Manamorphose" | Open
- Name:Manamorphose
ManaCost:1 RG
Types:Instant
Text:no text
A:AB$ Mana | Cost$ 1 RG | Produced$ B B | SpellDescription$ Add B B to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ B G | SpellDescription$ Add B G to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ B U | SpellDescription$ Add B U to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ B R | SpellDescription$ Add B R to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ B W | SpellDescription$ Add B W to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ G B | SpellDescription$ Add G B to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ G G | SpellDescription$ Add G G to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ G U | SpellDescription$ Add G U to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ G R | SpellDescription$ Add G R to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ G W | SpellDescription$ Add G W to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ U B | SpellDescription$ Add U B to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ U G | SpellDescription$ Add U G to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ U U | SpellDescription$ Add U U to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ U R | SpellDescription$ Add U R to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ U W | SpellDescription$ Add U W to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ R B | SpellDescription$ Add R B to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ R G | SpellDescription$ Add R G to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ R U | SpellDescription$ Add R U to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ R R | SpellDescription$ Add R R to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ R W | SpellDescription$ Add R W to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ W B | SpellDescription$ Add W B to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ W G | SpellDescription$ Add W G to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ W U | SpellDescription$ Add W U to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ W R | SpellDescription$ Add W R to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ W W | SpellDescription$ Add W W to your mana pool.
End
Re: Card Development Questions
by jeffwadsworth » 16 Nov 2011, 13:59
This is why we don't script these. It gets out of control.Iran wrote:Trying to script Manamorphose. I thought of something this way, but unfortunately it doesn't work.
- "Manamorphose" | Open
- Name:Manamorphose
ManaCost:1 RG
Types:Instant
Text:no text
A:AB$ Mana | Cost$ 1 RG | Produced$ B B | SpellDescription$ Add B B to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ B G | SpellDescription$ Add B G to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ B U | SpellDescription$ Add B U to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ B R | SpellDescription$ Add B R to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ B W | SpellDescription$ Add B W to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ G B | SpellDescription$ Add G B to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ G G | SpellDescription$ Add G G to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ G U | SpellDescription$ Add G U to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ G R | SpellDescription$ Add G R to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ G W | SpellDescription$ Add G W to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ U B | SpellDescription$ Add U B to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ U G | SpellDescription$ Add U G to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ U U | SpellDescription$ Add U U to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ U R | SpellDescription$ Add U R to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ U W | SpellDescription$ Add U W to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ R B | SpellDescription$ Add R B to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ R G | SpellDescription$ Add R G to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ R U | SpellDescription$ Add R U to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ R R | SpellDescription$ Add R R to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ R W | SpellDescription$ Add R W to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ W B | SpellDescription$ Add W B to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ W G | SpellDescription$ Add W G to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ W U | SpellDescription$ Add W U to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ W R | SpellDescription$ Add W R to your mana pool.
A:AB$ Mana | Cost$ 1 RG | Produced$ W W | SpellDescription$ Add W W to your mana pool.
End
- 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 » 16 Nov 2011, 14:52
Manamorphose will probably have to wait for this feature to be added: http://cardforge.org/bugz/view.php?id=163
- 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 » 16 Nov 2011, 15:46
Perhaps someone can get this to work correctly. Script for Mercy Killing.
The targeted creature controller does not have to sacrifice it with this script. Perhaps there is another way?
- | Open
- Name:Mercy Killing
ManaCost:2 GW
Types:Instant
Text:no text
A:SP$ Sacrifice | Cost$ 2 GW | ValidTgts$ Creature | TgtPrompt$ Select target creature | SubAbility$ DBToken | SpellDescription$ Target creature's controller sacrifices it, then puts X 1/1 green and white Elf Warrior creature tokens onto the battlefield, where X is that creature's power.
SVar:DBToken:DB$ Token | TokenAmount$ X | TokenPower$ 1 | TokenToughness$ 1 | TokenName$ Elf Warrior | TokenTypes$ Creature,Elf,Warrior | TokenColors$ Green,White | TokenOwner$ TargetedController
SVar:X:Targeted$CardPower
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/mercy_killing.jpg
End
The targeted creature controller does not have to sacrifice it with this script. Perhaps there is another way?
- 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 moomarc » 16 Nov 2011, 15:53
Does Mandatory$ True not work? Not near my computer at the moment so can't try it.
-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 Iran » 16 Nov 2011, 17:22
what pitty, because of the impjeffwadsworth wrote:The Imp can not handle Echo non-mana costs. Anyway, the Assassin will be ready once the keyword Recover is fixed.Iran wrote:Is possible to script Garza's Assassin and Deepcavern Imp?
I think the cost of Recover and Echo keywords of these cards is dificult to implement... Am I right?
- | Open
- Name:Garza's Assassin
ManaCost:B B B
Types:Creature Human Assassin
Text:no text
PT:2/2
K:Recover:PayLife<X>
A:AB$ Destroy | Cost$ Sac<1/CARDNAME> | ValidTgts$ Creature.nonBlack | TgtPrompt$ Select target nonblack creature | SpellDescription$ Destroy target nonblack creature.
SVar:X:Count$YourLifeTotal/HalfUp
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/garzas_assassin.jpg
End

Last edited by Iran on 17 Nov 2011, 19:55, edited 6 times in total.
Re: Card Development Questions
by jeffwadsworth » 16 Nov 2011, 17:26
No, I believe the issue is related to the way Sacrifice is coded.moomarc wrote:Does Mandatory$ True not work? Not near my computer at the moment so can't try it.
- 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 Sloth » 16 Nov 2011, 19:04
You have to use AF Destroy instead. Look at Shape Anew.jeffwadsworth wrote:No, I believe the issue is related to the way Sacrifice is coded.moomarc wrote:Does Mandatory$ True not work? Not near my computer at the moment so can't try it.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by jeffwadsworth » 16 Nov 2011, 20:51
Is there still an issue with Sarkhan the Mad's script? That Destroy "Sacrifice" addition would cover the second ability at least.
- 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 21 guests