Thread: RCBot 2
View Single Post
Re: RCBot 2
Old
  (#6)
limpan
Member
 
limpan's Avatar
 
Status: Offline
Posts: 1
Join Date: Jul 2006
Default Re: RCBot 2 - 31-12-2006

Hi,
Iīm working on a mod to hl2dm with bots, itīs not a plugin, and I noticed this "default dumb bot actions" when I updated the SDK with the latest release.
After some headscratching Iīd come up with a solution to my problem.

When creating a bot you create an edict_t with something like this:
Code:
edict_t *pEdict = ::engine->CreateFakeClient(szName);
and with that I can get an CHL2MP_Player (but in a plugin you donīt have access to CBaseEntity ):
Code:
CHL2MP_Player*pPlayer=((CHL2MP_Player*)CBaseEntity::Instance(pEdict));
pPlayer->ClearFlags();
pPlayer->AddFlag( FL_CLIENT | FL_FAKECLIENT );
anyway I removed the flag FL_FAKECLIENT from the AddFlag() function and the dumb default behaviour was gone and my bots moved as they should.

The problem now was when I removed a bot from the server the game crashed on some flag checking function but that was fixed with adding the FL_FAKECLIENT flag right before the bot being removed.

This will probably not help a plugin if this is the problem and if it is then itīs up to valve to change their engine code that handles fakeclients
  
Reply With Quote