It is currently 06 Jun 2025, 15:54
   
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 friarsol » 10 Sep 2011, 19:06

I'd rather just add a newcost than have incorrect functionality. It ismuch easier to create new costs than it used to be, but I can handle adding this cost soon if noone else is up for it
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby slapshot5 » 10 Sep 2011, 19:12

ArsenalNut wrote:
Iran wrote:Is possible to script Springjack Pasture? Anyone has some ideia how to script the last mana ability of it.
" Tap, Sacrifice X Goats: Add X mana of any one color to your mana pool. You gain X life. "

Thanks
You have to setup it up as five different choices, look at Black Lotus for an example of five choices. Copper-Leaf Angel is another card that uses the sacrifice x cost mechanic.
Ideally, AF_Mana should support Produced$ Any. It would work best for this situation and also clean up ability text for Black Lotus, Birds of Paradise, etc.

I don't think there's a feature request Mantis issue out there for that. Perhaps I shall add one.

-slapshot5

Edit: Submitted as: http://cardforge.org/bugz/view.php?id=266
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby friarsol » 10 Sep 2011, 23:20

friarsol wrote:I'd rather just add a newcost than have incorrect functionality. It ismuch easier to create new costs than it used to be, but I can handle adding this cost soon if noone else is up for it
I'll have this up sometime tonight hopefully. Maybe tomorrow at the latest.
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 » 11 Sep 2011, 04:33

slapshot5 wrote:
ArsenalNut wrote:
Iran wrote:Is possible to script Springjack Pasture? Anyone has some ideia how to script the last mana ability of it.
" Tap, Sacrifice X Goats: Add X mana of any one color to your mana pool. You gain X life. "

Thanks
You have to setup it up as five different choices, look at Black Lotus for an example of five choices. Copper-Leaf Angel is another card that uses the sacrifice x cost mechanic.
Ideally, AF_Mana should support Produced$ Any. It would work best for this situation and also clean up ability text for Black Lotus, Birds of Paradise, etc.

I don't think there's a feature request Mantis issue out there for that. Perhaps I shall add one.

-slapshot5

Edit: Submitted as: http://cardforge.org/bugz/view.php?id=266
I was thinking about this same thing when I tried to script Fertile Ground.

I took at quick look at this. My thought is to add support for "ChosenColor" to the AF Mana and use the AF ChooseColor to set the color. For example the ability lines for Black Lotus would look like
Code: Select all
A:AB$ ChooseColor | Cost$ T Sac<1/CARDNAME>  | Defined$ You | SubAbility$ DBMana | SpellDescription$ Add three mana of any one color to your mana pool.
SVar:DBMana:DB$ Mana | Cost$ 0 | Produced$ ChosenColor | Amount$ 3
I've got it working in terms adding the right color mana to the mana pool, but I need to work on the stack description.
The only question I have is it correct that the color choice occurs after resolution now? If not then this method won't work.
Last edited by ArsenalNut on 11 Sep 2011, 05:26, edited 2 times in total.
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 » 11 Sep 2011, 05:08

ArsenalNut wrote:I've got it working in terms adding the right color mana to the mana pool, but I need to work on the stack description.
The only question I have is it correct that the color choice occurs after resolution now? If not then this method won't work.
#-o Never mind, it's a mana ability so it shouldn't have gone on the stack in the first place. The choose color ability line needs "Static$ True".

Edit: Just realized Static$ True only works for triggers. Back to the drawing board.
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 » 11 Sep 2011, 12:41

Why not the way Slapshot was suggesting? The AI needs some more information no matter where you add the code, might as well have it be in AF_Mana.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby slapshot5 » 11 Sep 2011, 15:18

friarsol wrote:Why not the way Slapshot was suggesting? The AI needs some more information no matter where you add the code, might as well have it be in AF_Mana.
But if you want to fix up AF_Mana to support ChosenColor too, you could add things like Sol Grail and Quirion Elves... Just throwing it out there.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby friarsol » 11 Sep 2011, 15:29

slapshot5 wrote:
friarsol wrote:Why not the way Slapshot was suggesting? The AI needs some more information no matter where you add the code, might as well have it be in AF_Mana.
But if you want to fix up AF_Mana to support ChosenColor too, you could add things like Sol Grail and Quirion Elves... Just throwing it out there.

-slapshot5
That's true. Chosen Color more fits the Sol Grail form (where the ChosenColor is saved) than the Birds of Paradise form.
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 » 11 Sep 2011, 16:18

friarsol wrote:
slapshot5 wrote:
friarsol wrote:Why not the way Slapshot was suggesting? The AI needs some more information no matter where you add the code, might as well have it be in AF_Mana.
But if you want to fix up AF_Mana to support ChosenColor too, you could add things like Sol Grail and Quirion Elves... Just throwing it out there.

-slapshot5
That's true. Chosen Color more fits the Sol Grail form (where the ChosenColor is saved) than the Birds of Paradise form.
Initially, I thought we could take advantage of an existing AF but it won't work right for mana abilitites without more changes outside the AF's. It's cleaner to add it directly to AF_Mana. I've already got a basic version working by re-using most of the color choice code from AF_Choose.

The AI choice needs lots of work. The AF_Choose basically defaulted the AI choice to black. I've stuck with that for now with plans to change it to something a bit more sophisticated later. I haven't really looked at AI decision before. Any tips on where to start?

Adding support for ChosenColor shouldn't be a problem. I already had it working in my first experiment.
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 Iran » 11 Sep 2011, 21:25

With the changes in AF_Animate, Is it possible to script cards like Turn To Frog and Ovinize?

We need a mechanism in script to deal with the part of "name a card" that cards like Cabal Therapy, Conundrum Sphinx, etc.. have.

We need a mechanism in script to deal with the part of "Players can't search libraries" that cards like Shadow of Doubt, Mindlock Orb, etc.. have.

Thanks
Last edited by Iran on 12 Sep 2011, 18:57, edited 3 times in total.
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby ZzzzSleep » 12 Sep 2011, 13:02

friarsol wrote:
friarsol wrote:I'd rather just add a newcost than have incorrect functionality. It ismuch easier to create new costs than it used to be, but I can handle adding this cost soon if noone else is up for it
I'll have this up sometime tonight hopefully. Maybe tomorrow at the latest.
Would you be able to give me an example when this is done? It'd be greatly appreciated.
ZzzzSleep
 
Posts: 182
Joined: 29 Oct 2010, 02:19
Has thanked: 18 times
Been thanked: 18 times

Re: Card Development Questions

Postby ArsenalNut » 12 Sep 2011, 13:20

ZzzzSleep wrote:
friarsol wrote:
friarsol wrote:I'd rather just add a newcost than have incorrect functionality. It ismuch easier to create new costs than it used to be, but I can handle adding this cost soon if noone else is up for it
I'll have this up sometime tonight hopefully. Maybe tomorrow at the latest.
Would you be able to give me an example when this is done? It'd be greatly appreciated.
Look at Millikin. FriarSol checked in an updated version that uses the new mill cost. If you can't get the latest version, the mill cost syntax is "Mill<amount>".
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 Iran » 12 Sep 2011, 19:49

I'm trying to script Selective Memory.
Looking in the script of the card Mana Severance I made this script.

Code: Select all
Name:Selective Memory
ManaCost:3 U
Types:Sorcery
Text:no text
A:SP$ ChangeZone | Cost$ 3 U | Origin$ Library | Destination$ Exile | ChangeType$ Creature,Artifact,Enchantment,Sorcery,Instant | ChangeNum$ XFetch  | SpellDescription$ Search your library for any number of nonland cards and exile them. Then shuffle your library.
SVar:XFetch:Count$TypeInYourLibrary.nonLand
End
But I think the SVar Count$TypeInYourLibrary don´t work, because the value of it is Zero.

Any suggestion to script correct this card?
Last edited by Iran on 12 Sep 2011, 20:10, edited 1 time in total.
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Card Development Questions

Postby Sloth » 12 Sep 2011, 19:58

Iran wrote:I'm trying to script Selective Memory.
Looking in the script of the card Mana Severance I made this script.

Code: Select all
Name:Selective Memory
ManaCost:3 U
Types:Sorcery
Text:no text
A:SP$ ChangeZone | Cost$ 1 U | Origin$ Library | Destination$ Exile | ChangeType$ Creature,Artifact,Enchantment,Sorcery,Instant | ChangeNum$ XFetch  | SpellDescription$ Search your library for any number of nonland cards and exile them. Then shuffle your library.
SVar:XFetch:Count$TypeInYourLibrary.nonLand
End
But I think the SVar Count$TypeInYourLibrary don´t work, because the value of it is Zero.

Any suggestion to script correct this card?
First: ChangeType$ has to be "Card.nonLand" (your version forgets Planeswalkers, but allows Artifact Lands and Dryad Arbor).
Second: use "SVar:XFetch:Count$InYourLibrary". The number will be too high, but I'm pretty sure it won't matter since searching the library for specific (not any) cards is never mandatory.
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 » 12 Sep 2011, 20:04

Sloth wrote:First: ChangeType$ has to be "Card.nonLand" (your version forgets Planeswalkers, but allows Artifact Lands and Dryad Arbor).
Second: use "SVar:XFetch:Count$InYourLibrary". The number will be too high, but I'm pretty sure it won't matter since searching the library for specific (not any) cards is never mandatory.
I Test with "Card.nonLand" in ChangeType$ but it don't work, X is zero.
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 39 guests


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 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 39 guests

Login Form