Page 1 of 1

Issues with card scripting

PostPosted: 09 Sep 2010, 13:03
by Mizar
I tried to script the simple card Boros Recruit. So I've read your Wiki about card scripting at Google Code (http://code.google.com/p/magicwars/wiki/DevelopmentManual) and I came up with this cardfile:
Code: Select all
name = "Boros Recruit"
manacost = "R\\W"
types = [ "Creature", "Goblin", "Soldier" ]
power = 1
toughness = 1
text = ["First strike"]

prints = [
   ["RAV", "C", 88992, 243]
]
Then I moved this cardfile to the respective directory:
../cards/groovy/B/o/r/Boros Recruit.card
But when I start the programm the card isn't shown in the deck editor. It's simply not there :cry: .

Did I miss something?

EDIT: Added a second backslash to the manacost.

Re: Issues with card scripting

PostPosted: 10 Sep 2010, 03:28
by nantuko84
Hi,

The problem is that your card is on server now, but not is on your client. Client uses its own card database and you need to update it:
1. Start the game
2. Press "Update card base for Deck Editor" in menu
3. If you opened deck editor before, press "New Constructed (All cards)"

I believe you need to test your card, and putting the card into your deck and then waiting for until it appears takes time, so here is the link that may help you:
http://code.google.com/p/magicwars/wiki/TestYourCard

hope this helped.
feel free to ask any questions.

Re: Issues with card scripting

PostPosted: 10 Sep 2010, 14:13
by Mizar
Thank you very much for your help. It really works now. I was so happy that I made a screenshot that shows two of my added cards (Boros Recruit and Courier Hawk) in play :mrgreen: :
Image

I also followed your link, but there was one thing that is not working. Its the "odds.txt" file. I created a simple "odds.txt" file that contains only the following card:
Code: Select all
Mountain
4
When I start a game versus the AI then I get this strange dialog:
Image
After clicking OK I have this error message in the console window (I could not copy the message, so heres another screenshot):
Image
I also tried to add the player id to the filename ("odds8.txt"), but I get the same error. Anyway the debug mode and the "hand.txt" file are working very well.

I am really impressed how easy it is to add some cards to your programm. I will try to add some more cards to become more familiar with card scripting. Thank you again for your help :D

Re: Issues with card scripting

PostPosted: 10 Sep 2010, 14:34
by nantuko84
Possibly because of "End" missing at the end of odds file. I guess you have it in hands.txt, don't you?

So try this:
Code: Select all
Mountain
4
End
And my congratulations with your first cards :)

Re: Issues with card scripting

PostPosted: 10 Sep 2010, 15:18
by Mizar
Oops, you're right. Everything is working now. Thank you again :D