![]() |
![]() |
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 |
Cheeseh |
![]()
Post
#3
|
![]() Admin ![]() ![]() ![]() ![]() ![]() Group: Admin Posts: 3,066 Joined: 11-September 03 From: uk Member No.: 1 ![]() |
To be honest I don't know, I haven't tried bots crouching, I guess the same might happen come to think of it.
You could try 'bot_dontmove 1' command and it might stop some things from happening the tf2 inbuilt bot stuff will still be running in the background, so bot_mimic etc will take over control and stuff, even if you use CreateBot() I noticed TF2 still did this, so there is something dodgy going on behind the scenes and this could be the cause of the "fast gravity" glitch |
Tauphi |
![]()
Post
#4
|
Newbie ![]() Group: Members Posts: 5 Joined: 2-June 09 Member No.: 1,564 ![]() |
I already tried commands like "bot_dontmove" or so ... but TF2 is still using it's own engine to overwrite my set bot commands ...
I think valve's code looks a bit like this: CODE void Bot_Think( CPluginBot *pBot ) that their think function at least resets the CBotCmd object ....{ CBotCmd cmd; Q_memset( &cmd, 0, sizeof( cmd ) ); if ( bot_dontmove.GetInt() > 0 ) { //do something... } pBot->m_BotInterface->RunPlayerMove( &cmd ); } Did you ever have any contact to a guy from valve? I emailed Tony and Alfred about the broken IBotManager interface, but they never replied. Perhaps they are the wrong guys for that problem, but I don't know others of the team. |
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 20th June 2025 - 06:09 PM |