UFO:Alien Invasion
Development => Coding => Topic started by: Hoehrer on March 27, 2006, 12:03:24 am
-
Is there already a function (for debugging) that lists _every_ type of item that can be in the inventor (csi->ods[all] should hold them i suppose?)
If not i'll probably write one.. then the next question is where to put it ... but i'll come back to that ;)
Werner
-
Hi
Probably a collection of debugging-experimental-funcs would be nice, something like dbg_showallitems.
ox
-
imo there is no function rigth now.
maybe we should rename all the *list functions to dbg_*list and make them only available in debug-compiles....??
-
imo there is no function rigth now.
maybe we should rename all the *list functions to dbg_*list and make them only available in debug-compiles....??
I don't see a reason to not let them stay in a release as well (bug-reports, etc...), and cheating isn't really a problem since most of the info is already readable in the ufo-files.
concerning a common prefix for _pure_ debugging functions is a good idea. "DBG_*" sounds good to me for C functions. The naming of the console should either be "dbg_***list" "or simply ***list" (IMHO the shorter the better) where the latter is how is's here in my code currently: "invlist" & "techlist" in the commandline . Since nearly every command in the console is a 'debug' function right now i don#t see a reason to use a special prefix for that.
Ok, back to the first topic: I've started to write a simple function yesterday to print the ics->sds content (named it "R_ItemList_f "or something like that after RS_TechnologyList_f in cl_research.c) ... i don't have access to it right now, so i'm not sure about the name.
I currently put it into q_shared.c (+ header in q_shared.h) and made it availabe to the in-game console in cl_research.c since i didn't find any suited function in q_shared.c at all. So i'm currently searching fo a better place for this. (maybe cl_main.?)
Werner
PS: on a sidenote how do i use parameters in the binsing of console-commands (just an example: "techlistlist plasma" will list only plasma)
-
char* filter = NULL;
if (Cmd_Argc() == 2) // 2 because the first one it the actual command itself
{
filter = Cmd_Argv(1);
}
if ( filter != NULL )
[,....]
-
Since nearly every command in the console is a 'debug' function right now i don#t see a reason to use a special prefix for that.
The reason is consistency
I don't see a reason to not let them stay in a release as well (bug-reports, etc...)
True. Quake3 hase some startup command for the server, to activate debugging-support.
ox
-
char* filter = NULL;
if (Cmd_Argc() == 2) // 2 because the first one it the actual command itself
{
filter = Cmd_Argv(1);
}
if ( filter != NULL )
[,....]
Thanks, i'll have a look into it.
Since nearly every command in the console is a 'debug' function right now i don#t see a reason to use a special prefix for that.
The reason is consistency
To be consitent with what? Are there already built-in commands that start with "dbg_"? Or do you mean consistent with the names in C-code?
And where do we draw the line between "dbg_" and the others? Some of the functions _should_ only be used for debugging, but some of them may become a frequently used command for the average player.
I'm do not want to make this a huge topic - since it's rather unimportant for the game itself - so i'm fine with any way we decide on.
Werner
-
Hi
To be consistent with all the cl_ g_ sv_ mn_ and so on stuff. But i'm like you not interested in a huge discussion on the dopic ;)
ox