It is currently 07 Jun 2025, 17:51
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: Adding a new card

Postby ArsenalNut » 28 Aug 2011, 17:24

Ivalen wrote:Do I need a full blown development environment to add a new card, or is it simply a matter of correctly formatting a .txt file in the cardsfolder tree?

If it's the second, then when I run Forge I cannot get it to recognize the following attempt to half-implement Searing Blaze.

Code: Select all
Name:Searing Blaze
ManaCost:2 R
Types:Instant
Text:no text
A:SP$ DealDamage | Cost$ 2 R | Tgt$ TgtC | numDmg$ X | SubAbility$ SVar=Targetplayer | SpellDescription$ CARDNAME deals 1 damage to target creature or 3 damage to target creature if a land was played this turn.
SVar:Targetplayer | SP$ DealDamage | Cost$ 2 R | Tgt$ TgtP | numDmg$ X | SpellDescription$ CARDNAME deals 1 damage to target creature's controller or 3 damage to creature's controller if a land was played this turn.
SVar:X:Count$Landfall.3.1
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/searing_blaze.jpg
SetInfo:WWK|Common|http://magiccards.info/scans/en/wwk/90.jpg
End
Do you have cardsfolder.zip in the the cardsfolder directory? If so, move it somewhere else. Forge reads the cards from the zip file and ignores the directories if the zip file is there. Been there, done that #-o

You have a syntax problem with your subability. It should be
Code: Select all
SVar:Targetplayer:DB$ DealDamage ...
Also the order of the targeting should be reversed. Target the player first then the creature. Order will matter when there's a way to filter the target creature list by targeted controller.

There's another gotcha that I just noticed. TgtP will let you target a planeswalker which is not a valid target for the spell.

Eventually I think the snippet for the spell ability should look like
Code: Select all
A:SP$ DealDamage | Cost$ 2 R | VaildTgts$ Player | TgtPrompt$ Choose target player | numDmg$ X | SubAbility$ SVar=TargetCreature | SpellDescription$ CARDNAME deals 1 damage to target player or 3 damage to target player if a land was played this turn.
SVar:TargetCreature:DB$ DealDamage | Cost$ 2 R | ValidTgts$ Creature.TargetedCtrl| TgtPrompt$ Choose a creature the targeted player controls | numDmg$ X | SpellDescription$ CARDNAME deals 1 damage to creature targeted player controls or 3 damage to targeted player controls if a land was played this turn.
Right now "TargetedCtrl" isn't a supported property, so you could just use "Creature" for a partially implemented card. I am going to look at what it would take to add the TargetedCtrl property.

I like the way Landfall is handled. I hadn't seen that before.
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: Adding a new card

Postby ArsenalNut » 28 Aug 2011, 18:23

ArsenalNut wrote:Right now "TargetedCtrl" isn't a supported property, so you could just use "Creature" for a partially implemented card. I am going to look at what it would take to add the TargetedCtrl property.
It doesn't look like there's simple way to add the property because of the way targeting is handled.
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 Ivalen » 28 Aug 2011, 21:24

Thanks for checking ArsenalNut - I'll test out the card along with the changes you stated.

It seems that for the first two cards I need I picked doozies. My second one I wanted it Staggershock, it's one of the few Rebound cards out there. I haven't found any of them to be implemented so I was wondering if it's even possible?

Staggershock deals 2 damage to target creature or player.

Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.)
Ivalen
 
Posts: 22
Joined: 23 Jan 2011, 15:19
Has thanked: 0 time
Been thanked: 0 time

Re: Card Development Questions

Postby ArsenalNut » 29 Aug 2011, 03:07

Ivalen wrote:It seems that for the first two cards I need I picked doozies. My second one I wanted it Staggershock, it's one of the few Rebound cards out there. I haven't found any of them to be implemented so I was wondering if it's even possible?
It's not surprising that you picked some tough ones, that's about all that's left.

I tried to script rebound. I could do everything except cast the card from exile. Apparently moving a card from exile to the stack doesn't actually cast it :oops: I also tried faking it with CopySpell but it doesn't work quite according to the card rulings on Rebound. It looks like Rebound would need to be hard coded like Flashback.
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 ArsenalNut » 29 Aug 2011, 03:14

Working on Molten Sentry. I have everything working but I have a rules question before I check it in.

Molten Sentry has types Creature and Elemental but the card text only mentions Creature when talks about entering the battlefield. Does Molten Sentry keep its Elemental creature type when it enters the battlefield? I tried to find this in the comprehensive rules without luck. A pointer to a section that covers this would be appreciated.
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 » 29 Aug 2011, 03:18

ArsenalNut wrote: It looks like Rebound would need to be hard coded like Flashback.
Funnily enough, Flashback doesn't need to be hardcoded, but Rebound needs two primary additions. Checking that a Spell was cast from the hand (which doesn't really exist right now), and a Cast/Play AbilityFactory. This AF is one of the last major ones I'd think we have left, and it's a bit tricky due to some older code in this section of the engine.

Occasionally I go through sets and try to find cards I think are Scriptable. If people have sets they'd prefer to see cards from I can do a few of those as possible Scriptables as my next few.
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 » 31 Aug 2011, 18:03

A few cards off the "Not quite scriptable" list that I think are doable now.
Code: Select all
Dermoplasm
Dusk Urchins
Grief Tyrant
Kinsbaile Borderguard
Private Research
Revered Unicorn
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 jeffwadsworth » 31 Aug 2011, 19:08

Hellfish wrote:A few cards off the "Not quite scriptable" list that I think are doable now.
Code: Select all
Dermoplasm
Dusk Urchins
Grief Tyrant
Kinsbaile Borderguard
Private Research
Revered Unicorn
If Revered Unicorn is doable, there are quite a few on that list with the same tech.
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 Hellfish » 31 Aug 2011, 19:39

I'm pretty sure it's doable.The recent LKI-related commits should see to that.
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 » 02 Sep 2011, 04:07

I Tried to scripting Blowfly Infestation and Incremental Blight I make these scripts =>

Name:Blowfly Infestation
ManaCost:2 B
Types:Enchantment
Text:no text
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.countersGE1M1M1| Execute$ TrigPutCounter | TriggerDescription$ Whenever a creature dies, if it had a -1/-1 counter on it, put a -1/-1 counter on target creature.
SVar:TrigPutCounter:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ M1M1 | CounterNum$ 1 | IsCurse$ True
End

Name:Incremental Blight
ManaCost:3 B B
Types:Sorcery
Text:no text
A:SP$ PutCounter | Cost$ 3 B B | ValidTgts$ Creature | TgtPrompt$ Select target creature (one -1/-1) | CounterType$ M1M1 | CounterNum$ 1 | IsCurse$ True | SubAbility$ SVar=DBPutCounter | SpellDescription$ Put a -1/-1 counter on target creature,
SVar:DBPutCounter:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature (two -1/-1) | CounterType$ M1M1 | CounterNum$ 2 | IsCurse$ True | SubAbility$ SVar=DBPutCounter1 | SpellDescription$ two -1/-1 counters on another target creature,
SVar:DBPutCounter1:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature (three -1/-1) | CounterType$ M1M1 | CounterNum$ 3 | IsCurse$ True | SpellDescription$ and three -1/-1 counters on a third creature.
End

Are these scripts correct?

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

Re: Card Development Questions

Postby Sloth » 02 Sep 2011, 06:49

Iran wrote:I Tried to scripting Blowfly Infestation and Incremental Blight I make these scripts =>

Name:Blowfly Infestation
ManaCost:2 B
Types:Enchantment
Text:no text
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.countersGE1M1M1| Execute$ TrigPutCounter | TriggerDescription$ Whenever a creature dies, if it had a -1/-1 counter on it, put a -1/-1 counter on target creature.
SVar:TrigPutCounter:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ M1M1 | CounterNum$ 1 | IsCurse$ True
End

Name:Incremental Blight
ManaCost:3 B B
Types:Sorcery
Text:no text
A:SP$ PutCounter | Cost$ 3 B B | ValidTgts$ Creature | TgtPrompt$ Select target creature (one -1/-1) | CounterType$ M1M1 | CounterNum$ 1 | IsCurse$ True | SubAbility$ SVar=DBPutCounter | SpellDescription$ Put a -1/-1 counter on target creature,
SVar:DBPutCounter:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature (two -1/-1) | CounterType$ M1M1 | CounterNum$ 2 | IsCurse$ True | SubAbility$ SVar=DBPutCounter1 | SpellDescription$ two -1/-1 counters on another target creature,
SVar:DBPutCounter1:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature (three -1/-1) | CounterType$ M1M1 | CounterNum$ 3 | IsCurse$ True | SpellDescription$ and three -1/-1 counters on a third creature.
End

Are these scripts correct?

thanks
Blowfly Infestation was almost correct: the trigger was missing "TriggerZones$ Battlefield" (without this it would trigger from your library). I've added it to the SVN. Thank you Iran.

Incremental Blight is not scriptable at the moment, because currently you could target the same creature again (and it's not supposed to be castable if only one target is available).
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 Iran » 02 Sep 2011, 12:58

Sloth wrote:Incremental Blight is not scriptable at the moment, because currently you could target the same creature again (and it's not supposed to be castable if only one target is available).
I have some ideas to script Incremental Blight:
1) I verified if exists three or more creatures on the battlefield when the Incremental is resolve (if not exists the spell doesn't work)
2) I stored the card id of the first creature when i choose the second creature i compare: card id of the second creature is diferent of card id of the second creature and i stored the card id of the second creature, when i choose the third creature i compare: card id of the third creature is diferent of the card id of the first creature and is diferent of the card id of the second creature.

Choose the first creature (stored id)
second creature id <> first creature id (To choose the second creature) (stored id second creature)
third creature id is <> first creature id and is <> second creature id (To Choose the third creature)

Is this possible to work?
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby friarsol » 02 Sep 2011, 13:44

I'm pretty sure Incremental Blight needs changes in the Targeting code, not additions to the script.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby ArsenalNut » 02 Sep 2011, 14:51

friarsol wrote:I'm pretty sure Incremental Blight needs changes in the Targeting code, not additions to the script.
I agree with Friarsol. You definitely can't use the IsRemembered property because objects are not added to the "remembered" list until the spell resolution process. I looked at adding an IsTargeted property for a similar situation. There wasn't an easy way to do it because of the way targeting is currently handled.
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 » 02 Sep 2011, 15:08

ArsenalNut wrote:
friarsol wrote:I'm pretty sure Incremental Blight needs changes in the Targeting code, not additions to the script.
I agree with Friarsol. You definitely can't use the IsRemembered property because objects are not added to the "remembered" list until the spell resolution process. I looked at adding an IsTargeted property for a similar situation. There wasn't an easy way to do it because of the way targeting is currently handled.
I'll take a look at it, since Target is one of mine. Does an Issue already exist for this?
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 40 guests


Who is online

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

Login Form