Dynamic ID enumerator
Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!
PLEASE DO NOT REPORT BUGS HERE!
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
Dynamic ID enumerator
by Gargaroz » 15 Dec 2011, 13:57
Here's what I currently made. Obviosuly, actual values are just for show.
Is this correct, Snacko ?
If yes, Mok please arrange csv2dat to produce a file like this, it's named "card_id.h".
Also, the automatic parse must ignore all entries named "Empty" or "None".
I'm not sure about entries that start with "*" : we put that there so they would be the first displayed on the Deck Builder, but for IDs probably it's better to just ignore that special character.
As for special accented characters and like, probably the best thing to do is just annihilate them and replace with the normal characters ( CARD_ID_FROZEN_AETHER ).
Is this correct, Snacko ?
If yes, Mok please arrange csv2dat to produce a file like this, it's named "card_id.h".
- Code: Select all
#ifndef CARD_ID_H
#define CARD_ID_H
typedef enum
{
CARD_ID_RULES_ENGINE = 1,
CARD_ID_DEADBOX = 2,
} card_id_t;
#endif
Also, the automatic parse must ignore all entries named "Empty" or "None".
I'm not sure about entries that start with "*" : we put that there so they would be the first displayed on the Deck Builder, but for IDs probably it's better to just ignore that special character.
As for special accented characters and like, probably the best thing to do is just annihilate them and replace with the normal characters ( CARD_ID_FROZEN_AETHER ).
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: Dynamic ID enumerator
by Snacko » 15 Dec 2011, 16:45
Yes, it's correct and I suppose this is what everyone had in mind Mok including what should be autogenerated.
Re: Dynamic ID enumerator
by Mok » 15 Dec 2011, 16:50
lol, you really like to type... but as you wish, it will be CARD_ID_ instead of CID_Gargaroz wrote:Here's what I currently made. Obviosuly, actual values are just for show.
Is this correct, Snacko ?
If yes, Mok please arrange csv2dat to produce a file like this, it's named "card_id.h".For name like "Ashnod's Altar", I'd like to follow this rule : CARD_ID_ASHNODS_ALTAR.
- Code: Select all
#ifndef CARD_ID_H
#define CARD_ID_H
typedef enum
{
CARD_ID_RULES_ENGINE = 1,
CARD_ID_DEADBOX = 2,
} card_id_t;
#endif
Also, the automatic parse must ignore all entries named "Empty" or "None".
I'm not sure about entries that start with "*" : we put that there so they would be the first displayed on the Deck Builder, but for IDs probably it's better to just ignore that special character.
As for special accented characters and like, probably the best thing to do is just annihilate them and replace with the normal characters ( CARD_ID_FROZEN_AETHER ).
I'll skip "*" and other non-compilable characters in names so CARD_ID_AVATAR_blablah etc., accented names will be replaced, but with a crude 1:1 replacement so it'll be probably end as AE->E, so CARD_ID_FROZEN_ETHER (I'm lazy I know).
Re: Dynamic ID enumerator
by Mok » 15 Dec 2011, 18:02
Here you go. It doesn't check for duplicates so it'll likely produce useless files for now, until we create a first really combined csv, but at least you can do some testing.
- Attachments
-
- csv2dat_with_cids_v1.rar
- (2.16 KiB) Downloaded 309 times
Re: Dynamic ID enumerator
by Gargaroz » 16 Dec 2011, 02:41
Thanx Mok, it's also very useful to find duplicates cards in the CSV : you only have to try to compile with the generated file and then use the error list as guide
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
Re: Dynamic ID enumerator
by Mok » 16 Dec 2011, 14:34
A few days ago I replaced some of the magic numbers in the C code (the version you posted as 4mok_fixed) part automatically, part by hand - for my testing here. It's only a small part though as I lost interest being unable to decide if some numbers are cids or not and the amount I have done was enough to get the game to not crash as often as before. I'm posting a diff here (that will likely not apply anymore though) so you may verify if you got all these places after you do it yourself btw: subtype 44 should be creature and not artifact creature. Dunno why it was defined like that. But subtypes should be also fixed to not use magic numbers otherwise we'll have problems later on.Gargaroz wrote:Thanx Mok, it's also very useful to find duplicates cards in the CSV : you only have to try to compile with the generated file and then use the error list as guide
- Attachments
-
- magic_numbers_diff.rar
- (20.15 KiB) Downloaded 303 times
Re: Dynamic ID enumerator
by Gargaroz » 16 Dec 2011, 19:33
About the "44" code, was our accomodation to sort out the non-creature artifact when using a customized deck builder Jatill made.
For the rest, I'm in the process of replacing as many "magic numbers" as I could find. It will be a long work, but I'll do my best.
For the rest, I'm in the process of replacing as many "magic numbers" as I could find. It will be a long work, but I'll do my best.
----
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Current / medium term task: adjusting the code for making Misdirection and such usable
- Long term task: inserting all the good stuff I left out from the "Golden Years" mod
- Gargaroz
- Programmer
- Posts: 7097
- Joined: 06 Nov 2009, 11:11
- Has thanked: 82 times
- Been thanked: 595 times
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 24 guests