It is currently 05 Sep 2025, 21:47
   
Text Size

coding question.

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

coding question.

Postby Greyswandir » 14 Jun 2010, 15:17

hey guys, im new to the forums here, and new to Forge in general. I love mtg, and i am trying to take some java classes at the college and hoping one day to help out here

In regards to the card.txt file; If the keywords are already created, can i just add a card to card.txt or would i have to have done something in the cardfactory as well, or whatever else needs to be done?

example: Talon Sliver and Spitting Sliver.

Talon Sliver
1 W
Creature Sliver
All sliver creatures have first strike.
1/1

Spitting Sliver
4 B
Creature Sliver
All sliver creatures have first strike.
3/3
--------------------------
Talon Sliver is already in Forge. I add Spitting Sliver to the card.txt file, using Talon sliver as a template. I test Spitting sliver but its effects do not work( it receives "all sliver have" abilities from the other slivers, but does not give the other ones its.)They have identical abilities so im just confused as to if im missing something really small, or something else that is not in my control to solve without plugging in some actual java code in another file.

Thanks for your time and responses.
Greyswandir
 
Posts: 1
Joined: 14 Jun 2010, 12:51
Has thanked: 0 time
Been thanked: 0 time

Re: coding question.

Postby Hellfish » 14 Jun 2010, 15:48

Hi, Greyswandir (My memory is not that great but I think I recognize that moniker) and welcome!

Many cards can be added with just entries in cards.txt, you can check out the big sticky thread in this forum to see if you can combine any the keywords that are in Forge already. Otherwise, yes, one has to add additional code to the proper cardfactory. In cards.txt, the keywords for each additional entry comes at the very end of a block. The text right after the type(unless that text is "no text", of course :)) is just the oracle text verbatim, for just cards that use specific additional code.

In this specific example, Talon Sliver currently works off of some specific code in GameActionUtil and StaticEffects. [I was going to write here that it could do with the spAllPump keyword but I realized that keywords restrictions doesn't cover subtypes :oops: ] but, as it looks to me, very little has to be changed.
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
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: coding question.

Postby Chris H. » 14 Jun 2010, 16:59

Greyswandir wrote:hey guys, im new to the forums here, and new to Forge in general. I love mtg, and i am trying to take some java classes at the college and hoping one day to help out here

In regards to the card.txt file; If the keywords are already created, can i just add a card to card.txt
`
Glad to meet you. The general format for the info in cards.txt is:

1) Card Name
2) Mana Cost (or "no cost" if land)
3) Card Types
4) text string which is displayed in the text panel
5) Power/Toughness if creature
The keywords all come after the above info


As an example, here is a card (with no keywords) that was just added:



Here is an example of a coule of cards with keywords:

User avatar
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: coding question.

Postby Rob Cashwalker » 14 Jun 2010, 20:24

In the case of the Slivers, those cards use additional code to grant the abilities, I believe in GameActionUtil.

There is an extensive list of keyworded abilities, (spPumpTgt) effects (When CARDNAME enters the battlefield, draw a card.) and properties. (Trample) Check out Chris' Keyword list post for details. We don't have everything covered there, but we're getting closer.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: coding question.

Postby mtgrares » 14 Jun 2010, 21:53

Most of the card code is in one of the CardFactory classes. State effects like Slivers and Glorious Anthem are implemented in GameActionUtil.checkStateEffects(). And the card's basic info must be put into cards.txt
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times


Return to Developer's Corner

Who is online

Users browsing this forum: Bing [Bot] and 35 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 36 users online :: 1 registered, 0 hidden and 35 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: Bing [Bot] and 35 guests

Login Form