It is currently 03 May 2024, 02:47
   
Text Size

Dynamic ID enumerator

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

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

Dynamic ID enumerator

Postby 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".

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
For name like "Ashnod's Altar", I'd like to follow this rule : CARD_ID_ASHNODS_ALTAR.
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
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: Dynamic ID enumerator

Postby 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.
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: Dynamic ID enumerator

Postby Mok » 15 Dec 2011, 16:50

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".

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
For name like "Ashnod's Altar", I'd like to follow this rule : CARD_ID_ASHNODS_ALTAR.
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 ).
lol, you really like to type... but as you wish, it will be CARD_ID_ instead of CID_ :)
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).
Mok
Programmer
 
Posts: 163
Joined: 23 Nov 2011, 14:28
Has thanked: 1 time
Been thanked: 61 times

Re: Dynamic ID enumerator

Postby 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
Mok
Programmer
 
Posts: 163
Joined: 23 Nov 2011, 14:28
Has thanked: 1 time
Been thanked: 61 times

Re: Dynamic ID enumerator

Postby 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
Gargaroz
Programmer
 
Posts: 7097
Joined: 06 Nov 2009, 11:11
Has thanked: 82 times
Been thanked: 595 times

Re: Dynamic ID enumerator

Postby Mok » 16 Dec 2011, 14:34

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 ;)
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.
Attachments
magic_numbers_diff.rar
(20.15 KiB) Downloaded 303 times
Mok
Programmer
 
Posts: 163
Joined: 23 Nov 2011, 14:28
Has thanked: 1 time
Been thanked: 61 times

Re: Dynamic ID enumerator

Postby 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.
----
- 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


Return to Development

Who is online

Users browsing this forum: No registered users and 24 guests


Who is online

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

Login Form