It is currently 17 Sep 2025, 05:48
   
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 moomarc » 21 May 2012, 12:36

I've managed to get Squee's script for Aquamorph Entity working and interacting with cards like Mighty Emergence correctly with the following:
Code: Select all
Name:Aquamorph Entity
ManaCost:2 U U
Types:Creature Shapeshifter
Text:no text
PT:*/*
K:Morph:2 U
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ MorphChoice | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield or is turned face up, it becomes your choice of 5/1 or 1/5.
T:Mode$ TurnFaceUp | ValidCard$ Card.Self | Execute$ MorphChoice | Secondary$ True | Static$ True | TriggerDescription$ When CARDNAME enters the battlefield or is turned face up, it becomes your choice of 5/1 or 1/5.
SVar:MorphChoice:AB$ Charm | Cost$ 0 | Defined$ You | Choices$ BigPower,BigTough | CharmNum$ 1
SVar:BigPower:DB$ Animate | Defined$ Self | Permanent$ True | Power$ 5 | Toughness$ 1 | CharacteristicDefining$ True | SpellDescription$ CARDNAME is 5/1
SVar:BigTough:DB$ Animate | Defined$ Self | Permanent$ True | Power$ 1 | Toughness$ 5 | CharacteristicDefining$ True | SpellDescription$ CARDNAME is 1/5
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/aquamorph_entity.jpg
SetInfo:PLC|Common|http://magiccards.info/scans/en/pc/33.jpg
Oracle:As Aquamorph Entity enters the battlefield or is turned face up, it becomes your choice of 5/1 or 1/5.\nMorph {2}{U} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)
End
You'll notice that I added a CharacteristicDefining parameter to the animate lines that are set up the same as in Static Continuous effects in that it sets BaseAttack and BaseToughness. Is this necessary? It works without that modification but generally */* have the CharacteristicDefining param so I figured there might be a reason, and just wanted to check here before committing code that might be redundant or unnecessary.

The code for the param in AbilityFactoryAnimate is:
Code: Select all
        if ((power != -1) || (toughness != -1)) {
            if (params.containsKey("CharacteristicDefining")) {
                if (power != -1) {
                    c.setBaseAttack(power);
                }
                if (toughness != -1) {
                    c.setBaseDefense(toughness);
                }
            } else {
                c.addNewPT(power, toughness, timestamp);
            }
        }
Edit: I've added the cards without the CharacteristicDefining param for now. If it turns out that there is a reason to set the base attributes like this then let me know.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby ArsenalNut » 22 May 2012, 13:55

Is there any reason that the entering battlefield portion of Primal Beyond shouldn't be handled with the following static trigger?
Primal Beyond script snippet | Open
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigReveal | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, you may reveal an Elemental card from your hand. If you don't, CARDNAME enters the battlefield tapped.
SVar:TrigReveal:AB$ Reveal | Cost$ 0 | RememberRevealed$ True | RevealValid$ Card.Elemental | Defined$ You | SubAbility$ DBTap
SVar:DBTap:DB$ Tap | Defined$ Self | SubAbility$ DBCleanup | ConditionCheckSVar$ X | ConditionSVarCompare$ LT1
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Remembered$Amount

The other creature lands in this cycle are currently hard coded.
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 moomarc » 22 May 2012, 14:19

Is Antagonism too unfair on the AI? I've added svars to Squee's script that will only let the AI cast it if he's dealt damage to the player that turn so it won't be burnt first turn. Also made it a RemRandomDeck because I think in the right decks the AI can make it work.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby friarsol » 22 May 2012, 14:37

ArsenalNut wrote:Is there any reason that the entering battlefield portion of Primal Beyond shouldn't be handled with the following static trigger?
I guess the main question is: Does this static ability cause a "tapped" trigger? You can test this with putting a Manabarbs in play, and then playing one of those with your script. If it works, then we should be able to replace those.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby squee1968 » 22 May 2012, 15:24

friarsol wrote:
ArsenalNut wrote:Is there any reason that the entering battlefield portion of Primal Beyond shouldn't be handled with the following static trigger?
I guess the main question is: Does this static ability cause a "tapped" trigger? You can test this with putting a Manabarbs in play, and then playing one of those with your script. If it works, then we should be able to replace those.
I think it should also be tested with Freyalise's Winds. Because it should enter the battlefield already tapped, not enter and then get tapped because you couldn't reveal.
squee1968
 
Posts: 254
Joined: 18 Nov 2011, 03:28
Has thanked: 110 times
Been thanked: 45 times

Re: Card Development Questions

Postby ArsenalNut » 22 May 2012, 15:50

squee1968 wrote:
friarsol wrote:
ArsenalNut wrote:Is there any reason that the entering battlefield portion of Primal Beyond shouldn't be handled with the following static trigger?
I guess the main question is: Does this static ability cause a "tapped" trigger? You can test this with putting a Manabarbs in play, and then playing one of those with your script. If it works, then we should be able to replace those.
I think it should also be tested with Freyalise's Winds. Because it should enter the battlefield already tapped, not enter and then get tapped because you couldn't reveal.
Good call on Freyalise's Winds. The static trigger script does cause a wind counter to be added. The bad news is that is the other hard coded lands in this cycle also get a counter if they come into play tapped. I suspect that any of the lands that have a conditional enter the battlefield tapped have the same issue.
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 Sloth » 22 May 2012, 16:06

ArsenalNut wrote:Good call on Freyalise's Winds. The static trigger script does cause a wind counter to be added. The bad news is that is the other hard coded lands in this cycle also get a counter if they come into play tapped. I suspect that any of the lands that have a conditional enter the battlefield tapped have the same issue.
I've just fixed the rest of the cycle, maybe AF PermanentState can have a parameter to do this too.
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 ArsenalNut » 22 May 2012, 16:19

Sloth wrote:
ArsenalNut wrote:Good call on Freyalise's Winds. The static trigger script does cause a wind counter to be added. The bad news is that is the other hard coded lands in this cycle also get a counter if they come into play tapped. I suspect that any of the lands that have a conditional enter the battlefield tapped have the same issue.
I've just fixed the rest of the cycle, maybe AF PermanentState can have a parameter to do this too.
I checked the other lands with conditional enter the battlefield tapped and none of them had issues.
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 » 22 May 2012, 17:02

moomarc wrote:I've managed to get Squee's script for Aquamorph Entity working and interacting with cards like Mighty Emergence correctly with the following:
Hey moomarc (or someone else), if you have some time can you test a similar script for Clones and this ability? I'd recommend doing it like this: temporarily comment out Clone to go through the codebase it is now. Then use CopyPermanent + Defined$ Self with the same ETB Static that you did for Primal Clay in script form. Test out things like: Dying to being 0/0 when cast, dying to being 0/0 when entering via somewhere else, triggering copied ETB effects. If we could script the Clones this way, it would simplify a lot of repetitive bug reports.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby moomarc » 22 May 2012, 17:46

friarsol wrote:
moomarc wrote:I've managed to get Squee's script for Aquamorph Entity working and interacting with cards like Mighty Emergence correctly with the following:
Hey moomarc (or someone else), if you have some time can you test a similar script for Clones and this ability? I'd recommend doing it like this: temporarily comment out Clone to go through the codebase it is now. Then use CopyPermanent + Defined$ Self with the same ETB Static that you did for Primal Clay in script form. Test out things like: Dying to being 0/0 when cast, dying to being 0/0 when entering via somewhere else, triggering copied ETB effects. If we could script the Clones this way, it would simplify a lot of repetitive bug reports.
I'll get on it first thing in the morning. Would be great to stop seeing Clone and Phyrexian Metamorph constantly in the bug reports.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby moomarc » 23 May 2012, 15:13

@Sol: I had a look and tried a few things this morning but as soon as targeting is involved the P/T seems to be checked so the clone dies. So I spent a few hours trying to add AnimateClone AF to AbilityFactoryAnimate but I couldn't get it to work because of the die-while-targeting issue. I decided to base it on the Animate AF because it seems to handle everything between zones well and has the infrastructure in for the individual cloner abilities like adding extra triggers etc.

Further testing seems to indicate that the issue is with targeting with a static trigger. If I remove the Static$True param (and give a toughness GE1) the clone AF I was working on passes begin. So we might have to add something like:
Code: Select all
SVar:HasTargetedETBEffect | ValidTgts$ Artifact,Creature | TgtPrompt$ Select target artifact or creature to clone
which would allow you to select a target when the destination zone the battlefield. That would create a Defined-type target that can be called by the AF:
Code: Select all
Name:Phyrexian Metamorph
ManaCost:3 PU
Types:Artifact Creature Shapeshifter
Text:no text
PT:2/2
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ETBMetamorphClone | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
SVar:ETBMetamorphClone:DB$ AnimateClone | Defined$ ETBTgt | TgtPrompt$ Select target artifact or creature to clone
SVar:HasTargetedETBEffect | ValidTgts$ Artifact,Creature | TgtPrompt$ Select target artifact or creature to clone
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_metamorph.jpg
SetInfo:NPH|Rare|http://magiccards.info/scans/en/nph/42.jpg
Oracle:({U/P} can be paid with either {U} or 2 life.)\nYou may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
End
In the end it just needs a dedicated factory though. I might have some fun trying to teach myself a bit more coding by tinkering with this, but don't wait up for me. If anyone that actually knows what they're doing wants to do it, go for it!
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby friarsol » 23 May 2012, 15:38

moomarc wrote:@Sol: I had a look and tried a few things this morning but as soon as targeting is involved the P/T seems to be checked so the clone dies. So I spent a few hours trying to add AnimateClone AF to AbilityFactoryAnimate but I couldn't get it to work because of the die-while-targeting issue. I decided to base it on the Animate AF because it seems to handle everything between zones well and has the infrastructure in for the individual cloner abilities like adding extra triggers etc.
I see you're main problem. Clone doesn't target, but you may be right that it's not possible. You would need to select a valid type (creatures for clone, lands for Vesuva, etc) as part of the resolution, probably through a CloneValid$ or similar parameter.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Sloth » 23 May 2012, 15:48

friarsol wrote:
moomarc wrote:@Sol: I had a look and tried a few things this morning but as soon as targeting is involved the P/T seems to be checked so the clone dies. So I spent a few hours trying to add AnimateClone AF to AbilityFactoryAnimate but I couldn't get it to work because of the die-while-targeting issue. I decided to base it on the Animate AF because it seems to handle everything between zones well and has the infrastructure in for the individual cloner abilities like adding extra triggers etc.
I see you're main problem. Clone doesn't target, but you may be right that it's not possible. You would need to select a valid type (creatures for clone, lands for Vesuva, etc) as part of the resolution, probably through a CloneValid$ or similar parameter.
Use AF ChooseCard.
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 friarsol » 23 May 2012, 15:59

Sloth wrote:Use AF ChooseCard.
Man I feel so out of the loop with some of these new AbilityFactories.
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 » 24 May 2012, 04:36

Sloth wrote:
friarsol wrote:
moomarc wrote:@Sol: I had a look and tried a few things this morning but as soon as targeting is involved the P/T seems to be checked so the clone dies. So I spent a few hours trying to add AnimateClone AF to AbilityFactoryAnimate but I couldn't get it to work because of the die-while-targeting issue. I decided to base it on the Animate AF because it seems to handle everything between zones well and has the infrastructure in for the individual cloner abilities like adding extra triggers etc.
I see you're main problem. Clone doesn't target, but you may be right that it's not possible. You would need to select a valid type (creatures for clone, lands for Vesuva, etc) as part of the resolution, probably through a CloneValid$ or similar parameter.
Use AF ChooseCard.
I did a test with the following script
clone test | Open
Name:Clone Test
ManaCost:1 U
Types:Creature Illusion
Text:no text
PT:0/0
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have Phantasmal Image enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it."
SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature | SubAbility$ DBCopy | RememberChosen$ True
SVar:DBCopy:DB$ Animate | Defined$ Self | Permanent$ True | Power$ 3 | Toughness$ 3
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/phantasmal_image.jpg
SetInfo:M12|Rare|http://magiccards.info/scans/en/m12/72.jpg
Oracle:You may have Phantasmal Image enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it."
End

The test clone did not die immediately when it entered the battlefield. I also tested it with the Restoration Angel flicker ability and I got to choose a new card when it came back. I am going to create a new "Clone" AF based on the clone code in CardFactoryCreatures.
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

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 39 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 39 users online :: 0 registered, 0 hidden and 39 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 39 guests

Login Form