Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by ArsenalNut » 05 Sep 2011, 06:58
Could you explain what you meant by Flashback doesn't need to be hardcoded? Did you mean that it really didn't need a separate button? Or is there a currently supported way to make cards playable from the graveyard that I am just not aware of?friarsol wrote:Funnily enough, Flashback doesn't need to be hardcoded, but Rebound needs two primary additions.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Card Development Questions
by friarsol » 05 Sep 2011, 13:18
I guess I had misunderstood what you meant by hardcoded. What I was saying was Flashback could be scripted without having code for a "Flashback" keyword in CardFactory. (Accessing non-Hand/Battlefield abilities is a different story.)ArsenalNut wrote:Could you explain what you meant by Flashback doesn't need to be hardcoded? Did you mean that it really didn't need a separate button? Or is there a currently supported way to make cards playable from the graveyard that I am just not aware of?friarsol wrote:Funnily enough, Flashback doesn't need to be hardcoded, but Rebound needs two primary additions.
Whereas Rebound would need code to properly start the Rebound, and properly trigger the Rebound from exile. This isn't related to accessing Flashback/Unearth/Hammer of Bogardan
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Iran » 05 Sep 2011, 14:39
Iran wrote:How do works the CostChange:{params} keyword?.Which params this keyword use?. Is possible make a spell you cast cost B G W B U with this keyword?. Is possible to script Fist of Suns with this keyword?
thanks
I see the script of the card Grand Arbiter Augustin IV.slapshot5 wrote:You'd want the AltCost SVar for this. Look at the script for Bringer of the Black Dawn for an example. I don't think Fist of Suns would currently be doable.
-slapshot5
Because of this i asked about CostChange keyword.
I'm trying to script Rooftop Storm (Innistrad Set) and Fist of Suns with this keyword, but I think it will be need changes in code.
Thanks
Re: Card Development Questions
by Iran » 08 Sep 2011, 03:22
I'm trying to script Malfegor. i made this script, but i found a problem.
Is there another way to script it?
- Code: Select all
Name:Malfegor
ManaCost:2 B B R R
Types:Legendary Creature Demon Dragon
Text:no text
PT:6/6
K:Flying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ DBDisc | TriggerDescription$ When CARDNAME comes into play, discard your hand. Each opponent sacrifices a creature for each card discarded this way.
SVar:DBDisc: DB$ Discard | Cost$ 0 | Mode$ Hand | SubAbility$ DBSacri
SVar:DBSacri:DB$ Sacrifice | Cost$ 0 | ValidTgts$ Opponent | SacValid$ Creature |SacMessage$ Creature | Amount$ X
SVar:X:Count$InYourHandS
End
Is there another way to script it?
Re: Card Development Questions
by Iran » 08 Sep 2011, 03:44
I'm trying script with RememberTargets$ True but the forge generates an error. I think this parameter don't exist in AF_Discard.friarsol wrote:We need RememberDiscard in AF_Discard. By the time X is counted in your script, your hand is empty.
Re: Card Development Questions
by ArsenalNut » 08 Sep 2011, 07:00
RememberTargets won't help in this situation since you need to remember the number of cards that were in your hand before you discarded it. RememberTargets only puts things you've targeted in the remembered list.Iran wrote:I'm trying script with RememberTargets$ True but the forge generates an error. I think this parameter don't exist in AF_Discard.friarsol wrote:We need RememberDiscard in AF_Discard. By the time X is counted in your script, your hand is empty.
I am already adding RememberDrawn to the Draw AF so I'll look at adding RememberDiscard to the Discard AF which is in the same file.
Another comment on your script, for the opponent sacrifice, use "Defined$ Opponent" instead of "ValidTgt$ Opponent". It's not a targeted ability.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Card Development Questions
by friarsol » 08 Sep 2011, 11:53
Arsenal,
RememberDiscard is probably the most complicated of Remember functions. The way I was thinking about handling it is to have all the Player.discard() functions return what cards were actually discarded. This way they can be added into RememberDiscarded.
RememberDiscard is probably the most complicated of Remember functions. The way I was thinking about handling it is to have all the Player.discard() functions return what cards were actually discarded. This way they can be added into RememberDiscarded.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by ArsenalNut » 08 Sep 2011, 12:34
I took a quick look after I posted the message. All the discard methods are void methods except for the random discard. I'll need to change them to return a CardList with the discarded cards. Then adding RememberDiscard will following the same pattern the other Remember keys have.friarsol wrote:Arsenal,
RememberDiscard is probably the most complicated of Remember functions. The way I was thinking about handling it is to have all the Player.discard() functions return what cards were actually discarded. This way they can be added into RememberDiscarded.
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Card Development Questions
by friarsol » 10 Sep 2011, 00:29
Anyone interested in a Scripting challenge? I believe it's possible to actually Script Fireball (using some tricks, including the one used for Blasphemous Act viewtopic.php?f=52&t=5315&start=45#p69971 )
Here are a few things to consider: Fireball can have a ton of targets. Fireball's cost is increased based on the Number of Targets - 1. Fireball deals damage equal to XPaid / Number of Targets (rounded down).
Here are a few things to consider: Fireball can have a ton of targets. Fireball's cost is increased based on the Number of Targets - 1. Fireball deals damage equal to XPaid / Number of Targets (rounded down).
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Max mtg » 10 Sep 2011, 00:46
maybe let's better rewrite the scripting system to use xml and mathematical expressions? 
I could not figure out how to script some simple cards, tried Bazaar Trader, but nothing came out of it
And now I am sad because don't know how to learn that magic language

I could not figure out how to script some simple cards, tried Bazaar Trader, but nothing came out of it
And now I am sad because don't know how to learn that magic language
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Development Questions
by friarsol » 10 Sep 2011, 01:00
Funny guy. Bazaar Trader isn't possible right now due to how GainControl works and the double targeting.Max mtg wrote:maybe let's better rewrite the scripting system to use xml and mathematical expressions?
I could not figure out how to script some simple cards, tried Bazaar Trader, but nothing came out of it
And now I am sad because don't know how to learn that magic language
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Iran » 10 Sep 2011, 04:37
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
" Tap, Sacrifice X Goats: Add X mana of any one color to your mana pool. You gain X life. "
Thanks
Re: Card Development Questions
by ArsenalNut » 10 Sep 2011, 05:26
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.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
So many cards, so little time
-
ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Card Development Questions
by ZzzzSleep » 10 Sep 2011, 14:44
Does anybody have an opinion whether Millikin is implemented well enough to be used as a base for Deranged Assistant? 99% of the time it works the same, but I can think of some exceptions.
* With the current Millikin implementation, you can still generate mana with an empty library.
* The cost should be paid immediately, which might make a difference if the opposing player responds with some form of milling/shuffling effect.
Any thoughts/suggestions?
* With the current Millikin implementation, you can still generate mana with an empty library.
* The cost should be paid immediately, which might make a difference if the opposing player responds with some form of milling/shuffling effect.
Any thoughts/suggestions?
Who is online
Users browsing this forum: No registered users and 41 guests