It is currently 07 Jun 2025, 21:04
   
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 Sloth » 03 Aug 2011, 19:39

jeffwadsworth wrote:
ArsenalNut wrote:
jeffwadsworth wrote:Elephant Resurgence. Is there a way to get something like this to work currently?

| Open
Name:Elephant Resurgence
ManaCost:1 G
Types:Sorcery
Text:no text
A:SP$ Token | Cost$ 1 G | TokenAmount$ 1 | TokenName$ Elephant | TokenTypes$ Creature,Elephant | TokenOwner$ You | TokenColors$ Green | TokenPower$ X | TokenToughness$ X | TokenTriggers$ TrigPump | TokenSVars$ X | SubAbility$ DBComputerToken | SpellDescription$ Each player puts a green Elephant creature token onto the battlefield. Those creatures have "This creature's power and toughness are each equal to the number of creature cards in its controller's graveyard."
SVar:TrigPump:Mode$ Continuous | Affected$ Self | SetPower$ X | SetToughness$ X | CharacteristicDefining$ True
SVar:TrigPump2:Mode$ Continuous | Affected$ Self | SetPower$ Y | SetToughness$ Y | CharacteristicDefining$ True
SVar:DBComputerToken:DB$Token | TokenAmount$ 1 | TokenName$ Elephant | TokenTypes$ Creature,Elephant | TokenOwner$ Opponent | TokenColors$ Green | TokenPower$ Y | TokenToughness$ Y | TokenTriggers$ TrigPump2 | TokenSVars$ Y
SVar:X:Count$InYourYard.Creature
SVar:Y:Count$InOppYard.Creature
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/elephant_resurgence.jpg
End
I think to do this right you would need a keyword that you could give the token when its created. Because of the "those creatures" text, you need to apply the ability to the specific token instances created by the spell and not just all tokens that match the desired type. I haven't found a mechanism to do this with pump and continuous effects. I ran across this when I was trying to script Gilt-Leaf Ambush. I could give all Elf Warrior token deathtouch till end of turn but not just the ones created by the spell.
That is why the "Affected$ Self" is in there.
Wouldn't it be better to grant static abilities to tokens? I will see what I can do.

EDIT: It's there now. Use "TokenStaticAbilities" pointing to an SVar (see Chimeric Mass using AF Animate).
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 Aug 2011, 20:29

Here is a simplified version of Elephant Resurgence (doesn't include the opponents token). I am getting an error during startup.

| Open
Name:Elephant Resurgence
ManaCost:1 G
Types:Sorcery
Text:no text
A:SP$ Token | Cost$ 1 G | TokenAmount$ 1 | TokenName$ Elephant | TokenTypes$ Creature,Elephant | TokenOwner$ You | TokenColors$ Green | TokenPower$ X | TokenToughness$ X | TokenStaticAbilities$ StaticYou | TokenSVars$ X | SpellDescription$ Each player puts a green Elephant creature token onto the battlefield. Those creatures have "This creature's power and toughness are each equal to the number of creature cards in its controller's graveyard."
SVar:StaticYou:Mode$ Continuous | SetPower$ X | SetToughness$ X | EffectZone$ Battlefield | CharacteristicDefining$ True | Description$ This creature's power and toughness are each equal to the number of creature cards in its controller's graveyard.
SVar:X:Count$InYourYard.Creature
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/elephant_resurgence.jpg
End



The error:

| Open
null


Version:
Forge -- official beta: $Date$, SVN revision: $Revision$

OS: Windows 7 Version: 6.1 Architecture: x86

Java Version: 1.6.0_26 Vendor: Sun Microsystems Inc.

Detailed error trace:
java.lang.NullPointerException
at forge.card.abilityFactory.AbilityFactory_Token.<init>(AbilityFactory_Token.java:91)
at forge.card.abilityFactory.AbilityFactory.getAbility(AbilityFactory.java:590)
at forge.card.cardFactory.AbstractCardFactory.getCard2(AbstractCardFactory.java:436)
at forge.card.cardFactory.AbstractCardFactory.getCard(AbstractCardFactory.java:360)
at forge.card.cardFactory.PreloadingCardFactory.<init>(PreloadingCardFactory.java:55)
at forge.AllZone.getCardFactory(AllZone.java:258)
at forge.deck.generate.GenerateConstructedDeck.getCards(GenerateConstructedDeck.java:91)
at forge.deck.generate.GenerateConstructedDeck.get2ColorDeck(GenerateConstructedDeck.java:100)
at forge.deck.generate.GenerateConstructedDeck.generateDeck(GenerateConstructedDeck.java:50)
at forge.Gui_NewGame.generateConstructedDeck(Gui_NewGame.java:957)
at forge.Gui_NewGame.genDecks(Gui_NewGame.java:928)
at forge.Gui_NewGame.startButton_actionPerformed(Gui_NewGame.java:858)
at forge.Gui_NewGame$14.actionPerformed(Gui_NewGame.java:617)
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)
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 Aug 2011, 20:36

jeffwadsworth wrote:Here is a simplified version of Elephant Resurgence (doesn't include the opponents token). I am getting an error during startup.

| Open
Name:Elephant Resurgence
ManaCost:1 G
Types:Sorcery
Text:no text
A:SP$ Token | Cost$ 1 G | TokenAmount$ 1 | TokenName$ Elephant | TokenTypes$ Creature,Elephant | TokenOwner$ You | TokenColors$ Green | TokenPower$ X | TokenToughness$ X | TokenStaticAbilities$ StaticYou | TokenSVars$ X | SpellDescription$ Each player puts a green Elephant creature token onto the battlefield. Those creatures have "This creature's power and toughness are each equal to the number of creature cards in its controller's graveyard."
SVar:StaticYou:Mode$ Continuous | SetPower$ X | SetToughness$ X | EffectZone$ Battlefield | CharacteristicDefining$ True | Description$ This creature's power and toughness are each equal to the number of creature cards in its controller's graveyard.
SVar:X:Count$InYourYard.Creature
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/elephant_resurgence.jpg
End



The error:

| Open
null


Version:
Forge -- official beta: $Date$, SVN revision: $Revision$

OS: Windows 7 Version: 6.1 Architecture: x86

Java Version: 1.6.0_26 Vendor: Sun Microsystems Inc.

Detailed error trace:
java.lang.NullPointerException
at forge.card.abilityFactory.AbilityFactory_Token.<init>(AbilityFactory_Token.java:91)
at forge.card.abilityFactory.AbilityFactory.getAbility(AbilityFactory.java:590)
at forge.card.cardFactory.AbstractCardFactory.getCard2(AbstractCardFactory.java:436)
at forge.card.cardFactory.AbstractCardFactory.getCard(AbstractCardFactory.java:360)
at forge.card.cardFactory.PreloadingCardFactory.<init>(PreloadingCardFactory.java:55)
at forge.AllZone.getCardFactory(AllZone.java:258)
at forge.deck.generate.GenerateConstructedDeck.getCards(GenerateConstructedDeck.java:91)
at forge.deck.generate.GenerateConstructedDeck.get2ColorDeck(GenerateConstructedDeck.java:100)
at forge.deck.generate.GenerateConstructedDeck.generateDeck(GenerateConstructedDeck.java:50)
at forge.Gui_NewGame.generateConstructedDeck(Gui_NewGame.java:957)
at forge.Gui_NewGame.genDecks(Gui_NewGame.java:928)
at forge.Gui_NewGame.startButton_actionPerformed(Gui_NewGame.java:858)
at forge.Gui_NewGame$14.actionPerformed(Gui_NewGame.java:617)
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)
Arg. Typo. Sorry Jeff.

Sidenote: Both tokens should have the same static ability and SVar.
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 Aug 2011, 22:52

Thanks Sloth. Worked perfectly.
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 » 05 Aug 2011, 12:47

Hey Jeff (or anyone really), can you fix this Bug for me? http://cardforge.org/bugz/view.php?id=104 My codebase is in a terrible state and I'd prefer not to mess with it to trigger to get only one file pushed to git.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Chris H. » 05 Aug 2011, 13:54

friarsol wrote:Hey Jeff (or anyone really), can you fix this Bug for me? http://cardforge.org/bugz/view.php?id=104 My codebase is in a terrible state and I'd prefer not to mess with it to trigger to get only one file pushed to git.
`
I attempted to fix it just now, Gitorious is unresponsive at this moment. I saw the same problem yesterday for awhile.

I will try again in a little while as it is a simple fix. :)
User avatar
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

Postby Chris H. » 05 Aug 2011, 14:24

Chris H. wrote:I attempted to fix it just now, Gitorious is unresponsive at this moment. I saw the same problem yesterday for awhile.

I will try again in a little while as it is a simple fix. :)
`
Made the correction and pushed the commit. It is not yet showing on the Gitorious commit log.
User avatar
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

Postby friarsol » 05 Aug 2011, 14:34

Chris H. wrote:Made the correction and pushed the commit. It is not yet showing on the Gitorious commit log.
Thanks Chris. I've noticed the Gitorious site is usually like 15 minutes or more behind the actual changes.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby jendave » 05 Aug 2011, 14:41

friarsol wrote:
Chris H. wrote:Made the correction and pushed the commit. It is not yet showing on the Gitorious commit log.
Thanks Chris. I've noticed the Gitorious site is usually like 15 minutes or more behind the actual changes.
As much as I love git itself, gitorious has been frustrating: frequent outages, slowness of log updates and my personal pet peeve - no way to set the time zone I am in so I can watch the activity log properly! [/end rant]. Maybe moving back to SVN is not such a bad idea :evil:
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Card Development Questions

Postby Rob Cashwalker » 05 Aug 2011, 14:46

I remember pushing the bug report change for the in-game gui, but it didn't seem to be applied when I pulled it yesterday after your refactoring. I assumed you might not have had that particular update when you began the refactoring process, now I wonder if gitorious just forgot about my revision....
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: Card Development Questions

Postby friarsol » 05 Aug 2011, 15:47

How are the tests going on the local svn here? I agree that I've noticed gitorious being down a fair amount. And while playing with git is cool and educational, not being able to commit code is a pain.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby jendave » 05 Aug 2011, 16:09

friarsol wrote:How are the tests going on the local svn here? I agree that I've noticed gitorious being down a fair amount. And while playing with git is cool and educational, not being able to commit code is a pain.
It's going. Goblin Hero gave me access to the slightlymagic svn. I am in the process of converting the Git history to SVN history. I hope to have everything uploaded and working by late tonight (Pacific time). I am not sure how access is going to work though... Hopefully Goblin Hero can give Rob admin access to add new users.
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Card Development Questions

Postby jendave » 05 Aug 2011, 17:19

jendave wrote:
friarsol wrote:How are the tests going on the local svn here? I agree that I've noticed gitorious being down a fair amount. And while playing with git is cool and educational, not being able to commit code is a pain.
It's going. Goblin Hero gave me access to the slightlymagic svn. I am in the process of converting the Git history to SVN history. I hope to have everything uploaded and working by late tonight (Pacific time). I am not sure how access is going to work though... Hopefully Goblin Hero can give Rob admin access to add new users.
Hmm, maybe by the end of this weekend. Some of the commits in the "gitorious era" are giving my transfer procedure major headaches.
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Card Development Questions

Postby ArsenalNut » 09 Aug 2011, 13:52

I am trying to script Daybreak Coronet. The initial attach is no problem. Is there a way to count the number of other Auras attached to same the card that Daybreak Coronet is attached? I didn't find anything in the xCount code but I wanted to make sure I didn't miss something before I tried to add code to do it.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Card Development Questions

Postby friarsol » 09 Aug 2011, 14:40

ArsenalNut wrote:I am trying to script Daybreak Coronet. The initial attach is no problem. Is there a way to count the number of other Auras attached to same the card that Daybreak Coronet is attached? I didn't find anything in the xCount code but I wanted to make sure I didn't miss something before I tried to add code to do it.
Someone else will have to chime in for the the xCount question, but make sure the Coronet falls off properly if the other Aura is removed.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 49 guests


Who is online

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

Login Form