PDA

View Full Version : Enable debug-comments /##/



serthy
5th September 2016, 11:40
Hey,

I just forgot how to enable the debug comments /##/ (if it was even possible to begin with).
I don't want to clutter the mod with if( debug ) printf();

I have tested it with /developer 1 and /developer 2 and this short function, however I never saw the COMMENT print:



test()
{
/# printf( "COMMENT\n" ); #/
printf( "TEST\n" );
}

IzNoGoD
5th September 2016, 13:07
dprint/dprintf i think is a printf for developer 1/2

serthy
6th September 2016, 12:13
dprint/dprintf i think is a printf for developer 1/2

Thanks, I'll use that for now.

But still, possible debug computations can only be wrapped in /##/

serthy
6th September 2016, 13:11
dprint/dprintf aren't functions

however starting the server with +set developer_script 1 enables the /##/ comments, print()/println() and assert() functions

(I just forgot about developer_script)

I use +set developer_script 1 +set developer 2 +set debug 1, dont know if its a combination of them, or just a siingle one, hoewver it works, and im happy with it

IzNoGoD
6th September 2016, 13:38
Ah, it's com_dprintf in c/c++ source. Not extended to gsc yet.

Try this if you really need it:


dprintf(str)
{
if(getcvarint("developer"))
printf(str);
}