It is currently 28 May 2025, 21:01
   
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 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
At the moment the enchanted creature can't access the ChosenColor because it's stored on the aura card. Is there any way to pass the chosen color on to the enchanted creature to make this work? If not, is there a way to script the condition 'ChosenColor is White' in which case a static ability with a conditional can be set up for each color? There's 4 other auras with the exact same phrasing.

Edit: Actually the second option is better because it won't cause any issues if the enchanted creature already has a chosen color.
-Marc
User avatar
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

Postby Iran » 15 Nov 2011, 04:10

Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby moomarc » 15 Nov 2011, 12:15

Can anyone see the problem with this script.
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
User avatar
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

Postby 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

Postby jeffwadsworth » 15 Nov 2011, 17:48

Malfegor is doable. Look for it soon.
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 moomarc » 15 Nov 2011, 18:05

jeffwadsworth wrote:Looks like a timing issue with ValidBlocked$ Creature.powerLTY, etc in regards to xCount. Everything else looks okay.
Timing issues have killed more cards than anything else. #-o Thanks for the feedback.
-Marc
User avatar
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

Postby 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
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby jeffwadsworth » 16 Nov 2011, 13:59

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
This is why we don't script these. It gets out of control.
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 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

Postby jeffwadsworth » 16 Nov 2011, 15:46

Perhaps someone can get this to work correctly. Script for Mercy Killing.

| 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

Postby moomarc » 16 Nov 2011, 15:53

Does Mandatory$ True not work? Not near my computer at the moment so can't try it.
-Marc
User avatar
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

Postby Iran » 16 Nov 2011, 17:22

jeffwadsworth wrote:
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?
The Imp can not handle Echo non-mana costs. Anyway, the Assassin will be ready once the keyword Recover is fixed.

| 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
what pitty, because of the imp :(
Last edited by Iran on 17 Nov 2011, 19:55, edited 6 times in total.
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby jeffwadsworth » 16 Nov 2011, 17:26

moomarc wrote:Does Mandatory$ True not work? Not near my computer at the moment so can't try it.
No, I believe the issue is related to the way Sacrifice is coded.
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 » 16 Nov 2011, 19:04

jeffwadsworth wrote:
moomarc wrote:Does Mandatory$ True not work? Not near my computer at the moment so can't try it.
No, I believe the issue is related to the way Sacrifice is coded.
You have to use AF Destroy instead. Look at Shape Anew.
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 » 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

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 24 guests


Who is online

In total there are 24 users online :: 0 registered, 0 hidden and 24 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 24 guests

Login Form