It is currently 09 Jun 2025, 19:19
   
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 Jaedayr » 14 Feb 2011, 22:15

Trying to code Consumptive Goo but am getting this error and I am not sure how to proceed.

Code: Select all
java.lang.RuntimeException: AbilityFactory Parsing Error in getAbility() : Split length of SubAbility$AB$PutCounter in Consumptive Goo is not 2.
Code: Select all
Name:Consumptive Goo
ManaCost:B B
Types:Creature Ooze
Text:no text
PT:1/1
A:AB$Pump | Cost$ 2 B B | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ -1 | NumDef$ -1 | SubAbility$ AB$PutCounter | Cost$ 0 | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1 | SpellDescription$ Target creature gets -1/-1 until end of turn. Put a +1/+1 counter on CARDNAME.
SVar:Rarity:Rare
SVar:Picture:http://serv1.tcgimages.eu/img/cards/Portal/consumptive_goo.jpg
SetInfo:SCG|Rare|http://magiccards.info/scans/en/sc/62.jpg
End
Jaedayr
Tester
 
Posts: 523
Joined: 08 Jul 2010, 00:06
Has thanked: 16 times
Been thanked: 13 times

Re: Card Development Questions

Postby friarsol » 14 Feb 2011, 22:28

Code: Select all
A:AB$Pump | Cost$ 2 B B | IsCurse$ True | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumAtt$ -1 | NumDef$ -1 | SpellDescription$ Target creature gets -1/-1 until end of turn. Put a +1/+1 counter on CARDNAME. | SubAbility$ SVar=DBPutCounter
SVar:DBPutCounter:DB$PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Zirbert » 14 Feb 2011, 22:42

Now it's time to play Find Zirbert's Boneheaded Mistake!

I had hoped that this card would work correctly in the new Beta, but no go. No matter what blue creature I sacrifice for this, I get exactly 2 Camarid tokens. Even saccing one of the Camarid tokens gets me 2 more. Why isn't this giving the right number of tokens?

Code: Select all
Name:Homarid Spawning Bed
ManaCost:U U
Types:Enchantment
Text:no text
A:AB$Token | Cost$ 1 U U Sac<1/Creature.Blue> | TokenImage$ U 1 1 Camarid | TokenAmount$ X | TokenName$ Camarid | TokenTypes$ Creature,Camarid | TokenOwner$ Controller | TokenColors$ Blue | TokenPower$ 1 | TokenToughness$ 1 | SpellDescription$ Put X 1/1 blue Camarid creature tokens onto the battlefield, where X is the sacrificed creature's converted mana cost.
SVar:X:Sacrificed$CardManaCost
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/homarid_spawning_bed.jpg
SetInfo:FEM|Uncommon|http://magiccards.info/scans/en/fe/106.jpg
End
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Card Development Questions

Postby friarsol » 14 Feb 2011, 22:53

Zirbert wrote:I had hoped that this card would work correctly in the new Beta, but no go. No matter what blue creature I sacrifice for this, I get exactly 2 Camarid tokens. Even saccing one of the Camarid tokens gets me 2 more. Why isn't this giving the right number of tokens?
It's not you it's AF_Token. I can't do it because I need to make dinner for V-Day for the wife, but see if someone can change all of the CardFactoryUtil.xCount() to Ability_Factory.calculateAmount(). After that happens it should work.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Hellfish » 14 Feb 2011, 23:08

Done!Try the latest revision.
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 Chris H. » 15 Feb 2011, 00:32

friarsol wrote:Why don't we just have the Level Up code add a different LevelUp keyword that doesn't get parsed, but will be handled for the .with<keyword> situation?
`
I have not had a chance to examine the level up keyword code, not sure exactly how much code would have to be modified. If we remove the level up cost after the keyword then I guess we could use AF PutCounter to provide the code to add counters.

I have no idea what else is tied into the existing code. :-k
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 » 15 Feb 2011, 01:50

I'll give the level up a shot later and see if I can do it without being too complex.
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. » 15 Feb 2011, 02:30

friarsol wrote:I'll give the level up a shot later and see if I can do it without being too complex.
`
Yeah, it would be nice to do but it is probably a low priority at this time. We still have a few new cards to add and cards to convert. We also do not want to take you away from adding a few AI improvements to the AFs. :wink:
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 Jaedayr » 16 Feb 2011, 23:07

Trying to model Power of Fire after Arcane Teachings. They are the same with the exception of K:enPump:+2/+2 . Teachings works but Power does not enchant a creature when it is cast. How can I make this work?

Code: Select all
Name:Power of Fire
ManaCost:1 R
Types:Enchantment Aura
Text:no text
K:Enchant creature
K:stPumpEnchanted:Creature:0/0/SVar=Damage:No Condition:Enchanted creature has "tap: This creature deals 1 damage to target creature or player."
SVar:Damage:AB$DealDamage | Cost$ T | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/power_of_fire.jpg
SetInfo:SHM|Common|http://magiccards.info/scans/en/shm/101.jpg
End
Code: Select all
Name:Arcane Teachings
ManaCost:2 R
Types:Enchantment Aura
Text:no text
K:Enchant creature
K:enPump:+2/+2
K:stPumpEnchanted:Creature:0/0/SVar=Damage:No Condition:Enchanted creature has "tap: This creature deals 1 damage to target creature or player."
SVar:Damage:AB$DealDamage | Cost$ T | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/arcane_teachings.jpg
SetInfo:JUD|Common|http://magiccards.info/scans/en/ju/78.jpg
End
Jaedayr
Tester
 
Posts: 523
Joined: 08 Jul 2010, 00:06
Has thanked: 16 times
Been thanked: 13 times

Re: Card Development Questions

Postby lazylockie » 16 Feb 2011, 23:21

Jaedayr wrote:Trying to model Power of Fire after Arcane Teachings. They are the same with the exception of K:enPump:+2/+2 . Teachings works but Power does not enchant a creature when it is cast. How can I make this work?

Code: Select all
Name:Power of Fire
ManaCost:1 R
Types:Enchantment Aura
Text:no text
K:Enchant creature
K:stPumpEnchanted:Creature:0/0/SVar=Damage:No Condition:Enchanted creature has "tap: This creature deals 1 damage to target creature or player."
SVar:Damage:AB$DealDamage | Cost$ T | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/power_of_fire.jpg
SetInfo:SHM|Common|http://magiccards.info/scans/en/shm/101.jpg
End
Code: Select all
Name:Arcane Teachings
ManaCost:2 R
Types:Enchantment Aura
Text:no text
K:Enchant creature
K:enPump:+2/+2
K:stPumpEnchanted:Creature:0/0/SVar=Damage:No Condition:Enchanted creature has "tap: This creature deals 1 damage to target creature or player."
SVar:Damage:AB$DealDamage | Cost$ T | Tgt$ TgtCP | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/arcane_teachings.jpg
SetInfo:JUD|Common|http://magiccards.info/scans/en/ju/78.jpg
End
I think you need to put a K:enPump:0/0 on Power of Fire. Worked for me on other cards like those
lazylockie
 
Posts: 508
Joined: 13 Jul 2010, 22:44
Has thanked: 74 times
Been thanked: 15 times

Re: Card Development Questions

Postby jeffwadsworth » 17 Feb 2011, 02:03

Okay, this one is baffling. Here is a card that is being converted to script. The trigger goes off but I am not allowed to see the library, etc. It just fizzles after the cost is paid. What am I missing? Bear in mind, you must remove all code related to the card in the source.

Code: Select all
Name:Rootwater Thief
ManaCost:1 U
Types:Creature Merfolk Rogue
Text:no text
PT:1/2
A:AB$Pump | Cost$ U | KW$ Flying | SpellDescription$ CARDNAME gains flying until end of turn.
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Opponent | Optional$ True | CombatDamage$ True | Execute$ TrigSearchExile | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, you may pay 2.  If you do, search that player's library for a card and exile it, then the player shuffles his or her library.
SVar:TrigSearchExile:AB$ChangeZone | Cost$ 2 | Origin$ Library | Destination$ Exile | Defined$ Opponent | ChangeNum$ 1 | ChangeType$ Card | Shuffle$ True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/rootwater_thief.jpg
SetInfo:NMS|Rare|http://magiccards.info/scans/en/ne/40.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 Zirbert » 17 Feb 2011, 04:50

I'm interested in tackling some cards that exile from the graveyard as a cost, but I'd like to know more about the syntax / parameters. I've looked at Grim Lavamancer and Psychatog in the changelog, and it seems pretty straightforward. I'd just like to know a bit more before I start experimenting. I don't mind doing some trial-and-error, but if these are easily answered by people who understand the engine better than I do, I also don't mind just finding out first! :-)

- What does "AI is WIP", from r6452's header, mean?

- Can the card types be specified? So far the examples are of the form "ExileFromGrave<2/Card>". Would "ExileFromGrave<2/Artifact>" require exiling 2 artifacts, ExileFromGrave<1/Creature> (or maybe <1/Card.Creature>) require exiling 1 creature card, etc.?

- I assume this defaults to exiling cards from my own graveyard; is there syntax for a cost of "exile a card from an opponent's graveyard", or "exile a card from any graveyard"? I don't think any cards exist with that sort of cost, but I'd like to get a handle on the syntax. You also never know where Wizards will go with future design.

-Zirbert, who has had his eye on coding Bearscape for a while...
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Card Development Questions

Postby friarsol » 17 Feb 2011, 04:55

Zirbert wrote:- I assume this defaults to exiling cards from my own graveyard; is there syntax for a cost of "exile a card from an opponent's graveyard", or "exile a card from any graveyard"? I don't think any cards exist with that sort of cost, but I'd like to get a handle on the syntax. You also never know where Wizards will go with future design.
And that's where you'd be wrong: Night Soil.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Zirbert » 17 Feb 2011, 05:17

friarsol wrote:
Zirbert wrote:- I assume this defaults to exiling cards from my own graveyard; is there syntax for a cost of "exile a card from an opponent's graveyard", or "exile a card from any graveyard"? I don't think any cards exist with that sort of cost, but I'd like to get a handle on the syntax. You also never know where Wizards will go with future design.
And that's where you'd be wrong: Night Soil.
Quite right! And ironically, that's been one of my favourite cards since it was first printed, a staple in almost every green deck I've ever built. It's been errata'ed over the years as to whether the removal is a cost or an effect, but it's definitely established as a cost now.

So, can we now script this one?
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Card Development Questions

Postby Sloth » 17 Feb 2011, 06:25

Zirbert wrote:Quite right! And ironically, that's been one of my favourite cards since it was first printed, a staple in almost every green deck I've ever built. It's been errata'ed over the years as to whether the removal is a cost or an effect, but it's definitely established as a cost now.

So, can we now script this one?
No, it's restricted to your own graveyard. Types work as you descibe though (ExileFromGrave<2/Artifact> and ExileFromGrave<1/Creature>). This time I even updated the Wiki.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 57 guests


Who is online

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

Login Form