TAKE OFF THE HUD & MESSAGES OR MODIFY THEM

 
The parts of the code in red show the modification to the original Gtest source code.
In this tutorial, we will see how to take the HUD and messages off the screen or where to change the messages.


Hide the Names and Scores of the Bots or the remote clients, go in CLIENT.C inside the function "static geBoolean PrintClientScores":
...
    for (i=0; i< Total; i++)
    {
        int Line;
        ClientInfo = &Client->ClientInfo[Sorted[i]];

        Name = ClientInfo->Name;
        Score = ClientInfo->Score;

        if (Width < SMALL_CONSOLE_CUTOFF_WIDTH)
            Line = i+((Height-30)/6)-9;
        else
            Line = i+((Height-60)/15)-9;

        // Comment those lines.
        //  if (!Console_XYPrintf(GameMgr_GetConsole(Client->GMgr), 0, Line, 0, "%12s: %4i", Name, Score))
        //     return GE_FALSE;
    }
...


Hide the CrossHair, go in CLIENT.C inside the function "geBoolean Client_RenderFrame":
...
// Comment this line.
// PrintCrossHair(Client);
...


Hide the HUD (the status bar at the bottom of the screen), go in CLIENT.C inside the function "static geBoolean RenderWorld":
...
    VidMode_GetResolution(Client->VidMode,&Width,&Height);

    Rect.Left = 0;
    Rect.Right = Width-1;
    Rect.Top = 0;
    // Add this line to stretch the Rect.
    Rect.Bottom = Height - 1;

    // Comment those lines.
    // if (Width<SMALL_CONSOLE_CUTOFF_WIDTH)
        //  Rect.Bottom = Height - 1 - CONSOLE_HEIGHT_320;
    // else
        // Rect.Bottom = Height - 1 - CONSOLE_HEIGHT_640;

    Engine = GameMgr_GetEngine(GMgr);
    assert(Engine);
...


Hide the Driver name and mode on at the top left corner, go in GENVS.C inside the function "int WINAPI WinMain":
...
    if (!ShowStats && World)
    {
        // Comment those lines or replace the text "Driver: %s %s" by whatever you want
        // to see displayed on the top left corner of the screen.
        // e.g: Console_XYPrintf(Console,0,0,0, "MyGame v1.0");
        // Console_XYPrintf(Console,0,0,0,"Driver: %s %s",
        //             DriverModeList[ChangeDisplaySelection].DriverNamePtr,
        //             DriverModeList[ChangeDisplaySelection].ModeNamePtr);
        if (!SoundSys)
        {
            Console_XYPrintf(Console,0,1,0,"(No sound device found)");
        }
    }
...


Hide or change the Messages when you pick up items, go in ITEMS.C inside the function "static geBoolean Item_TriggerHealth":
...
    // Send the info to the client machine that is attached to this player
    if (Target->ClientHandle != CLIENT_NULL_HANDLE)
    {
        GenVSI_SetClientHealth(VSI, Target->ClientHandle, Target->Health);
        // Comment this line or replace the message when picking up health.
        //  GenVSI_ConsoleHeaderPrintf(VSI, Target->ClientHandle, GE_FALSE, "You get 25 health");
    }
...

Inside the function "static geBoolean Item_TriggerArmor":
...
    // Send the info to the client machine that is attached to this player
    if (Target->ClientHandle != CLIENT_NULL_HANDLE)
    {
        UpdateClientInventory(VSI, Target, ITEM_ARMOR);

        // Comment this line or replace the message when picking up an armor.
        //  GenVSI_ConsoleHeaderPrintf(VSI, Target->ClientHandle, GE_FALSE, "You get %i armor", ARMOR_AMOUNT);
    }
...

Inside the function "static geBoolean Item_TriggerRocket":
...
    // Send the info to the client machine that is attached to this player
    if (Target->ClientHandle != CLIENT_NULL_HANDLE)
    {
        UpdateClientInventory(VSI, Target, ITEM_ROCKETS);
        // Comment this line or replace the message when picking up a RocketLauncher.
        // GenVSI_ConsoleHeaderPrintf(VSI, Target->ClientHandle, GE_FALSE, "You get the Rocket Launcher");
    }
...

Inside the function "static geBoolean Item_TriggerRocketAmmo":
...
    // Send the info to the client machine that is attached to this player
    if (Target->ClientHandle != CLIENT_NULL_HANDLE)
    {
        UpdateClientInventory(VSI, Target, ITEM_ROCKETS);
        // Comment this line or replace the message when picking up a Rocket.
        //  GenVSI_ConsoleHeaderPrintf(VSI, Target->ClientHandle, GE_FALSE, "You get some Rocket Ammo");
    }
...

Inside the function "static geBoolean Item_TriggerGrenade":
...
    // Send the info to the client machine that is attached to this player
    if (Target->ClientHandle != CLIENT_NULL_HANDLE)
    {
        UpdateClientInventory(VSI, Target, ITEM_GRENADES);
        // Comment this line or replace the message when picking up a GrenadeLauncher.
        //  GenVSI_ConsoleHeaderPrintf(VSI, Target->ClientHandle, GE_FALSE, "You get the Grenade Launcher");
    }
...

Inside the function "static geBoolean Item_TriggerShredder":
...
    // Actors don't have a client handle
    if (Target->ClientHandle != CLIENT_NULL_HANDLE)
    {
        UpdateClientInventory(VSI, Target, ITEM_SHREDDER);
        // Comment this line or replace the message when picking up a Shredder.
        //  GenVSI_ConsoleHeaderPrintf(VSI, Target->ClientHandle, GE_FALSE, "You get the Shredder");
    }
...

Inside the function "static geBoolean Item_TriggerShredderAmmo":
...
    // Actors don't have a client handle
    if (Target->ClientHandle != CLIENT_NULL_HANDLE)
    {
        UpdateClientInventory(VSI, Target, ITEM_SHREDDER);
        // Comment this line or replace the message when picking up Ammo for a Shredder.
        //  GenVSI_ConsoleHeaderPrintf(VSI, Target->ClientHandle, GE_FALSE, "You get some Shredder Ammo");

    }
...

Inside the function "static geBoolean Item_TriggerGrenadeAmmo":
...
    // Actors don't have a client handle
    if (Target->ClientHandle != CLIENT_NULL_HANDLE)
    {
        UpdateClientInventory(VSI, Target, ITEM_GRENADES);
        // Comment this line or replace the message when picking up Grenades.
        //  GenVSI_ConsoleHeaderPrintf(VSI, Target->ClientHandle, GE_FALSE, "You get some Grenade Ammo");
    }
...


Hide the Messages when the player or a Bot die or kill someone, go in WEAPONS.C inside the function "geBoolean KillPlayer":
...
    if (Owner == Target) // We just killed ourself!!
    {
        // Comment those lines
        // GenVSI_ConsoleHeaderPrintf(VSI, Owner->ClientHandle, GE_TRUE, "%s%s",
        //            Owner->ClassName, DieMsgs[CurrentDieMsg]);
        Owner->Score--;

        CurrentDieMsg++;
        CurrentDieMsg%=NUM_DIE_MSGS;
    }
    else
    {
        // Comment those lines
        //   GenVSI_ConsoleHeaderPrintf(VSI, Owner->ClientHandle, GE_TRUE, "%s%s%s%s",
        //            Owner->ClassName, KillMsgs[CurrentKillMsg<<1], Target->ClassName,
        //            KillMsgs[(CurrentKillMsg<<1)+1]);
        Owner->Score++;

        CurrentKillMsg++;
        CurrentKillMsg%=NUM_KILL_MSGS;
    }
...
You can also change the Die and Kill messages. Go in WEAPONS.C, between the functions  "static geBoolean Player_Dying" and  "geBoolean KillPlayer":
...
#define NUM_DIE_MSGS  4
static int32 CurrentDieMsg = 0;

static char DieMsgs[NUM_DIE_MSGS][128] =
{
    " can't handle life anymore",
    " is a loser",
    " puts a gun to his head",
    " had a nervous breakdown",
};

#define NUM_KILL_MSGS  5
static int32 CurrentKillMsg = 0;

static char KillMsgs[NUM_KILL_MSGS<<1][128] =
{
    " hit ", " with an ugly stick",
    " lays the smack down on ", "...",
    " cracked ", "'s head open",
    " hit ", " with an ugly forest",
    " put a load in ", "'s head",
};
...