![]() |
![]() |
Tauphi |
![]()
Post
#1
|
Newbie ![]() Group: Members Posts: 5 Joined: 2-June 09 Member No.: 1,564 ![]() |
Hi all and Hi Cheeseh,
I am currently playing with the IBotManager interface of the Orange Box SDK, but my plugins always crash, when I call the CreateBot() function. The rcbot does work with the current TF2 version or? May I ask how you get it to work to add and control a bot with the "broken" IBotManager interface? Or did you find a workaround for it? Thanks in advance for tips and help! regards Andi |
![]() ![]() |
Tauphi |
![]()
Post
#2
|
Newbie ![]() Group: Members Posts: 5 Joined: 2-June 09 Member No.: 1,564 ![]() |
Hi Cheeseh,
thanks for the great info, how you made it. But there is still one thing I don't understand... I had the idea too, to add a braindead bot with the "bot" command and to control that bot with it's own bot controller ... I used this OnGameFrame code for this: CODE void OnGameFrame( bool simulating ) { On every Game Frame I check all players if they are bots and have a bot controller. When I add a bot with "bot" it has that controller, so it seemed ok for me ...if ( simulating ) { for ( int client = 0; client < gpGlobals->maxClients; client++ ) { IGamePlayer *player = playerhelpers->GetGamePlayer(client); if ( player == NULL || !player->IsInGame() || !player->IsFakeClient() ) continue; IPlayerInfo *info = player->GetPlayerInfo(); if ( info == NULL ) continue; edict_t *edict = player->GetEdict(); if ( edict == NULL ) continue; IBotController *botc = botmanager->GetBotController(edict); if ( botc == NULL ) continue; CBotCmd cmd; Q_memset( &cmd, 0, sizeof( cmd ) ); cmd.buttons |= IN_DUCK; botc->PostClientMessagesSent(); botc->RunPlayerMove(&cmd); } } } Next is, that I create"buttons" which say to crouch all the time with IN_DUCK ... But when I run "RunPlayerMove" with the buttons nothing happens. Better said: Valves own Bot engine is running RunPlayerMove on every GameFrame, too. So the engine got told "crouch, dont crouch, crouch, dont crouch, and so on and so on" ... The crouch animation isn't fast enough, so it seems that nothing happens. Another thing is, when I set "bot_forceattack" to 1 the bots start firing their guns ... This shows, that the bot's own engine is running at the same time, too... I took a look into your source code and found your snippets about adding and controlling a bot ... but, how did you stop the bot's own engine? I hope you understand what I mean, my english is not the best ;D best regards Andi |
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 21st June 2025 - 05:33 AM |