It is currently 02 May 2024, 10:46
   
Text Size

New card tutorial?

Post MTG Forge Related Programming Questions Here

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

New card tutorial?

Postby Corwin72 » 12 Apr 2010, 15:38

I am interested in creating some basic creature cards and spells. Is there a tutorial that will help with basic templates and a few examples? I would also like a check list of steps to make sure that tested cards documented correctly and are entered into the next build. Thank you for your help.
User avatar
Corwin72
 
Posts: 793
Joined: 15 Sep 2009, 13:26
Location: Grayson, Ga
Has thanked: 25 times
Been thanked: 9 times

Re: New card tutorial?

Postby DennisBergkamp » 12 Apr 2010, 17:15

We don't really have an official tutorial... however, a good place to start looking after grabbing the source code is CardFactory.java, CardFactory_Creatures.java and of course cards.txt. Then just look at the code of some of your favorite cards, and it should give you an idea of how (or, in a lot of cases, how NOT :mrgreen: ) to code certain cards.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: New card tutorial?

Postby Corwin72 » 12 Apr 2010, 18:18

Where can I download the most recent source code?
I promise that I have looked around. I am just not finding a link that was not from Nov. of last year.
User avatar
Corwin72
 
Posts: 793
Joined: 15 Sep 2009, 13:26
Location: Grayson, Ga
Has thanked: 25 times
Been thanked: 9 times

Re: New card tutorial?

Postby Chris H. » 12 Apr 2010, 19:20

Corwin72 wrote:Where can I download the most recent source code?
I promise that I have looked around. I am just not finding a link that was not from Nov. of last year.
`
The most recent source code is available on code.google.com. Dennis posted the code from about two versions ago for Rares to download a copy and the link may still be good.

Latest source code from svn
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: New card tutorial?

Postby Chris H. » 13 Apr 2010, 20:41

A good way to get started is to download and install Eclipse on your computer. This will let you edit the source files and run the code. At this point you can go to the deck editor and create a very small deck with just enough cards to test the new card to see if it works the way you expected.

Once you have a working card you can post the code here in the developer forum. At some point you will be ready to take it to the next level which is to install Subversion and Subclipse and this will allow you to upload and download changes from your local copy to the head version located on google's SVN.

As you become more familiar with the code you will notice that dennis likes to create the frame work needed for certain types of cards. Recently he added the code for X cost spells and MultiKicker. He then got busy with other things and I took the opportunity to use his code as a template and modified it to the point where we had several other cards that could be added.

There also is code already in place which can be modified into a keyword which in turn can allow the easy addition of other cards. You can read through the cards.txt file and find numerous cards that are either implemented partially or completely through these 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


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 47 guests


Who is online

In total there are 47 users online :: 0 registered, 0 hidden and 47 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 47 guests

Login Form