It is currently 23 Apr 2024, 06:14
   
Text Size

Creating Custom card set

Post MTG Forge Related Programming Questions Here

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

Creating Custom card set

Postby jmlima » 13 Apr 2014, 13:56

I was trying to create a custom card set and went through the cards folder in res/cardsfolder.

Now, I noticed that each card has got its own file, and the file sets the parameters for the card. Is there a list of waht parameters are available, what each of these things inside each cards txt file is?

How are new cards in that folder connected to an image? (I noticed that inside the cards txt the image link points to a wizards website??)

Thanks.
User avatar
jmlima
 
Posts: 46
Joined: 02 Apr 2013, 18:20
Has thanked: 4 times
Been thanked: 5 times

Re: Creating Custom card set

Postby friarsol » 13 Apr 2014, 15:06

The general docs for the Card API is here:
http://www.slightlymagic.net/wiki/Forge_API

It's probably a bit out of date at this point, but it should be generally correct. There may just be some missing APIs or parameters. In some cases we've removed fake "Keywords" from the parser so these would have to be scripted.

The SVar:Picture: paramter is used to associate the card script with the image downloaded through the LQ Picture Downloader. You just need to point to a valid URL. Custom sets are not supported with the LQ Set Picture Downloader at this time.

I'd recommend doing a handful of things:

1. Create a single folder for your entire set, instead of placing them in the A,B,C etc folders the way official cards are.

res/cardsfolder/<jmlima_set>/awesome_card.txt
res/cardsfolder/<jmlima_set>/broken_mythic.txt

You get the idea.

2. You need an edition file in res/editions/<jmlima_set>.txt
You should be able to figure out the formatting based off recent card sets.

3. One of the best resources of card scripts is existing card scripts. Searching magiccards.info for similar cards and reading that script can help determine what is and isn't possible. You can also post here: viewtopic.php?f=52&t=3760 and we may provide limited support. Of course, we won't really add any code for custom sets, but we could at least provide some tips about what to try.

For example, the new card from JOU http://www.magicspoiler.com/mtg-spoiler ... ret-signs/ is kinda like Riddle of Lightning. Similar Scry and Reveal mechanism. Evaluating a number based on the revealed cards CMC. The main difference is you get to draw cards instead of deal damage.

Riddle of Lightning | Open
A:SP$Scry | Cost$ 3 R R | ScryNum$ 3 | SubAbility$ DBReveal | SpellDescription$ Choose target creature or player. Scry 3, then reveal the top card of your library. CARDNAME deals damage equal to that card's converted mana cost to that creature or player. (To scry 3, look at the top three cards of your library, then put any number of them on the bottom of your library and the rest on top in any order.)
SVar:DBReveal:DB$ Dig | Cost$ 0 | DigNum$ 1 | Reveal$ True | DestinationZone$ Library | LibraryPosition$ 0 | SubAbility$ DBDamage
SVar:DBDamage:DB$ DealDamage | Cost$ 0 | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ X | References$ X
SVar:X:Count$TopOfLibraryCMC


Compare that with the script Swordshine wrote for Interpret Signs
Interpret Signs | Open
A:SP$ Scry | Cost$ 5 U | ScryNum$ 3 | SubAbility$ DBReveal | SpellDescription$ Scry 3, then reveal the top card of your library. Draw cards equal to that card's converted mana cost.
SVar:DBReveal:DB$ Dig | Cost$ 0 | DigNum$ 1 | Reveal$ True | NoMove$ True | SubAbility$ DBDraw
SVar:DBDraw:DB$ Draw | NumCards$ X | References$ X
SVar:X:Count$TopOfLibraryCMC



You can see the major difference is the last SubAbility for the Draw instead of Damage. There's also a simplified "NoMove" parameter for the Reveal instead of placing the top card back ontop of your library. I think a few people have created custom sets, so they may be able to give some more pointers.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Creating Custom card set

Postby jmlima » 13 Apr 2014, 16:41

Many thanks! That is indeed most helpful.
User avatar
jmlima
 
Posts: 46
Joined: 02 Apr 2013, 18:20
Has thanked: 4 times
Been thanked: 5 times

Re: Creating Custom card set

Postby lugaru » 14 Apr 2014, 00:54

Wait, so I could create a folder for my 'set' instead of putting it in A, B, C or whatever? That is super good news, I will test it out soon.

Yeah, so I've been working on 3 custom sets (a commander expansion, a set a friend made and another set a friend made).

The edition file you will create dictates a lot about your set, such as the art. For example if your set has an alternate art for 'demonic tutor' (like one friends set does) as soon as you are done with that edition set you will see demonic tutor with alternate art come up for your set. Also when you create a folder with your pics, make sure they are all .full

When I first started I was freaking out until somebody pointed the .full out part.

As for scripts what friarsol mentions is super helpful. I don't have a brain for coding but I can copy and paste and trial and error, so I search for similar cards and when I'm done with them I drop them in a folder called 'reference' in case I need them again.

For example one friends set has a mechanic called Blood Ritual that has cool stuff happen whenever you sacrifice a creature (so you have multiple Aztek priests making you draw cards or deal damage or whatever whenever a card makes you sacrifice). I was able to track down dragon appeasement and that helped me create a base mechanic where I can inject stuff like 'target player discards a card' instead of you draw.
lugaru
 
Posts: 79
Joined: 19 Jun 2011, 16:17
Has thanked: 1 time
Been thanked: 1 time

Re: Creating Custom card set

Postby torridus » 10 Jun 2014, 00:33

friarsol wrote:1. Create a single folder for your entire set, instead of placing them in the A,B,C etc folders the way official cards are.

res/cardsfolder/<jmlima_set>/awesome_card.txt
res/cardsfolder/<jmlima_set>/broken_mythic.txt

You get the idea.

2. You need an edition file in res/editions/<jmlima_set>.txt
You should be able to figure out the formatting based off recent card sets.
I used to add custom cards into the alphabetical folders so being able to make a new folder is incredibly useful. I managed to successfully do this once (along with creating an edition file) but now that I'm doing it again, Forge doesn't finish loading. It says it's loading the cards, then the loading screen freezes at 96%. I've changed several things, ensured stuff is coded correctly, etc. Might anyone have an idea why this happens?

Adding information to the "blockdata" folder for custom sets doesn't seem to have an impact.
In the "lists" folder I added new Planeswalker types since this custom set has Planeswalkers, but that hasn't done anything either. None of them have emblems or new/conflicting mechanics.
I've swapped info around in the edition file too, like changing between core/expansion. Nada.

I'm still troubleshooting, but I'm puzzled as to why this is happening.
torridus
 
Posts: 56
Joined: 03 Jul 2012, 12:58
Has thanked: 4 times
Been thanked: 9 times

Re: Creating Custom card set

Postby timmermac » 10 Jun 2014, 00:46

I've only created one custom card to this point, but I put it in /cardsfolder/r/ and it works. I would try going back to the letter method and see if that works.
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 times

Re: Creating Custom card set

Postby torridus » 10 Jun 2014, 00:57

I took all the cards out of the folder and added them back in groups, checking to see if Forge froze with any particular group. It did.

It turns out that Forge dislikes one of my cards, and will work perfectly fine as long as that certain card is not in the card folder. So I've isolated the problem, but haven't figured out WHY it's a problem. There isn't anything wrong with the code, as far as I can tell (it's a relatively simple artifact) but I'm double-checking.

I really like Forge for custom cards though. Much better than the other programs imo even if it does require a lot of work to manually code everything. If there was a script to automate the process from MTG Set Editor that would be awesome, but oh well.
torridus
 
Posts: 56
Joined: 03 Jul 2012, 12:58
Has thanked: 4 times
Been thanked: 9 times

Re: Creating Custom card set

Postby timmermac » 10 Jun 2014, 01:02

Go ahead and post the card script, and maybe the devs can tell you what's causing the card to crash the game.
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 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