New card tutorial?
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
New card tutorial?
by 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.
-
Corwin72 - Posts: 793
- Joined: 15 Sep 2009, 13:26
- Location: Grayson, Ga
- Has thanked: 25 times
- Been thanked: 9 times
Re: New card tutorial?
by 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 ) to code certain cards.
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: New card tutorial?
by 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.
I promise that I have looked around. I am just not finding a link that was not from Nov. of last year.
-
Corwin72 - Posts: 793
- Joined: 15 Sep 2009, 13:26
- Location: Grayson, Ga
- Has thanked: 25 times
- Been thanked: 9 times
Re: New card tutorial?
by 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
-
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?
by 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.
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.
-
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
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 47 guests