It is currently 11 Jun 2025, 05:53
   
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 Hellfish » 03 Feb 2011, 22:29

I would do that with multiple triggers, like so:
Code: Select all
Name:Kalastria Highborn
ManaCost:B B
Types:Creature Vampire Shaman
Text:no text
PT:2/2
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Vampire.YouCtrl | Execute$ TrigLoseLife | TriggerZones$ Battlefield | Optional$ True | TriggerDescription$ Whenever CARDNAME or another Vampire you control is put into a graveyard from the battlefield, you may pay B.  If you do, target player loses 2 life and you gain 2 life.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigLoseLife | Optional$ True | Secondary$ True | TriggerDescription$ Whenever CARDNAME or another Vampire you control is put into a graveyard from the battlefield, you may pay B.  If you do, target player loses 2 life and you gain 2 life.
SVar:TrigLoseLife:AB$LoseLife | Cost$ B | ValidTgts$ Player | TgtPrompt$ Select target player | LifeAmount$ 2 | SubAbility$ SVar=DBGainLife
SVar:DBGainLife:DB$GainLife | Defined$ You | LifeAmount$ 2
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/kalastria_highborn.jpg
End
Not tested,sorry, I can't "install" programs on this comp. :/
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 friarsol » 03 Feb 2011, 22:40

Chris H. wrote:I am in the process of attempting to convert Meadowboon to script via Trigger. I have worked on this for far too long. :) I changed the Meadowboon txt file to look like this:
Alright Chris. Here's the long and short of it.

The short: this is part of issue 111 (http://code.google.com/p/cardforge/issues/detail?id=111) where we need Targeting in All to further restrict the ValidCard.

The long: I'll code up PutCounterAll to accept a target, but I won't be able to do the others for some time since I'm still wrapped in Triggers/AI stuff. The AI is still ignoring certain mandatory triggers (it's dependent on the AF) so it might be harder to confirm it's doing things right, but I'm fairly certain it is. For PutCountersAll that Target make sure to set the IsCurse$ parameter if the AI should be targeting the Human. (This should be the last puzzle piece to get Contagion Engine working)

Here is the final version of the Meadowboon (which i just submitted).
Code: Select all
Name:Meadowboon
ManaCost:2 W W
Types:Creature Elemental
Text:no text
PT:3/3
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigPutCounterAll | TriggerDescription$ When CARDNAME leaves the battlefield, put a +1/+1 counter on each creature target player controls.
K:Evoke:3 W
SVar:TrigPutCounterAll:AB$PutCounterAll | Cost$ 0 | ValidTgts$ Player | TgtPrompt$ Select a player | ValidCards$ Creature | CounterType$ P1P1 | CounterNum$ 1
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self+evoked | Execute$ TrigSac | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield, if you cast it by it's evoke cost, sacrifice it.
SVar:TrigSac:AB$Sacrifice | Cost$ 0
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/meadowboon.jpg
SetInfo:MOR|Uncommon|http://magiccards.info/scans/en/mt/17.jpg
End
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. » 03 Feb 2011, 23:04

I took a second look at issue 111, I saw it recently but conveniently forgot about it. :) There has been a lot of ongoing work and it is hard for me to keep up on all of it.

And thank you for the PutCounterAll target addition. There are still a few evoke cards to add. Mainly the leaves the battlefield type. While we still have a ways to go before the AF work is finished, the Evoke portion is looking pretty good.

I noticed several days ago that there was only one card appearing in the deck editor when I filtered on "Evoke" typed into the text box filter. We now have a nice list of Evoke cards for people to find. :)

And thank you once again for your help.
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. » 04 Feb 2011, 03:07

I scripted the following card and ran a play test. The card works for me. I get to pick the player and the target player discards two cards. The AI evokes the creature and I do not discard two cards. I am not sure what is wrong.

Code: Select all
Name:Mournwhelk
ManaCost:6 B
Types:Creature Elemental
Text:no text
PT:3/3
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDiscard | TriggerDescription$ When CARDNAME enters the battlefield, target player discards two cards.
SVar:TrigDiscard:AB$Discard | Cost$ 0 | ValidTgts$ Player | TgtPrompt$ Select target player | NumCards$ 2 | Mode$ TgtChoose
K:Evoke:3 B
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self+evoked | Execute$ TrigSac | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield, if you cast it by it's evoke cost, sacrifice it.
SVar:TrigSac:AB$Sacrifice | Cost$ 0
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/mournwhelk.jpg
End
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. » 04 Feb 2011, 16:04

Chris H. wrote:I scripted the following card and ran a play test. The card works for me. I get to pick the player and the target player discards two cards. The AI evokes the creature and I do not discard two cards. I am not sure what is wrong.

Code: Select all
Name:Mournwhelk
ManaCost:6 B
Types:Creature Elemental
Text:no text
PT:3/3
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDiscard | TriggerDescription$ When CARDNAME enters the battlefield, target player discards two cards.
SVar:TrigDiscard:AB$Discard | Cost$ 0 | ValidTgts$ Player | TgtPrompt$ Select target player | NumCards$ 2 | Mode$ TgtChoose
K:Evoke:3 B
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self+evoked | Execute$ TrigSac | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield, if you cast it by it's evoke cost, sacrifice it.
SVar:TrigSac:AB$Sacrifice | Cost$ 0
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/mournwhelk.jpg
End
`
I did some investigation and discovered that Mournwhelk is not the only card with this problem. I put together a test deck with Abyssal Horror. This card also has a "When CARDNAME enters the battlefield, target player discards two cards." type of ability.

When I summon the Abyssal Horror, I can target the computer and the computer will discard two cards. When the computer summons the Abyssal Horror no cards are discarded by either player. And I do not receive a prompt to select the cards to discard.

I am starting to suspect that there may be a bug in AF Discard with the AI portion of the resolve code. I have not had a chance to check whether or not this bug is also affecting other types of discard such as random.

Code: Select all
Name:Abyssal Horror
ManaCost:4 B B
Types:Creature Horror
Text:no text
PT:2/2
K:Flying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDiscard | TriggerDescription$ When CARDNAME enters the battlefield, target player discards two cards.
SVar:TrigDiscard:AB$Discard | Cost$ 0 | Tgt$ TgtP | NumCards$ 2 | Mode$ TgtChoose
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/abyssal_horror.jpg
SetInfo:USG|Rare|http://magiccards.info/scans/en/us/115.jpg
SetInfo:S99|Rare|http://magiccards.info/scans/en/st/63.jpg
SetInfo:7ED|Rare|http://magiccards.info/scans/en/7e/115.jpg
End
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 » 04 Feb 2011, 16:09

Chris H. wrote:I am starting to suspect that there may be a bug in AF Discard with the AI portion of the resolve code. I have not had a chance to check whether or not this bug is also affecting other types of discard such as random.
Can you test some other ETB cards that target that aren't discarding? Some Deal Damage ones should work fine. That will give us a better idea if it's Discard, or if it's an issue with targeting by the AI in relation to Trigger.
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. » 04 Feb 2011, 18:21

friarsol wrote:Can you test some other ETB cards that target that aren't discarding? Some Deal Damage ones should work fine. That will give us a better idea if it's Discard, or if it's an issue with targeting by the AI in relation to Trigger.
`
I put together a test deck for the computer and the deck contains the following cards with an EtB trigger which triggers a targeted AF ab:

AEthersnipe
Briarhorn
Contagion Clasp
Blisterstick Shaman
Acidic Slime
Bloodhusk Ritualist
Akoum Boulderfoot
Avalanche Riders

I closely watched as the computer brought each of these cards into play. None of the targeted AF ab's resolved.
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 » 04 Feb 2011, 18:38

Chris H. wrote:I closely watched as the computer brought each of these cards into play. None of the targeted AF ab's resolved.
Thanks for running. When I added to DoTrigger code the other day, I forgot to add it into the Trigger wrapper ability, so it was always returning false. I just tested Ghitu Slinger and Contagion Clasp and both now work. Rerun your tests and see if you get better results.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Jaedayr » 04 Feb 2011, 19:54

This seems to work fine but I have questions before I commit it.

The text on the triggers is split while the card text is not. Is this how it should be done?
I have two triggers for the same effect. Is this OK?
Is the spell description on TrigReturn needed?

Code: Select all
Name:Deadwood Treefolk
ManaCost:5 G
Types:Creature Treefolk
Text:no text
PT:3/6
K:Vanishing:3
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigReturn | TriggerDescription$ When CARDNAME enters the battlefield, return another target creature card from your graveyard to your hand.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigReturn | TriggerDescription$ When CARDNAME leaves the battlefield, return another target creature card from your graveyard to your hand.
SVar:TrigReturn:AB$ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Hand | TgtPrompt$ Choose target creature card in your graveyard | ValidTgts$ Creature.Other+YouCtrl | SpellDescription$ When CARDNAME enters the battlefield or leaves the battlefield, return another target creature card from your graveyard to your hand.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/deadwood_treefolk.jpg
SetInfo:PLC|Uncommon|http://magiccards.info/scans/en/pc/126.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 Chris H. » 04 Feb 2011, 19:55

friarsol wrote:When I added to DoTrigger code the other day, I forgot to add it into the Trigger wrapper ability, so it was always returning false. I just tested Ghitu Slinger and Contagion Clasp and both now work. Rerun your tests and see if you get better results.
`
Looks like Targeted AF $Destroy is not resolving. The other AFs in the deck now appear to be working for the computer.
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 Hellfish » 04 Feb 2011, 20:06

Jaedayr wrote:This seems to work fine but I have questions before I commit it.

The text on the triggers is split while the card text is not. Is this how it should be done?
I have two triggers for the same effect. Is this OK?
Is the spell description on TrigReturn needed?

Code: Select all
Name:Deadwood Treefolk
ManaCost:5 G
Types:Creature Treefolk
Text:no text
PT:3/6
K:Vanishing:3
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigReturn | TriggerDescription$ When CARDNAME enters the battlefield, return another target creature card from your graveyard to your hand.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigReturn | TriggerDescription$ When CARDNAME leaves the battlefield, return another target creature card from your graveyard to your hand.
SVar:TrigReturn:AB$ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Hand | TgtPrompt$ Choose target creature card in your graveyard | ValidTgts$ Creature.Other+YouCtrl | SpellDescription$ When CARDNAME enters the battlefield or leaves the battlefield, return another target creature card from your graveyard to your hand.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/deadwood_treefolk.jpg
SetInfo:PLC|Uncommon|http://magiccards.info/scans/en/pc/126.jpg
End
Give one of the triggers the parameter "Secondary$ True". That will cause it not to show in the card text but function normally otherwise.
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 friarsol » 04 Feb 2011, 20:10

Chris H. wrote:Looks like Targeted AF $Destroy is not resolving. The other AFs in the deck now appear to be working for the computer.
Looks like the hooks in Destroy were submitted without being finished. I'll do these before I do anything else.
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. » 04 Feb 2011, 20:35

Thank you Sol. :D
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 jeffwadsworth » 05 Feb 2011, 05:25

How would you script an opponent taking control of a permanent you control? Testing Witch Engine.
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 Feb 2011, 05:37

jeffwadsworth wrote:How would you script an opponent taking control of a permanent you control? Testing Witch Engine.
Urg. I forgot about that subability. Skip that for now. GainControl needs to be able to take a parameter for that.
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: steelersfanovews and 16 guests


Who is online

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

Login Form