Quake3World.com Forums
     Programming Discussion
        Intercepting Com_Printf?


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: Intercepting Com_Printf?

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44138
PostPosted: 05-03-2011 09:51 AM           Profile   Send private message  E-mail  Edit post Reply with quote


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:
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... :(




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 05-03-2011 11:00 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44138
PostPosted: 05-03-2011 09:28 PM           Profile   Send private message  E-mail  Edit post Reply with quote


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!




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.