Intercepting Com_Printf?

Locked
User avatar
Eraser
Posts: 19174
Joined: Fri Dec 01, 2000 8:00 am

Intercepting Com_Printf?

Post by Eraser »

In Q3, whenever bot AI files are loaded, you get these messages like "loaded skill xxxx from bots/visor_c.c". I was looking for a way to get rid of these messages, and my hunt for them ended up in not much.
I found that the messages originate from the trap_BotLoadCharacter call in the BotAISetupClient method in ai_main.c. This is a call to the engine which I traced to some botimport.Print call. Couldn't exactly find where that ended up, except for this method in sv_bot.c:

static void QDECL BotImport_Print(int type, char *fmt, ...)

especially this bit of code:

Code: Select all

switch(type) {
    case PRT_MESSAGE: {
        Com_Printf("%s", str);
        break;
    }
...
If this is the right place, it looks like it does just a Com_Printf call. I wasn't sure if I could intercept this in the game/cgame code again, but I found this method in g_main.c:

void QDECL Com_Printf( const char *msg, ... )

But commenting out all of it's contents doesn't seem to have any effect. Not sure if I'm looking in the right place either.
Is there any way to intercept these bot loading messages somehow without needing access to the engine code? I'm afraid I already know the answer... :(
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: Intercepting Com_Printf?

Post by ^misantropia^ »

Eraser wrote:Is there any way to intercept these bot loading messages somehow without needing access to the engine code? I'm afraid I already know the answer... :(
:(

That Com_Printf() in g_main.c is not the function the engine calls.
User avatar
Eraser
Posts: 19174
Joined: Fri Dec 01, 2000 8:00 am

Re: Intercepting Com_Printf?

Post by Eraser »

Yeah I was afraid that was the case.
Shame really, as it's kind of annoying for my EntityPlus mod when you get these messages every time a bot is spawned into the game. Curses id Software! Curses!
Locked