Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by jeffwadsworth » 17 Jun 2011, 20:00
- 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 » 17 Jun 2011, 20:21
Is something wrong with that? I'm pretty sure that should be right. The only thing I can think of is if the ActivationFrom code doesn't check cards in Exile. Post a sample card file.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Sloth » 17 Jun 2011, 21:31
The question is: How can the player use an ability from exile?friarsol wrote:Is something wrong with that? I'm pretty sure that should be right. The only thing I can think of is if the ActivationFrom code doesn't check cards in Exile. Post a sample card file.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by jeffwadsworth » 18 Jun 2011, 00:35
The Interpreter strikes again!Sloth wrote:The question is: How can the player use an ability from exile?friarsol wrote:Is something wrong with that? I'm pretty sure that should be right. The only thing I can think of is if the ActivationFrom code doesn't check cards in Exile. Post a sample card file.
- 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 » 18 Jun 2011, 00:38
Script for Greater Gargadonfriarsol wrote:Is something wrong with that? I'm pretty sure that should be right. The only thing I can think of is if the ActivationFrom code doesn't check cards in Exile. Post a sample card file.
- | Open
- Name:Greater Gargadon
ManaCost:9 R
Types:Creature Beast
Text:no text
PT:9/7
K:Suspend:10:R
A:AB$ RemoveCounter | Cost$ Sac<1/Artifact;Creature;Land> | CostDesc$ Sacrifice an artifact, creature, or land: | CounterType$ TIME | CounterNum$ 1 | ActivationZone$ Exile | IsPresent$ Card.countersGE1TIME+Self | PresentZone$ Exile | SpellDescription$ Remove a time counter from CARDNAME. Activate this ability only if CARDNAME is suspended.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/greater_gargadon.jpg
- 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 » 18 Jun 2011, 02:02
Using the inappropriately named "Flashback" button? We should really figure out a better name since it really means "Abilities in non-Battlefield/Hand zones"Sloth wrote:The question is: How can the player use an ability from exile?
- 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 » 18 Jun 2011, 07:56
Script for Sengir Nosferatu
When the ability on the Bat token is used, an NPE results.
- | Open
- Name:Sengir Nosferatu
ManaCost:3 B B
Types:Creature Vampire
Text:no text
PT:4/4
K:Flying
A:AB$ Token | Cost$ 1 B Exile<1/CARDNAME> | TokenAmount$ 1 | TokenName$ Bat | TokenTypes$ Creature,Bat | TokenOwner$ You | TokenColors$ Black | TokenPower$ 1 | TokenToughness$ 2 | TokenKeywords$ Flying | TokenAbilities$ ABReturn | SpellDescription$ Put a 1/2 black Bat creature token with flying onto the battlefield. It has "1 B, Sacrifice this creature: Return an exiled card named CARDNAME to the battlefield under its owner's control."
SVar:ABReturn:AB$ChangeZone | Cost$ 1 B Sac<1/CARDNAME> | ChangeType$ Card.namedSengir Nosferatu | ChangeNum$ 1 | Origin$ Exile | Destination$ Battlefield | SpellDescription$ Return an exiled card named Sengir Nosferatu to the battlefield under its owner's control
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sengir_nosferatu.jpg
End
When the ability on the Bat token is used, an NPE results.
- | 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: amd64
Java Version: 1.6.0_22 Vendor: Sun Microsystems Inc.
Detailed error trace:
java.lang.NullPointerException
at forge.card.abilityFactory.AbilityFactory_ChangeZone.changeKnownOriginResolve(AbilityFactory_ChangeZone.java:1156)
at forge.card.abilityFactory.AbilityFactory_ChangeZone.changeZoneResolve(AbilityFactory_ChangeZone.java:193)
at forge.card.abilityFactory.AbilityFactory_ChangeZone.access$1(AbilityFactory_ChangeZone.java:185)
at forge.card.abilityFactory.AbilityFactory_ChangeZone$1.resolve(AbilityFactory_ChangeZone.java:42)
at forge.card.abilityFactory.AbilityFactory.resolve(AbilityFactory.java:1449)
at forge.MagicStack.resolveStack(MagicStack.java:693)
at forge.Phase.passPriority(Phase.java:527)
at forge.ComputerAI_General.stackResponse(ComputerAI_General.java:357)
at forge.ComputerAI_General.stack_not_empty(ComputerAI_General.java:305)
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:516)
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
by friarsol » 18 Jun 2011, 13:04
Regarding Sengir Nosferatu, did you try it with the Hidden flag on?
- 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 » 18 Jun 2011, 14:11
That fixed it. I thought that was used in a different way. Thanks.friarsol wrote:Regarding Sengir Nosferatu, did you try it with the Hidden flag on?
- 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 » 18 Jun 2011, 15:05
Hidden is for when the decision of "What is Changing Zones?" occurs during resolution. This is only necessary when the Origin Zone is Known Information and normally would require something to target.jeffwadsworth wrote:That fixed it. I thought that was used in a different way. Thanks.friarsol wrote:Regarding Sengir Nosferatu, did you try it with the Hidden flag on?
- 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 » 18 Jun 2011, 17:03
Cheers.
Last edited by jeffwadsworth on 18 Jun 2011, 18:23, edited 1 time in total.
- 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 Chris H. » 18 Jun 2011, 18:06
`jeffwadsworth wrote:Voidmage Husher script
- | Open
- Name:Voidmage Husher
ManaCost:3 U
Types:Creature Human Wizard
Text:no text
PT:2/2
K:Flash
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigCounter | TriggerDescription$ When CARDNAME enters the battlefield, counter target activated ability.
T:Mode$ SpellCast | ValidCard$ Card.YouCtrl | Execute$ TrigBounce | TriggerZones$ Battlefield | OptionalDecider$ You | TriggerDescription$ Whenever you cast a spell, you may return CARDNAME to its owner's hand.
SVar:TrigCounter:SP$Counter | Cost$ 0 | TargetType$ Activated | TgtPrompt$ Select target ability | ValidTgts$ Permanent
SVar:TrigBounce:SP$ChangeZone | Cost$ 0 | Origin$ Battlefield | Destination$ Hand
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/voidmage_husher.jpg
End
When this is cast to counter an ability, it works, but Voidmage Husher ends up in the graveyard. Apparently, it is countering itself also? On a big side note, OptionalDecider$ appears to be broken. It doesn't work here or with Zealot il-Vec.
If you changed the
- Code: Select all
SVar:TrigCounter:SP$Counter
to
- Code: Select all
SVar:TrigCounter:AB$Counter
this might keep the Voidmage Husher in play?
-
Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Card Development Questions
by jeffwadsworth » 19 Jun 2011, 22:02
If Pump AB could use Remembered, we could script Erhnam Djinn. Forge just isn't the same without the guy.
- | Open
- Name:Erhnam Djinn
ManaCost:3 G
Types:Creature Djinn
Text:no text
PT:4/5
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigPump | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, target non-Wall creature an opponent controls gains forestwalk until your next upkeep.
SVar:TrigPump:AB$Pump | Cost$ 0 | ValidTgts$ Creature.nonWall+YouDontCtrl | TgtPrompt$ Select target non-Wall creature an opponent controls | KW$ Forestwalk | RememberTargets$ True | ForgetOtherTargets$ True | SubAbility$ DelTrig | Permanent$ True
SVar:DelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigDebuff | SpellDescription$ Remove Forestwalk at your next upkeep.
SVar:TrigDebuff:AB$Debuff | Cost$ 0 | Defined$ Remembered | KW$ Forestwalk | SpellDescription$ Remove Forestwalk.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/erhnam_djinn.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
by friarsol » 20 Jun 2011, 00:52
Unfortunately, Erhnam isn't a delayed trigger. It's a Pump that wears off on the activators Next Upkeep. We would need to work it into a Duration parameter somehow.
- 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 » 20 Jun 2011, 22:23
Cheers
Last edited by jeffwadsworth on 21 Jun 2011, 04:29, edited 2 times in total.
- 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 31 guests