.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Common Questions (http://forums.bots-united.com/forumdisplay.php?f=51)
-   -   Turn off Bots shooting back after Teamattack (http://forums.bots-united.com/showthread.php?t=9978)

KWo 13-06-2018 23:14

Re: Turn off Bots shooting back after Teamattack
 
That fix could not work because of the wrong comparing direction...

It should be done this way:
PHP Code:

((pEdict->v.dmg_inflictor != clients[i].pEdict) || (pEdict->v.dmgtime 1.5 >= gpGlobals->time)) 

That should work better...
Sorry... :(

RoboCop 14-06-2018 15:55

Re: Turn off Bots shooting back after Teamattack
 
1 Attachment(s)
I've recompiled POD-Bot again, also just to make things easier I've included both Debug and Optimised builds in this zip for both Win32 and Linux servers. They will maybe need to be monitored for any crashes or instablity issues. But those are the Metamod plugins I'm using for my CS 1.6 server:-

] meta list
Currently running plugins:
[ 1] Adminmod, v2.50.61-beta5 (MM), Mar 1 2018, by Alfred Reynolds & RoboCop <robocop@lycos.co.uk>, see www.adminmod.org
[ 2] LogDaemon, v1.0.0.7, 2015/11/30, by Will Day <willday@metamod.org>, Tim Thelin, <Kndroc@hotmail.com>, Pieter de Zwart,
[ 3] AGuard, v1.6, Nov 30 2017, by Nikolay <SpooK> Milkov, see http://www.nmsoft.ml/
[ 4] AMX Mod X, v1.8.2, Feb 14 2013, by AMX Mod X Dev Team, see http://www.amxmodx.org
[ 5] POD-Bot mm, vV3B23-APG, Jun 14 2018, by Count Floyd & Bots United, see http://www.bots-united.com

KWo 14-06-2018 22:27

Re: Turn off Bots shooting back after Teamattack
 
After rethinking the problem and the logic the conclusion is:
the first idea was correct (and the comparator direction). I have added yet some code to depand the shoot back time on the current bot's aggression level. Finaly - after limited testing time - the code should look like this:

PHP Code:

   if (!FNullEnt (tr.pHit))
   {
      
ENTINDEX (tr.pHit) - 1;
      if ((
>= 0) && (gpGlobals->maxClients))  // KWo - 13.03.2006
      
{
         if ((
clients[i].iTeam == pBot->bot_team
            && ((
pEdict->v.dmg_inflictor != clients[i].pEdict) || ((pEdict->v.dmgtime 1.5 pBot->fAgressionLevel) <= gpGlobals->time))
            && ((
clients[i].iFlags CLIENT_ALIVE) || (clients[i].fDeathTime >= gpGlobals->time)))  // KWo - 13.06.2018
         
{
            if (
g_b_DebugCombat)
               
ALERT (at_logged,"[DEBUG] FireHurtsFriend - Bot %s cannot fire because it may hurt its friend %s (1).\n"pBot->nameSTRING (clients[i].pEdict->v.netname));

            return (
TRUE);
         }
      }
   } 

Sorry for confusion and the useless work with compliling and uploading binaries. The code should be tested first by the author, then - by users. Unfortunately I don't have enough time to do it so.
I have also added a code to increase the bot aggessivity when the teamnate is shooting at it. In botclient.cpp in the function BotClient_CS_Damage

PHP Code:

               if ((UTIL_GetTeam (pEnt) == pBot->bot_team) && (!g_b_cv_ffa)) // KWo - 05.10.2006
               
{
                  
// FIXFIXFIXFIXFIXME: THIS IS BLATANTLY CHEATING!!!!
                  // KWo - No - it's when Your teamnate is attacking You, then the bot may consider You as an enemy
                  // but BotHurtsFriends function doesn't let him to shoot at You...
                  
if (RANDOM_LONG (1100) < 10)
                  {
                     if (
FNullEnt (pBot->pLastEnemy) && FNullEnt (pBot->pBotEnemy)
                        && (
pBot->f_bot_see_enemy_time 3.0 gpGlobals->time)
                        && (
pBot->f_blind_time gpGlobals->time)) // KWo - 23.03.2008
                     
{
//                        pBot->iAimFlags |= AIM_ENEMY; // KWo - 27.08.2006
//                        pBot->iAimFlags |= AIM_LASTENEMY; // KWo - 27.08.2006
                        
pBot->f_heard_sound_time gpGlobals->time;
//                      pBot->pBotEnemy = pEnt;
                        
pBot->pLastEnemy pEnt;
                        
pBot->vecLastEnemyOrigin pEnt->v.origin;
                        
pBot->vecLastEnemyOrigin.+= RANDOM_FLOAT(-200.0,200.0);  // KWo - 12.08.2007
                        
pBot->vecLastEnemyOrigin.+= RANDOM_FLOAT(-200.0,200.0);  // KWo - 12.08.2007
                        
pBot->fLastHeardEnOrgUpdateTime gpGlobals->time 1.0;

                        
pBot->fAgressionLevel += 0.1;   // KWo - 14.06.2018
                        
if (pBot->fAgressionLevel 1.0// KWo - 14.06.2018
                           
pBot->fAgressionLevel 1.0;

                     }
                  }
               } 

That should do the job correctly.

RoboCop 24-06-2018 03:19

Re: Turn off Bots shooting back after Teamattack
 
Err are you able to point out which line number they are located, please?

KWo 24-06-2018 14:17

Re: Turn off Bots shooting back after Teamattack
 
The file is botclient.cpp. The function is BotClient_CS_Damage. Lines 403..427.
The line 403:
PHP Code:

if ((UTIL_GetTeam (pEnt) == pBot->bot_team) && (!g_b_cv_ffa)) // KWo - 05.10.2006 

starts the check if the teamnate was the particular bot's attacker.
Lines 424..427 are added lines posted in my previous post.
PHP Code:

pBot->fAgressionLevel += 0.1;   // KWo - 14.06.2018
if (pBot->fAgressionLevel 1.0)   // KWo - 14.06.2018
   
pBot->fAgressionLevel 1.0;   // KWo - 14.06.2018 


RoboCop 25-06-2018 23:46

Re: Turn off Bots shooting back after Teamattack
 
1 Attachment(s)
OK thanks I've recompiled those builds and added that new script and for the '[DEBUG] FireHurtsFriend - Bot %s cannot fire because it may hurt its friend %s (1).\n' as well. Feel free to test them, also if you want to check those bots in my CS 1.6 server let me know.

joeysmile 26-06-2018 04:04

Re: Turn off Bots shooting back after Teamattack
 
Hi,
great news and thank you for your effort, but the last beta version does not work, no bot will appear on the map, we needed to revert it to the last version, does someone have such problems too?

RoboCop 27-06-2018 20:44

Re: Turn off Bots shooting back after Teamattack
 
Oh it seems to run fine on my side, even though I'm testing those bots in Debug Mode with the POD-Bot Debug build and using GDB for CS 1.6 Linux.

Any other problems?

joeysmile 28-06-2018 12:13

Re: Turn off Bots shooting back after Teamattack
 
I am using normal version and windows OS, they did not appear on the map at all, so I use the last stable build with the shooting back for now :/ other people with experiences on windows build, what should be wrong?

RoboCop 28-06-2018 16:44

Re: Turn off Bots shooting back after Teamattack
 
1 Attachment(s)
Weird they seem to be working on my Windows 10 PC Listenserver...Also try this zip...it contains Metamod-P37 along with the latest Windows build and Debug build of POD-Bot.


All times are GMT +2. The time now is 00:34.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.