Card scripting question about Parapet
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
7 posts
• Page 1 of 1
Card scripting question about Parapet
by mtgrares » 28 Mar 2011, 18:58
I received the email message below about a guy trying to implement Parapet. It is an unusual card since it is an enchantment which can also be played like an instant.
My name is Leonardo and I discovered Forge a few days ago. I'm a big free
software supporter and I'm glad to have found a way to play MTG from my
GNU/Linux box and I'm glad that your software is free as in freedom.
I hadn't played MTG in quite a while. When I was trying to rebuild my old
white deck I found out that some cards were missing and I wanted to add them.
One that's giving me a little problem is Parapet, from Visions [0].
This card is an enchantment that gives +0/+1 to all creatures you control. The
particularity of this card is that it can be played as an instant and buried
at the end of turn. That's what's giving me problems.
Reading other cards I found a way to make Parapet be a +0/+1 enchantment for
all the creatures I control, but I couldn't find a way to also make it work as
an instant.
I know about the Flash ability, but that's for creatures and they aren't sent
to the graveyard at the end of the turn as with Parapet.
Is there any way to implement this particular thing?
Here's what I have so far for Parapet:
Name:Parapet
ManaCost:1 W
Types:Enchantment
K:stPumpAll:Creature.YouCtrl:0/1:You may choose to play Parapet as an instant;
if you do, bury it at the end of turn. All creates you control get +0/+1.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/parapet.jpg
SetInfo:WTH|Common|http://magiccards.info/scans/en/vi/114.jpg
End
That's all for now. I should mention that your game has made me very happy.
Regards,
Leonardo
My name is Leonardo and I discovered Forge a few days ago. I'm a big free
software supporter and I'm glad to have found a way to play MTG from my
GNU/Linux box and I'm glad that your software is free as in freedom.
I hadn't played MTG in quite a while. When I was trying to rebuild my old
white deck I found out that some cards were missing and I wanted to add them.
One that's giving me a little problem is Parapet, from Visions [0].
This card is an enchantment that gives +0/+1 to all creatures you control. The
particularity of this card is that it can be played as an instant and buried
at the end of turn. That's what's giving me problems.
Reading other cards I found a way to make Parapet be a +0/+1 enchantment for
all the creatures I control, but I couldn't find a way to also make it work as
an instant.
I know about the Flash ability, but that's for creatures and they aren't sent
to the graveyard at the end of the turn as with Parapet.
Is there any way to implement this particular thing?
Here's what I have so far for Parapet:
Name:Parapet
ManaCost:1 W
Types:Enchantment
K:stPumpAll:Creature.YouCtrl:0/1:You may choose to play Parapet as an instant;
if you do, bury it at the end of turn. All creates you control get +0/+1.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/parapet.jpg
SetInfo:WTH|Common|http://magiccards.info/scans/en/vi/114.jpg
End
That's all for now. I should mention that your game has made me very happy.
Regards,
Leonardo
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: Card scripting question about Parapet
by Hellfish » 28 Mar 2011, 19:19
Always good to see people enjoying Forge. You should invite him to the forums.
Unfortunately, unusual cards with unusual mechanics like this are rarely 100% scriptable.Pretty sure it can be done hardcoded already, though, meaning there is no special situation that will occur and break things.
Unfortunately, unusual cards with unusual mechanics like this are rarely 100% scriptable.Pretty sure it can be done hardcoded already, though, meaning there is no special situation that will occur and break things.
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
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
-

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 scripting question about Parapet
by leorockway » 28 Mar 2011, 19:59
He linked me to this thread, so here I am. =]Hellfish wrote:Always good to see people enjoying Forge. You should invite him to the forums.
Thanks for your answer. Hardcoded how? Does that mean writing Java (I don't speak Java and it's not really in my plans to learn it).Hellfish wrote:Unfortunately, unusual cards with unusual mechanics like this are rarely 100% scriptable.Pretty sure it can be done hardcoded already, though, meaning there is no special situation that will occur and break things.
I was thinking that once I understand more about card scripting I could make a little app (in Python) so people can point and click to create new cards.
- leorockway
- Posts: 2
- Joined: 28 Mar 2011, 19:48
- Has thanked: 0 time
- Been thanked: 0 time
Re: Card scripting question about Parapet
by Hellfish » 28 Mar 2011, 20:09
Hehe, Welcome! 
Yes, I meant writing java code for it. Don't get me wrong, we've made great strides in what can be accomplished in script alone, but knowing and reacting how and when a card was played is not one of those things. You can still help even without knowing java, check out The Wiki for a rundown of what you CAN do in script. And of course ask around the forums, there's usually someone around who can answer questions and fix found bugs.
Yes, I meant writing java code for it. Don't get me wrong, we've made great strides in what can be accomplished in script alone, but knowing and reacting how and when a card was played is not one of those things. You can still help even without knowing java, check out The Wiki for a rundown of what you CAN do in script. And of course ask around the forums, there's usually someone around who can answer questions and fix found bugs.
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
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
-

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 scripting question about Parapet
by leorockway » 28 Mar 2011, 20:29
I had already been reading the wiki, thank you. Reading other existing cards helps too.
The thing is that I haven't played MTG in years (Tempest was brand new when I stopped playing) so I need to reacquaint myself with all the cards and find out about all the new stuff. It should be fun, but I don't have a lot of free time available to do that, so my progress will be slow.
The thing is that I haven't played MTG in years (Tempest was brand new when I stopped playing) so I need to reacquaint myself with all the cards and find out about all the new stuff. It should be fun, but I don't have a lot of free time available to do that, so my progress will be slow.
- leorockway
- Posts: 2
- Joined: 28 Mar 2011, 19:48
- Has thanked: 0 time
- Been thanked: 0 time
Re: Card scripting question about Parapet
by Chris H. » 28 Mar 2011, 20:30
There might still be a few hundred cards or so that are candidates for implementing via scripting. Check out the forge wiki, read the topic about keywords and look for examples among the implemented cards.
I have a few hard coded cards that I would like to try to convert over to script. I also have some maintenance work to do and that will keep me busy for a few more weeks.
Jeff may still be helping to add new cards via script and I am sure that he could use a hand. A new set of eyes and a fresh mind can help to find the cards that other people have overlooked.
I have a few hard coded cards that I would like to try to convert over to script. I also have some maintenance work to do and that will keep me busy for a few more weeks.
Jeff may still be helping to add new cards via script and I am sure that he could use a hand. A new set of eyes and a fresh mind can help to find the cards that other people have overlooked.
-

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 scripting question about Parapet
by friarsol » 28 Mar 2011, 21:32
Leonardo, I played back then as well and IIRC there were at least 10 cards that had similar, "Flash but sacrifice EOT if you played it as an instant" which is probably enough to write a Keyword for it. We probably wouldn't want the AI using that function, but the actual code shouldn't be too difficult. On resolution, if the casting player can't cast a sorcery (!canCastSorcery()) then we could add the appropriate delayed trigger. I'm not sure how quickly someone will want to do that, if you aren't interested in learning the bloated language of Java.
But as the otehrs said, always good to have more hands helping out, and any tools you want to write will be welcome.
But as the otehrs said, always good to have more hands helping out, and any tools you want to write will be welcome.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 23 guests