It is currently 12 Jul 2025, 16:20
   
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 » 13 Nov 2012, 12:40

I'm trying to convert Sarpadian Empires, Vol. VII to script and it's working perfectly. Just a few quick questions. I had to use the generic text field to add the ability text because otherwise it wouldn't show until after the card is on the battlefield. This switches the order of the two text pieces in the card panel. Does this bother anyone particularly (could make it more Oracle-compliant if we had a way to force linebreaks in a SpellDescription - maybe something similar to how CARDNAME is replaced).

The other minor issue is that the AI picks white Citizen by default, although I don't think its really an issue seeing as the hardcoded SEVol7 made the AI choose Thrull without any further checks.

Anything I haven't thought of?

Sarpadian Empires, Vol. VII | Open
Code: Select all
Name:Sarpadian Empires, Vol. VII
ManaCost:3
Types:Artifact
Text:3, Tap: Put a 1/1 creature token of the chosen color and type onto the battlefield.
SVar:Rarity:Rare
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseToken | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.
SVar:ChooseToken:AB$ GenericChoice | Cost$ 0 | Choices$ Citizen,Camarid,Thrull,Goblin,Saproling | Defined$ You
SVar:Citizen:DB$ Animate | Defined$ Self | Abilities$ WToken | Permanent$ True | ChoiceDescription$ White Citizen
SVar:Camarid:DB$ Animate | Defined$ Self | Abilities$ UToken | Permanent$ True | ChoiceDescription$ Blue Camarid
SVar:Thrull:DB$ Animate | Defined$ Self | Abilities$ BToken | Permanent$ True | ChoiceDescription$ Black Thrull
SVar:Goblin:DB$ Animate | Defined$ Self | Abilities$ RToken | Permanent$ True | ChoiceDescription$ Red Goblin
SVar:Saproling:DB$ Animate | Defined$ Self | Abilities$ GToken | Permanent$ True | ChoiceDescription$ Green Saproling
SVar:WToken:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Citizen | TokenTypes$ Creature,Citizen | TokenOwner$ You | TokenColors$ White | TokenPower$ 1 | TokenToughness$ 1
SVar:UToken:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Camarid | TokenTypes$ Creature,Camarid | TokenOwner$ You | TokenColors$ Blue | TokenPower$ 1 | TokenToughness$ 1
SVar:BToken:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Thrull | TokenTypes$ Creature,Thrull | TokenOwner$ You | TokenColors$ Black | TokenPower$ 1 | TokenToughness$ 1
SVar:GToken:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Goblin | TokenTypes$ Creature,Goblin | TokenOwner$ You | TokenColors$ Red | TokenPower$ 1 | TokenToughness$ 1
SVar:RToken:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenColors$ Green | TokenPower$ 1 | TokenToughness$ 1
SVar:Picture:http://www.wizards.com/global/images/magic/general/sarpadian_empires_vol_vii.jpg
SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/263.jpg
Oracle:As Sarpadian Empires, Vol. VII enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.\n{3}, {T}: Put a 1/1 creature token of the chosen color and type onto the battlefield.
End
EDIT: Testing this conversion made me realise how far the AI has come recently. I gave the AI a SE and a Sol Ring to go with its land. I attack into the AI with a 1/1, more to pass time instead of just skipping straight to his turn. Next thing it cast a spell to prevent my creature dealing damage, pops a Citizen with which it blocks, and so ended the life of my little guy. Quite unexpected and more complex than I thought the AI was capable of (guess you can tell I haven't played many full length games in a while) :D
-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 Sloth » 13 Nov 2012, 20:07

The only problem i see with Sarpadian Empires, Vol. VII is when it somehow gets another ability (for example if you make it creature with March of the Machines and then cast Shoving Match), the token ability will have no description to choose from. But this is reeaally minor. So i would say commit.
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 moomarc » 15 Nov 2012, 20:19

Status update on Sarpadian Empires, Vol. VII: I've tried setting it up with a token ability for each color with an activation restriction based on the chosen color. Unfortunately I can't get the restriction working and can't seem to work out what I did wrong.
Current script | Open
Name:Sarpadian Empires, Vol. VII
ManaCost:3
Types:Artifact
Text:no text
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ ChooseColor | Static$ True | TriggerDescription$ As CARDNAME enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.
SVar:ChooseColor:DB$ ChooseColor | Defined$ You | AILogic$ MostProminentInGame
# Went for MostProminenInGame logic to give the AI a possible out for situations where it might be locked down based on its colors
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Citizen | TokenTypes$ Creature,Citizen | TokenOwner$ You | TokenColors$ white | TokenPower$ 1 | TokenToughness$ 1 | ActivationChosenColor$ white | SpellDescription$ Put a 1/1 creature token of the chosen color and type onto the battlefield.
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Camarid | TokenTypes$ Creature,Camarid | TokenOwner$ You | TokenColors$ blue | TokenPower$ 1 | TokenToughness$ 1 | ActivationChosenColor$ blue
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Thrull | TokenTypes$ Creature,Thrull | TokenOwner$ You | TokenColors$ black | TokenPower$ 1 | TokenToughness$ 1 | ActivationChosenColor$ black
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Goblin | TokenTypes$ Creature,Goblin | TokenOwner$ You | TokenColors$ red | TokenPower$ 1 | TokenToughness$ 1 | ActivationChosenColor$ red
A:AB$ Token | Cost$ 3 T | TokenAmount$ 1 | TokenName$ Saproling | TokenTypes$ Creature,Saproling | TokenOwner$ You | TokenColors$ green | TokenPower$ 1 | TokenToughness$ 1 | ActivationChosenColor$ green
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sarpadian_empires_vol_vii.jpg
SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/263.jpg
Oracle:As Sarpadian Empires, Vol. VII enters the battlefield, choose white Citizen, blue Camarid, black Thrull, red Goblin, or green Saproling.\n{3}, {T}: Put a 1/1 creature token of the chosen color and type onto the battlefield.
End
the various bits for SpellAbilityVariables | Open
Code: Select all
this.chosenColors = sav.getColorToCheck();
Code: Select all
    /** The chosen colors string. */
    private String chosenColors = "";
Code: Select all
    /**
     * <p>
     * Setter for the field <code>ColorToCheck</code>.
     * </p>
     *
     * @param s
     *            a {@link java.lang.String} object.
     */
    public final void setColorToCheck(final String s) {
        this.chosenColors = s;
    }

    /**
     * <p>
     * Getter for the field <code>ColorToCheck</code>.
     * </p>
     *
     * @return a {@link java.lang.String} object.
     */
    public final String getColorToCheck() {
        return this.chosenColors;
    }
Bits from SpellAbilityRestriction | Open
In setRestrictions():
Code: Select all
if (params.containsKey("ActivationColorChosen")) {
            this.setColorToCheck(params.get("ActivationColorChosen"));
        }
In canPlay:
Code: Select all
if (this.getColorToCheck() != "") {
            if (!sa.getSourceCard().getChosenColor().contains(this.getColorToCheck())) {
                return false;
            }
        }
I also tried setting it up as one token ability with a subability for each color, each color with ConditionColorChosen. Set it up as for the activation limitation above except in SpellAbilityCondition. Same result: conditions had no effect, so I'd guess that I'm doing something wrong in either setting the variable or in comparing 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 » 22 Nov 2012, 16:13

Does Conditionals not work on Triggered Abilities? Maybe I'm just using the wrong Conditional, but I thought it was right.

Anyway, I was trying to convert Erg Raiders and it seems to be dealing damage to me the first turn I control it. Here's the conversion if someone wants to fiddle with it some more.

Erg Raiders | Open
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDamage | IsPresent$ Creature.Self+notAttackedThisTurn | TriggerDescription$ At the beginning of your end step, if CARDNAME didn't attack this turn, CARDNAME deals 2 damage to you unless it came under your control this turn.
SVar:TrigDamage:AB$ DealDamage | Cost$ 0 | Defined$ You | NumDmg$ 2 | ConditionSVar$ ErgAttacked | ConditionSVarCompare$ EQ1
SVar:ErgAttacked:Valid Creature.Self+notFirstTurnControlled
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 » 22 Nov 2012, 22:00

friarsol wrote:Does Conditionals not work on Triggered Abilities? Maybe I'm just using the wrong Conditional, but I thought it was right.

Anyway, I was trying to convert Erg Raiders and it seems to be dealing damage to me the first turn I control it. Here's the conversion if someone wants to fiddle with it some more.

Erg Raiders | Open
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigDamage | IsPresent$ Creature.Self+notAttackedThisTurn | TriggerDescription$ At the beginning of your end step, if CARDNAME didn't attack this turn, CARDNAME deals 2 damage to you unless it came under your control this turn.
SVar:TrigDamage:AB$ DealDamage | Cost$ 0 | Defined$ You | NumDmg$ 2 | ConditionSVar$ ErgAttacked | ConditionSVarCompare$ EQ1
SVar:ErgAttacked:Valid Creature.Self+notFirstTurnControlled
I think it's "ConditionCheckSVar" instead of "ConditionSVar".
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 » 28 Nov 2012, 04:32

I tried to script Cut the Tethers but it doesn't really work.
Cut the Tethers | Open
Name:Cut the Tethers
ManaCost:2 U U
Types:Sorcery
Text:no text
A:SP$ RepeatEach | Cost$ 2 U U | RepeatSubAbility$ DBReturn | RepeatCards$ Creature.Spirit | SpellDescription$ For each Spirit, return it to its owner's hand unless that player pays 3.
SVar:DBReturn:DB$ ChangeZone | Origin$ Battlefield | Destination$ Hand | Defined$ Remembered | UnlessCost$ 3 | UnlessPayer$ RememberedController
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/cut_the_tethers.jpg
End

I don't think anythings wrong with the script but the UI didn't seem handle the human player correctly. It seemed to work for the AI though.

Here's the two test decks I used
ai spirit test deck | Open
[metadata]
Name=ai spirit
[main]
1 Emissary of Hope|DST
1 Geist of Saint Traft|ISD
1 Lingering Souls|DKA
4 Scrubland|LEA
4 Tundra|LEA
[sideboard]

test cut tethers deck | Open
[metadata]
Name=test cut tethers
[main]
1 Cut the Tethers
1 Emissary of Hope|DST
1 Gloom Surgeon|AVR
1 Lingering Souls|DKA
1 Niblis of the Breath|DKA
4 Scrubland|LEA
4 Tundra|LEA
[sideboard]


To test, I waited until both players had several spirits in play then cast Cut the Tethers.
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 » 28 Nov 2012, 13:12

ArsenalNut wrote:I tried to script Cut the Tethers but it doesn't really work.
Yea I had some problems when trying to script Fade Away in a similar manner. It seems like the spell was finishing resolving instead of waiting for the repeat to be handled, which caused issues with things. I'm not sure if there's anything we can do about that right now.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Corwin72 » 28 Nov 2012, 21:41

So am I the only one running into the issue where player and AI lands are put into the graveyard at end of turn. This happens on both builds 2 days ago and yesterday.
User avatar
Corwin72
 
Posts: 793
Joined: 15 Sep 2009, 13:26
Location: Grayson, Ga
Has thanked: 25 times
Been thanked: 9 times

Re: Card Development Questions

Postby RumbleBBU » 30 Nov 2012, 10:48

It seems that Goblin Welder is not currently included in Forge?

I saw a Goblin Welder card contribution in a thread, but since it apparently hasn't been added, I take it that there are issues why it wouldn't work properly?

...yeah, I'm a cheeseball, but currently (thanks to Agetian's great contributions like the Circles of Protection and Drain Life), it's the unimplemented card I'm most interested in. :P

EDIT - this is where I saw a Goblin Welder contribution:
viewtopic.php?f=26&t=2091&p=48387&hilit=goblin+welder#p48387
User avatar
RumbleBBU
 
Posts: 394
Joined: 18 Aug 2012, 04:24
Has thanked: 29 times
Been thanked: 66 times

Re: Card Development Questions

Postby friarsol » 30 Nov 2012, 13:24

RumbleBBU wrote:EDIT - this is where I saw a Goblin Welder contribution:
viewtopic.php?f=26&t=2091&p=48387&hilit=goblin+welder#p48387
That card isn't scripted correctly at all. Firstly, Welder doesn't sacrifice as a cost. Secondly, this Welder needs to target both artifacts, and also restrict one of the targeting to have the same owner as the first target controls (complex interaction). Next, both artifacts need to be be valid targets when the spell resolves, we don't really have a way of doing that either. Soooo... it's a very complex card with a bunch of restrictions that I don't think we can handle at this time.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby friarsol » 03 Dec 2012, 04:30

Anyone know why the s in Animate Params for staticAbilities and sVars are lower case? Especially since Effect has a capital S for StaticAbilities, it's definitely confusing (and I think I see at least one script that is incorrect due to this).
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby friarsol » 03 Dec 2012, 04:51

Alright, here's an Earthbind script that works for everything except for the fact that the ChangeZone trigger happens too early.

Earthbind | Open
A:SP$ Attach | Cost$ R | ValidTgts$ Creature | AILogic$ Curse | AITgts$ Creature.withFlying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | IsPresent$ Card.EnchantedBy+withFlying | PresentCompare$ EQ1 | Execute$ TrigDealDamage | TriggerDescription$ When CARDNAME enters the battlefield, if enchanted creature has flying, CARDNAME deals 2 damage to that creature and CARDNAME gains "Enchanted creature loses flying."
SVar:TrigDealDamage:AB$DealDamage | Cost$ 0 | Defined$ Valid Card.EnchantedBy | NumDmg$ 2 | SubAbility$ DBLoseFlying
SVar:DBLoseFlying:DB$ Animate | Defined$ Self | staticAbilities$ LoseFlyingStatic | Permanent$ True
SVar:LoseFlyingStatic:Mode$ Continuous | Affected$ Card.EnchantedBy | RemoveKeyword$ Flying | Description$ Enchanted creature loses flying.


Basically what happens is:

1. Aura ETB
2. Trigger goes off and (incorrectly) checks its condition, which fails and doesn't go on the stack.
3. Aura attaches and finishes resolving.
4. Stack is empty.

What should happen is:

1. Aura ETB
2. Trigger goes off, but condition isn't checked yet because something is still resolving
3. Aura attaches and finishes resolving.
4. Trigger checks it's condition and goes on the stack.
5. Stack has the trigger on the stack.

If anyone can help me out that's familiar with Trigger stuff, it'd be appreciated. I'm almost curious if a second trigger fires due to the Aura ETB, if things would work properly.

Edit: This may also fix the reported issues with Valakut.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby swordshine » 04 Dec 2012, 04:27

I tried to script Junk Golem, but the “UnlessCost$ SubCounter<1/P1P1>” did not work for human(it worked perfectly for AI)
Junk Golem | Open
Code: Select all
Name:Junk Golem
ManaCost:4
Types:Artifact Creature Golem
Text:no text
PT:0/0
K:etbCounter:P1P1:3
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigSac | TriggerDescription$ At the beginning of your upkeep, sacrifice CARDNAME unless you remove a +1/+1 counter from it.
SVar:TrigSac:AB$ Sacrifice | Cost$ 0 | Defined$ Self | UnlessCost$ SubCounter<1/P1P1> | UnlessPayer$ You
A:AB$ PutCounter | Cost$ 1 Discard<1/Card> | CounterType$ P1P1 | CounterNum$ 1 | SpellDescription$ Put a +1/+1 counter on CARDNAME.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/junk_golem.jpg
End
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Development Questions

Postby friarsol » 07 Dec 2012, 04:17

friarsol wrote:If anyone can help me out that's familiar with Trigger stuff, it'd be appreciated. I'm almost curious if a second trigger fires due to the Aura ETB, if things would work properly.

Edit: This may also fix the reported issues with Valakut.
Alright, I'll take a look at this since, I'm feeling proactive after solving the Animate Dead puzzle. I have something in right now that I think might do the trick. I need to do some smoke testing with other triggers to make sure it looks like it didn't break anything major. But it definitely lets Earthbind trigger properly.

Edit: Looks like it fixed Valakut triggers too, although seemed to break Venser. I'll have to figure out when delay triggers happen, and try to move it around a bit. Hopefully I'll be able to test it out this weekend.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby RumbleBBU » 11 Dec 2012, 07:32

Don't know which thread is the proper place for this, so I'm sticking it here...

What should happen if a player taps Fellwar Stone and the opponent has no lands in play?
Get {0}?
Get {1}?

Currently you get...
| Open
a crash

And that is obviously not the correct or expected game behavior. :P

I found this out when I was testing my deck against a newly-designed AI deck that uses almost entirely non-land mana base (creatures, artifacts) and regularly wrecks the opponent's mana base with Armageddon and the like.
The above happened once when the AI wanted to tap a Fellwar Stone for mana right after an Armageddon. It's also happened when the AI went first and got out a handful of mana artifacts out on its first turn (before I had one) and tried to tap a Fellwar Stone.
User avatar
RumbleBBU
 
Posts: 394
Joined: 18 Aug 2012, 04:24
Has thanked: 29 times
Been thanked: 66 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 35 guests

cron

Main Menu

User Menu

Our Partners


Who is online

In total there are 35 users online :: 0 registered, 0 hidden and 35 guests (based on users active over the past 10 minutes)
Most users ever online was 5050 on 26 Jun 2025, 06:02

Users browsing this forum: No registered users and 35 guests

Login Form