It is currently 25 Apr 2024, 00:57
   
Text Size

development questions

Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!

Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins

Re: development questions

Postby jatill » 30 Mar 2010, 12:09

1) If you use a text editor, you run the risk of messing something up in the csv, which causes the error you mention in #4. So start with a fresh copy and use CardEditor. Then you don't even have to run csv2dat.exe.

2) Yes, use the Dummy slots at the bottom.

3) You guessed right. If the csv is not perfectly formatted (and it can be very picky), then csv2dat will fail and your changes won't be applied.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby aww1979 » 31 Mar 2010, 18:20

Okay, so I was playing around with this, and I ended up with what is in the screenshot. My Air Elemental shows as an 8/8 Flyer for UU with the new flavour text, but when it is actually in play, it still behaves as the old elemental. (the altered stats were all intentional) If I attack with it, it does 4 damage.

In CardEditor, when I look at the cards, I now see in the manalink.csv tab, the top entry (ID #0) is my Uber Elemental, with my modded stats, but in the magic.exe tab, the ID #0 entry (it's in the middle somewhere) is the original Air Elemental. The first Dummy slot has been replaced by my Uber Elemental and his modded stats, and both the original and the modded elemental have ID#0.

Any idea what I did wrong? Obviously I did half the job correctly, but something's missing :p
Attachments
uberelemental.JPG
aww1979
Tester
 
Posts: 1717
Joined: 03 Mar 2009, 19:36
Has thanked: 0 time
Been thanked: 2 times

Re: development questions

Postby jatill » 01 Apr 2010, 12:09

Were you trying to add a new card or replace Air Elemental? If you are trying to add, it needs a new ID. If you are trying to replace, then replace the same slot in the exe tab. Having 2 cards with the same id is bad news.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby aww1979 » 06 Apr 2010, 03:58

I think the problem is I was kind of doing both :p Anyway, I straightened it out tonight (haven't worked on this for a couple days) and I made my uber elemental successfully :)
Attachments
uber.JPG
aww1979
Tester
 
Posts: 1717
Joined: 03 Mar 2009, 19:36
Has thanked: 0 time
Been thanked: 2 times

Re: development questions

Postby aww1979 » 06 Apr 2010, 04:08

Wheeeee I added a new legit card this time :) Not that anybody is likely to actually *want* a Scaled Wurm in constructed. I'm guessing all the decent vanilla creatures have already been coded anyway. At least it's proof of concept...
Attachments
scaledwurm.JPG
aww1979
Tester
 
Posts: 1717
Joined: 03 Mar 2009, 19:36
Has thanked: 0 time
Been thanked: 2 times

Re: development questions

Postby jatill » 06 Apr 2010, 12:02

Congrats! Now get rid of that square character in the flavor text :)
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby aww1979 » 06 Apr 2010, 16:34

Heh, yeah that square came from cut/paste directly from gatherer. I think I'll probably go through the other assembler tutorials just to learn a bit about what's going on, and then go through the C stuff and actually do things with C, since it seems that making what the tutorial calls level 4 cards would be much easier in C.
aww1979
Tester
 
Posts: 1717
Joined: 03 Mar 2009, 19:36
Has thanked: 0 time
Been thanked: 2 times

Re: development questions

Postby jatill » 06 Apr 2010, 20:17

Yeah, the assembler stuff is obsolete unless you need to code something which hasn't been defined in C yet, which is almost nothing. So just skip it.
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby aww1979 » 06 Apr 2010, 22:06

Oh, alright, I'll just move straight to C, then :) Thanks.
aww1979
Tester
 
Posts: 1717
Joined: 03 Mar 2009, 19:36
Has thanked: 0 time
Been thanked: 2 times

Re: development questions

Postby aww1979 » 08 Apr 2010, 01:37

http://www.slightlymagic.net/wiki/Codin ... C_Tutorial

After writing code for a card (I attempted Akroma, Angel of Fury) I tried to follow the tutorial instructions for adding the card (steps 1-5) and I got an error as follows:

Adding _card_akromafury at 20024b5
gcc: installation problem, cannot exec 'cc1': No such file or directory
make: *** [ cards/red_creatures.o] Error 1

Anyway, I decided to ignore it and kept going, and followed the rest of the steps to learn what would happen. So I got the pointer address, put it into skyeditor, and I actually got a partially working Akroma :p He is a 6/6 flying trampling prot white/blue, but my morph, firebreathing, and uncounterability don't work. Also, when I Mana Drained him (testing uncounterability) I only got 2 mana instead of 8, even though I coded his CC correctly at 5RRR.

I wrote the following code: (well, cut and paste and modified existing code, hehe)

int card_akromafury(int player, int card, event_t event)
{
if(event == EVENT_CAST_SPELL )
{
card_instance_t *instance = get_card_instance(player, card);
instance->state |= STATE_CANNOT_TARGET; //akroma fury cannot be countered
}

check_legend_rule(player, card, event);
return morph(player, card, event, 3, 0, 0, 0, 3, 0);//morphs up for 3RRR

if( event == EVENT_CAN_ACTIVATE && has_mana_multi(player, 1, 0, 0, 0, 1, 0) )
{
return 1; //you can't pay to firebreathe (no red mana)
}
else if( event == EVENT_ACTIVATE )
{
charge_mana_multi(player, 0, 0, 0, 0, 1, 0);//costs R to firebreathe
}
else if( event == EVENT_RESOLVE_ACTIVATION )
{
card_instance_t *instance = get_card_instance(player, card);
pump_until_eot(player, card, player, instance->parent_card, 1, 0); //+1/+0 firebreathing resolves
}

return 0;
}

edit: oh, and I took the uncounterable part from Volcanic Fallout, the morph from Exalted Angel and the firebreathing from Two-Headed Dragon (and edited the mana costs accordingly)

edit again: seems legendary didn't work either :p
aww1979
Tester
 
Posts: 1717
Joined: 03 Mar 2009, 19:36
Has thanked: 0 time
Been thanked: 2 times

Re: development questions

Postby Snacko » 08 Apr 2010, 10:54

My crystal ball says you haven't installed gcc properly.
As the errors says you haven't compiled anything because you're missing at least cc1.exe.
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: development questions

Postby aww1979 » 08 Apr 2010, 19:25

That's quite possible :p However, I don't remember seeing anything about it in the installation steps, so I'll have to do some digging to figure out what cc1/gcc is.
aww1979
Tester
 
Posts: 1717
Joined: 03 Mar 2009, 19:36
Has thanked: 0 time
Been thanked: 2 times

Re: development questions

Postby jatill » 08 Apr 2010, 19:28

It comes with camelbox. Make sure that you have those files in camelbox/bin, and that you run the build command from there.

Edit: I don't have cc1 in camelbox/bin, but I do have gcc, and that's enough for me
jatill
DEVELOPER
 
Posts: 2118
Joined: 24 Feb 2009, 16:35
Has thanked: 5 times
Been thanked: 17 times

Re: development questions

Postby aww1979 » 08 Apr 2010, 20:15

Oh... I've been running build in the magic directory, since I was editing the ones in that location. I do have a gcc.exe in my camelbox directory, so the issue is probably just related to the path, as well as my not working on the right files.
aww1979
Tester
 
Posts: 1717
Joined: 03 Mar 2009, 19:36
Has thanked: 0 time
Been thanked: 2 times

Re: development questions

Postby Snacko » 08 Apr 2010, 21:00

gcc is just a proxy application, the compilation is done by cc1.exe, but with camelbox it should come bundled. Make sure you install the MinGW part.
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

PreviousNext

Return to Development

Who is online

Users browsing this forum: No registered users and 21 guests


Who is online

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

Login Form