CASTING THE SHADOW OF THE BOTS

 
The parts of the code in red show the modification to the original Gtest source code.
This tutorial shows you how to modify Gtest in order to have the Bots casting their shadow. However, you may notice some weird effect when the shadow is cast on translucent surfaces.


In CLIENT.C, add the line :
...
// Add this line after the other #include declarations
// This header file is needed in order to use ViewIndex (ACTOR_INDEX_PLAYER, etc…)
#include "../Game/Gmain.h"
...
 


Go in CLIENT.C inside the function "static geBoolean CheckClientPlayerChanges":
Replace the following if statement...
...
    if (Client->ViewPlayer == PlayerIndex && !TempPlayer)
    {
            if (!geActor_SetShadow(Player->Actor, GE_TRUE, 100.0f, GameMgr_GetShadowMap(Client->GMgr), NULL))
                    GenVS_Error("[CLIENT] CheckClientPlayerChanges:  Could not set actor shadow.  ActorDef Name: %s.\n", ActorIndex->FileName);
    }
...
by ...
    if (Player->ViewIndex == ACTOR_INDEX_BADGUY || Player->ViewIndex == ACTOR_INDEX_PLAYER && !TempPlayer)
    // Use the ViewIndex of your Bots.
    {
            if (!geActor_SetShadow(Player->Actor, GE_TRUE, 100.0f, GameMgr_GetShadowMap(Client->GMgr), NULL))
                    GenVS_Error("[CLIENT] CheckClientPlayerChanges:  Could not set actor shadow.  ActorDef Name: %s.\n", ActorIndex->FileName);
    }
...