It is currently 09 Jun 2025, 06:50
   
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 » 30 May 2011, 02:43

Okay, if we had a Drawback for ChangeZoneAll, we could script Infernal Kirin.

Code: Select all
Name:Infernal Kirin
ManaCost:2 B B
Types:Legendary Creature Kirin Spirit
Text:no text
PT:3/3
K:Flying
T:Mode$ SpellCast | ValidCard$ Spirit.YouCtrl,Arcane.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigReveal | TriggerDescription$ Whenever you cast a Spirit or Arcane spell, target player reveals his or her hand and discards all cards with that spell's converted mana cost.
SVar:TrigReveal:AB$RevealHand | Cost$ 0 | ValidTgts$ Player | TgtPrompt$ Select target player | SubAbility$ SVar=DBChangeZoneAll
SVar:DBChangeZoneAll:DB$ChangeZoneAll | Defined$ Targeted | Origin$ Hand | Destination$ Graveyard | ChangeType$ Card.cmcEQX
SVar:X:TriggeredCard$CardManaCost
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/infernal_kirin.jpg
SetInfo:SOK|Rare|http://magiccards.info/scans/en/sok/72.jpg
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

Postby Sloth » 30 May 2011, 06:24

jeffwadsworth wrote:Okay, if we had a Drawback for ChangeZoneAll, we could script Infernal Kirin.

Code: Select all
Name:Infernal Kirin
ManaCost:2 B B
Types:Legendary Creature Kirin Spirit
Text:no text
PT:3/3
K:Flying
T:Mode$ SpellCast | ValidCard$ Spirit.YouCtrl,Arcane.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigReveal | TriggerDescription$ Whenever you cast a Spirit or Arcane spell, target player reveals his or her hand and discards all cards with that spell's converted mana cost.
SVar:TrigReveal:AB$RevealHand | Cost$ 0 | ValidTgts$ Player | TgtPrompt$ Select target player | SubAbility$ SVar=DBChangeZoneAll
SVar:DBChangeZoneAll:DB$ChangeZoneAll | Defined$ Targeted | Origin$ Hand | Destination$ Graveyard | ChangeType$ Card.cmcEQX
SVar:X:TriggeredCard$CardManaCost
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/infernal_kirin.jpg
SetInfo:SOK|Rare|http://magiccards.info/scans/en/sok/72.jpg
End
You can't replace a discard with changeZone, things like Madness and Megrim won't trigger.
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 friarsol » 30 May 2011, 17:40

Sloth wrote:
jeffwadsworth wrote:Okay, if we had a Drawback for ChangeZoneAll, we could script Infernal Kirin.
You can't replace a discard with changeZone, things like Madness and Megrim won't trigger.
I'll add this type of Discarding into the AF in a bit. Will test with Amnesia.

Edit: Jeff, give the new Mode a try with this trigger. I think it should work this way.
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 » 30 May 2011, 20:23

Using r9102:

Using Sol's new code (Thanks!), I am getting a Null pointer error with this script:

Code: Select all
Name:Infernal Kirin
ManaCost:2 B B
Types:Legendary Creature Kirin Spirit
Text:no text
PT:3/3
K:Flying
T:Mode$ SpellCast | ValidCard$ Spirit.YouCtrl,Arcane.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigDiscard | TriggerDescription$ Whenever you cast a Spirit or Arcane spell, target player reveals his or her hand and discards all cards with that spell's converted mana cost.
SVar:TrigDiscard:AB$Discard | Cost$ 0 | ValidTgts$ Player | Mode$ RevealDiscardAll | DiscardValid$ Card.cmcEQX
SVar:X:TriggeredCard$CardManaCost
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/infernal_kirin.jpg
SetInfo:SOK|Rare|http://magiccards.info/scans/en/sok/72.jpg
End
It appears to be an issue with the DiscardValid$ Card.cmcEQX.

Error output right after reveal hand step:

Code: Select all
Detailed error trace:
java.lang.NullPointerException
   at forge.card.cardFactory.CardFactoryUtil.xCount(CardFactoryUtil.java:2692)
   at forge.Card.hasProperty(Card.java:2864)
   at forge.Card.isValid(Card.java:2737)
   at forge.Card.isValidCard(Card.java:2710)
   at forge.CardList$15.addCard(CardList.java:356)
   at forge.CardList.filter(CardList.java:296)
   at forge.CardList.getValidCards(CardList.java:354)
   at forge.card.abilityFactory.AbilityFactory_ZoneAffecting.discardResolve(AbilityFactory_ZoneAffecting.java:882)
   at forge.card.abilityFactory.AbilityFactory_ZoneAffecting.access$2(AbilityFactory_ZoneAffecting.java:826)
   at forge.card.abilityFactory.AbilityFactory_ZoneAffecting$7.resolve(AbilityFactory_ZoneAffecting.java:759)
   at forge.card.spellability.SpellAbility_Requirements.finishPaying(SpellAbility_Requirements.java:90)
   at forge.card.spellability.Cost_Payment.payCost(Cost_Payment.java:431)
   at forge.card.spellability.SpellAbility_Requirements.startPaying(SpellAbility_Requirements.java:82)
   at forge.card.spellability.SpellAbility_Requirements.needPayment(SpellAbility_Requirements.java:75)
   at forge.card.spellability.SpellAbility_Requirements.fillRequirements(SpellAbility_Requirements.java:53)
   at forge.GameAction.playSpellAbility_NoStack(GameAction.java:1867)
   at forge.card.trigger.TriggerHandler$2.resolve(TriggerHandler.java:967)
   at forge.MagicStack.resolveStack(MagicStack.java:706)
   at forge.Phase.passPriority(Phase.java:513)
   at forge.ComputerAI_General.stackResponse(ComputerAI_General.java:365)
   at forge.ComputerAI_General.stack_not_empty(ComputerAI_General.java:304)
   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:502)
   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 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 friarsol » 02 Jun 2011, 03:07

Hey Jeff,
This is an odd situation indeed. DiscardValid is getting sent into getValidCards which doesn't have access to all the AF helper functions having to deal with Triggered and what not. I'm not really sure what the solution here is, but somehow we would need the X to be calculated before it gets run in ValidCards. I haven't really looked at these functions since I made the first few a while back, maybe someone else who has been busy adding them can take a peek and figure out the right way to handle the combination.

Also, I believe it would need to be TriggeredSpellAbility$CardManaCost not TriggeredCard. But as I said above there is a larger problem than this one tweak.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Sloth » 02 Jun 2011, 10:39

friarsol wrote:Hey Jeff,
This is an odd situation indeed. DiscardValid is getting sent into getValidCards which doesn't have access to all the AF helper functions having to deal with Triggered and what not. I'm not really sure what the solution here is, but somehow we would need the X to be calculated before it gets run in ValidCards. I haven't really looked at these functions since I made the first few a while back, maybe someone else who has been busy adding them can take a peek and figure out the right way to handle the combination.
I finished converting it. Something similar was done for Celestial Kirin: The X is now calculated in AF Discard before being passed on.

friarsol wrote:Also, I believe it would need to be TriggeredSpellAbility$CardManaCost not TriggeredCard. But as I said above there is a larger problem than this one tweak.
No. That didn't work.
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 Jaedayr » 02 Jun 2011, 20:44

This is more of a card testing question than development. Why does Forge read the .dck files in whenever it is opened, and not when that deck is selected for a match? For example, I make a change to a card, then edit my test deck to add it so I can test it. If Forge is already running the deck shows up as it was before the changes. I have to exit Forge and restart to see the changes. This isn't a major issue, just something I have been wondering. (This behavior also makes me wonder if someone has hundreds of decks whether it is less efficient than waiting until you need to use a deck before reading it.)
Jaedayr
Tester
 
Posts: 523
Joined: 08 Jul 2010, 00:06
Has thanked: 16 times
Been thanked: 13 times

Re: Card Development Questions

Postby jeffwadsworth » 02 Jun 2011, 23:15

Nether Void. Sample script:

Code: Select all
Name:Nether Void
ManaCost:3 B
Types:World Enchantment
Text:no text
T:Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ Each | TriggerZones$ Battlefield | Execute$ TrigCounter | TriggerDescription$ Whenever a player casts a spell, counter it unless its controller pays 3.
SVar:TrigCounter:AB$Counter | Cost$ 0 | UnlessCost$ 3 | Defined$ TriggeredCard
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/nether_void.jpg
End
This produces a Null error. I take it that the Counter AB doesn't like Defined$ TriggeredCard?
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 lazylockie » 03 Jun 2011, 04:42

Jaedayr wrote:This is more of a card testing question than development. Why does Forge read the .dck files in whenever it is opened, and not when that deck is selected for a match? For example, I make a change to a card, then edit my test deck to add it so I can test it. If Forge is already running the deck shows up as it was before the changes. I have to exit Forge and restart to see the changes. This isn't a major issue, just something I have been wondering. (This behavior also makes me wonder if someone has hundreds of decks whether it is less efficient than waiting until you need to use a deck before reading it.)
hint: open quest mode then close, your deck will be reloaded :)
lazylockie
 
Posts: 508
Joined: 13 Jul 2010, 22:44
Has thanked: 74 times
Been thanked: 15 times

Re: Card Development Questions

Postby Sloth » 03 Jun 2011, 06:28

jeffwadsworth wrote:Nether Void. Sample script:

Code: Select all
Name:Nether Void
ManaCost:3 B
Types:World Enchantment
Text:no text
T:Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ Each | TriggerZones$ Battlefield | Execute$ TrigCounter | TriggerDescription$ Whenever a player casts a spell, counter it unless its controller pays 3.
SVar:TrigCounter:AB$Counter | Cost$ 0 | UnlessCost$ 3 | Defined$ TriggeredCard
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/nether_void.jpg
End
This produces a Null error. I take it that the Counter AB doesn't like Defined$ TriggeredCard?
Exactly. The counter abilities are quite different from the rest and Defined is not supported at the moment.
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 » 03 Jun 2011, 14:33

I assume that it is okay to use the SpellCopy AB? It seems to work quite well. I am just curious why Twincast and others were not converted yet.
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 » 03 Jun 2011, 14:41

jeffwadsworth wrote:I assume that it is okay to use the SpellCopy AB? It seems to work quite well. I am just curious why Twincast and others were not converted yet.
We were saving some fun for you. I know Fork needs some extra code since it's copy becomes Red but it should be fine besides from that.
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 » 03 Jun 2011, 14:50

friarsol wrote:
jeffwadsworth wrote:I assume that it is okay to use the SpellCopy AB? It seems to work quite well. I am just curious why Twincast and others were not converted yet.
We were saving some fun for you. I know Fork needs some extra code since it's copy becomes Red but it should be fine besides from that.
Ah, you guys are so kind and thoughtful. It looks like the Fork does not make the copy Red within the code.
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 » 03 Jun 2011, 15:14

jeffwadsworth wrote:Ah, you guys are so kind and thoughtful. It looks like the Fork does not make the copy Red within the code.
Yes, it was incorrectly added. Fell free to convert it also.
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 » 03 Jun 2011, 16:04

Echoing Decay. Any plans to implement something like Targeted.sameName+Other?

Sample script:

Code: Select all
Name:Echoing Decay
ManaCost:1 B
Types:Instant
Text:no text
A:SP$ Pump | Cost$ 1 B | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ -2 | NumDef$ -2 | SubAbility$ SVar=DBPumpAll | SpellDescription$ Target creature and all other creatures with the same name as that creature get -2/-2 until end of turn.
SVar:DBPumpAll:DB$PumpAll | ValidCards$ Targeted.sameName+Other | NumAtt$ -2 | NumDef$ -2
SVar:Rarity:Common
SVar:RemAIDeck:True
SVar:Picture:http://resources.wizards.com/magic/cards/dst/en-us/card46176.jpg
SetInfo:DST|Common|http://magiccards.info/scans/en/ds/41.jpg
End
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 7 guests


Who is online

In total there are 7 users online :: 0 registered, 0 hidden and 7 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 7 guests

Login Form