It is currently 17 Aug 2018, 07:14
   
Text Size

Issues with card scripting

Moderators: nantuko84, CCGHQ Admins

Issues with card scripting

Postby Mizar » 09 Sep 2010, 13:03

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.
Last edited by Mizar on 10 Sep 2010, 14:14, edited 2 times in total.
Mizar
 
Posts: 20
Joined: 05 Sep 2010, 14:05
Location: Germany
Has thanked: 0 time
Been thanked: 0 time

Re: Issues with card scripting

Postby nantuko84 » 10 Sep 2010, 03:28

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.
Mage\MagicWars blog: http://mwars.blogspot.com/
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Issues with card scripting

Postby Mizar » 10 Sep 2010, 14:13

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
Mizar
 
Posts: 20
Joined: 05 Sep 2010, 14:05
Location: Germany
Has thanked: 0 time
Been thanked: 0 time

Re: Issues with card scripting

Postby nantuko84 » 10 Sep 2010, 14:34

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 :)
Mage\MagicWars blog: http://mwars.blogspot.com/
nantuko84
DEVELOPER
 
Posts: 266
Joined: 08 Feb 2009, 21:14
Has thanked: 2 times
Been thanked: 9 times

Re: Issues with card scripting

Postby Mizar » 10 Sep 2010, 15:18

Oops, you're right. Everything is working now. Thank you again :D
Mizar
 
Posts: 20
Joined: 05 Sep 2010, 14:05
Location: Germany
Has thanked: 0 time
Been thanked: 0 time


Return to MagicWars

Who is online

Users browsing this forum: No registered users and 2 guests


Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 2 guests

Login Form