It is currently 05 Jun 2025, 07:28
   
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 Iran » 24 Sep 2011, 01:26

Tryingo to script River Kelpie, but when i put this card in cardsfolder/r directory and execute the forge i see the following crash reports. What´s wrong with this card?

River Kelpie | Open
Name:River Kelpie
ManaCost:3 U U
Types:Creature Beast
Text:no text
PT:3/3
K:Persist
T:Mode$ ChangesZone | ValidCard$ Permanent | Origin$ Graveyard | Destination$ Battlefield | Execute$ DBDraw | TriggerZones$ Battlefield | TriggerDescription$ Whenever River Kelpie or another permanent is put onto the battlefield from a graveyard, draw a card.
T:Mode$ ChangesZone | ValidCard$ Card | Origin$ Graveyard | Destination$ Stack | Execute$ DBDraw | TriggerZones$ Battlefield | TriggerDescription$ Whenever a player casts a spell from a graveyard, draw a card.
SVar:DBDraw:DB$Draw | Cost$ 0 | NumCards$ 1
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/river_kelpie.jpg
End


This is a Crash Report | 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.

String index out of range: 0


Version:
Forge version 1.1.4, build ID 10643

OS: Windows XP Version: 5.1 Architecture: x86

Java Version: 1.6.0_25 Vendor: Sun Microsystems Inc.

Detailed error trace:
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(Unknown Source)
at forge.CardReader.loadCard(CardReader.java:324)
at forge.CardReader.loadCard(CardReader.java:434)
at forge.CardReader.loadCardsUntilYouFind(CardReader.java:235)
at forge.CardReader.run(CardReader.java:188)
at forge.card.cardFactory.PreloadingCardFactory.readCards(PreloadingCardFactory.java:80)
at forge.card.cardFactory.PreloadingCardFactory.<init>(PreloadingCardFactory.java:53)
at forge.AllZone.getCardFactory(AllZone.java:228)
at forge.view.swing.ApplicationView.setModel(ApplicationView.java:122)
at forge.view.swing.Main.main(Main.java:43)
at forge.Gui_NewGame.main(Gui_NewGame.java:27)


And after i close the first crash

This is a Crash Report 2 | 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.

CardDb has not yet been initialized, run setup() first


Version:
Forge version 1.1.4, build ID 10643

OS: Windows XP Version: 5.1 Architecture: x86

Java Version: 1.6.0_25 Vendor: Sun Microsystems Inc.

Detailed error trace:
java.lang.NullPointerException: CardDb has not yet been initialized, run setup() first
at forge.item.CardDb.instance(CardDb.java:31)
at forge.item.ItemPool.<init>(ItemPool.java:17)
at forge.deck.Deck.setMain(Deck.java:145)
at forge.deck.DeckManager.readDeck(DeckManager.java:308)
at forge.deck.DeckManager.readAllDecks(DeckManager.java:255)
at forge.deck.DeckManager.<init>(DeckManager.java:93)
at forge.AllZone.getDeckManager(AllZone.java:430)
at forge.view.swing.OldGuiNewGame.<init>(OldGuiNewGame.java:61)
at forge.view.swing.ApplicationView$4.run(ApplicationView.java:140)
at java.awt.event.InvocationEvent.dispatch(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.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)
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby Hellfish » 24 Sep 2011, 09:24

Works for me here. (The card loading, unable to test the card currently) Try copy pasting from your post into the card file, there may have been an extra line somewhere that mucks things up.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Card Development Questions

Postby Iran » 24 Sep 2011, 23:32

Hellfish wrote:Works for me here. (The card loading, unable to test the card currently) Try copy pasting from your post into the card file, there may have been an extra line somewhere that mucks things up.
It works, I copy the post and test this card (River Kelpie) on forge. It functions well (with persist, flashback, etc...).The only problem I found is when a play lands from my graveyard (with Crucible of Worlds), the first trigger ability of the River Kelpie don't work.
Why? The first trigger ability of the River Kelpie would must works how it is scripted.
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby Jorch72 » 27 Sep 2011, 01:18

I've tried the search function, but it appears that it's not working or what I'm looking for is not here. So, I'll just ask...
Is there any document explaining how to script cards?
Jorch72
 
Posts: 3
Joined: 26 Nov 2009, 15:33
Has thanked: 0 time
Been thanked: 0 time

Re: Card Development Questions

Postby friarsol » 27 Sep 2011, 01:47

Jorch72 wrote:I've tried the search function, but it appears that it's not working or what I'm looking for is not here. So, I'll just ask...
Is there any document explaining how to script cards?
Start here: http://www.slightlymagic.net/wiki/Forge_API

It's not 100% up-to-date but it's a good start. Also, reading existing card scripts can give you an idea of how it works.
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 » 27 Sep 2011, 12:49

Jorch72 wrote:I've tried the search function, but it appears that it's not working or what I'm looking for is not here. So, I'll just ask...
Is there any document explaining how to script cards?
Find a card you like. Search for a similar card that is already scripted. Bear in mind that pretty much all the "easy" cards are done.
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 Iran » 27 Sep 2011, 18:15

friarsol wrote:
jeffwadsworth wrote:
Iran wrote:I see in forge not exists cards like Comet Storm, Conflagrate, Rock Slide, Magmatic Core, Meteor Shower, etc...
Cards that deals X damage divided as you choose among any number of target creatures (and/or players)

Exists any impediments to script then?

Thanks
Check out the java-coded Fireball. No way to script these just yet.
Fireball is actually a different scenario since the number is divided evenly. (I think Fireball might be actually scriptable)

The cards Iran is talking about are "Divide as you choose." We do have a few cards that "fake" this like Pyrotechnics, but this only works for a known amount of damage. It'd be nice to have a "Divided" parameter for Damage and for any other AF that uses it. (PutCounter I think, maybe Pump)
I agree with you, several cards I see use "Divide as you choose" and not known amount of damage that cards causes.
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby Iran » 30 Sep 2011, 16:37

Anyone knows if the parameter RememberDiscarded was placed in AF_Discard?

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

Re: Card Development Questions

Postby slapshot5 » 30 Sep 2011, 19:00

Iran wrote:Anyone knows if the parameter RememberDiscarded was placed in AF_Discard?

thanks
It has not.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby Iran » 01 Oct 2011, 07:33

Exists in forge any keyword or AF that have the effect below?

Target creature blocks CARDNAME this turn if able.

I would like to script Sisters of Stone Death. With her i can do a Gorgon Deck with Gaze of the Gorgon, Gorgon Recluse, Infernal Medusa, etc...

Other card that can use the effect above is Matsu-Tribe Decoy

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

Re: Card Development Questions

Postby slapshot5 » 01 Oct 2011, 18:53

Iran wrote:Exists in forge any keyword or AF that have the effect below?

Target creature blocks CARDNAME this turn if able.

I would like to script Sisters of Stone Death. With her i can do a Gorgon Deck with Gaze of the Gorgon, Gorgon Recluse, Infernal Medusa, etc...

Other card that can use the effect above is Matsu-Tribe Decoy

Thanks
Well, the AF that Gideon Jura uses is meant for this.

Nope, check that. That was for attacks. I'd need to write another AF for blocks in a similar fashion. I'll do that sometime this weekend, but the Brewers are on right now, so it won't be now! :)

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby slapshot5 » 02 Oct 2011, 23:31

I'm trying to add Goblin Sappers:

Code: Select all
Name:Goblin Sappers
ManaCost:1 R
Types:Creature Goblin
Text:no text
PT:1/1
A:AB$ Pump | Cost$ R R T | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ HIDDEN Unblockable | SubAbility$ DestroySelfTgtEOC | SpellDescription$ Target creature you control is unblockable this turn. Destroy it and CARDNAME at end of combat.
SVar:DestroySelfTgtEOC:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Each | Execute$ DestroySelf | TriggerDescription$ Destroy target and CARDNAME.
SVar:DestroySelf:AB$ Destroy | Cost$ 0 | Defined$ Self | SubAbility$ DestroyTgt
SVar:DestroyTgt:DB$ Destroy | Defined$ Targeted
A:AB$ Pump | Cost$ R R R R T | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ HIDDEN Unblockable | SubAbility$ DestroyTgtEOC | SpellDescription$ Target creature you control is unblockable this turn. Destroy it at end of combat.
SVar:DestroyTgtEOC:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Each | Execute$ DestroyOnlyTgt | TriggerDescription$ Destroy target.
SVar:DestroyOnlyTgt:AB$ Destroy | Cost$ 0 | Defined$ Targeted
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_sappers.jpg
End
For the AB$ Destroy, Defined$ Targeted doesn't work. Do I need some kind of Triggered variable here?

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby Iran » 03 Oct 2011, 02:23

slapshot5 wrote:I'm trying to add Goblin Sappers:

Code: Select all
Name:Goblin Sappers
ManaCost:1 R
Types:Creature Goblin
Text:no text
PT:1/1
A:AB$ Pump | Cost$ R R T | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ HIDDEN Unblockable | SubAbility$ DestroySelfTgtEOC | SpellDescription$ Target creature you control is unblockable this turn. Destroy it and CARDNAME at end of combat.
SVar:DestroySelfTgtEOC:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Each | Execute$ DestroySelf | TriggerDescription$ Destroy target and CARDNAME.
SVar:DestroySelf:AB$ Destroy | Cost$ 0 | Defined$ Self | SubAbility$ DestroyTgt
SVar:DestroyTgt:DB$ Destroy | Defined$ Targeted
A:AB$ Pump | Cost$ R R R R T | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ HIDDEN Unblockable | SubAbility$ DestroyTgtEOC | SpellDescription$ Target creature you control is unblockable this turn. Destroy it at end of combat.
SVar:DestroyTgtEOC:DB$ DelayedTrigger | Mode$ Phase | Phase$ EndCombat | ValidPlayer$ Each | Execute$ DestroyOnlyTgt | TriggerDescription$ Destroy target.
SVar:DestroyOnlyTgt:AB$ Destroy | Cost$ 0 | Defined$ Targeted
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/goblin_sappers.jpg
End
For the AB$ Destroy, Defined$ Targeted doesn't work. Do I need some kind of Triggered variable here?

-slapshot5
If you use Defined$ TriggeredSource, Will this works?
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby slapshot5 » 03 Oct 2011, 03:16

Iran wrote:If you use Defined$ TriggeredSource, Will this works?
No, it doesn't. I'm not even sure a triggered variable works here. I don't think that all gets set up in a DelayedTrigger.

I believe Defined$ Targeted is what is desired, but is possibly not preserved (or can't be traced back through) the DelayedTrigger.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby jeffwadsworth » 03 Oct 2011, 04:02

It would be nice if "remembered" was extended to all the AB's.
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 42 guests


Who is online

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

Login Form