Raised This Month: $ Target: $400
 0% 

Anyone able to convert this to work with cz bots?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LukeyB
Member
Join Date: Dec 2011
Old 12-18-2011 , 05:21   Anyone able to convert this to work with cz bots?
Reply With Quote #1

PHP Code:
{
   
// Check if Bot 'sees' a SmokeGrenade to simulate the effect of being blinded by smoke
   // + notice Bot of Grenades flying towards him
   // TODO: Split this up and make it more reliable
   
static edict_t *pEdict;
   static 
edict_t *pent;
   static 
edict_t *pSmoke// KWo - 26.03.2007
   
static Vector vecView;
   static 
float fDistance;
   static 
int iInField;
   
pEdict pBot->pEdict;
   
pent pBot->pAvoidGrenade;
   
pSmoke pBot->pSmokeGrenade;
   
vecView GetGunPosition (pEdict);
   
// Check if old ptr to Grenade is invalid
   
if (FNullEnt (pent))
   {
      
pBot->pAvoidGrenade NULL;
      
pBot->cAvoidGrenade 0;
   }
   else if ((
pent->v.flags FL_ONGROUND) || (pent->v.effects EF_NODRAW))
   {
      
pBot->pAvoidGrenade NULL;
      
pBot->cAvoidGrenade 0;
   }
   if (
FNullEnt (pSmoke)) // KWo - 26.03.2007
   
{
      
pSmoke NULL;
      
pBot->pSmokeGrenade NULL;
   }
   else if (!(
pSmoke->v.flags FL_ONGROUND) || (pSmoke->v.effects EF_NODRAW))
   {
      
pSmoke NULL;
      
pBot->pSmokeGrenade NULL;
   }
   if (!
FNullEnt (pBot->pAvoidGrenade)) // KWo - 26.03.2007
   
{
      
Vector2D vec2DirToPoint;
      
Vector2D vec2RightSide;
      
// to start strafing, we have to first figure out if the target is on the left side or right side
      
MAKE_VECTORS (pEdict->v.angles);
      
vec2DirToPoint = (pEdict->v.origin pent->v.origin).Make2D ().Normalize ();
      
vec2RightSide gpGlobals->v_right.Make2D ().Normalize ();
      if (
DotProduct (vec2DirToPointvec2RightSide) > 0)
         
pBot->cAvoidGrenade = -1;
      else
         
pBot->cAvoidGrenade 1;
//      ALERT(at_logged, "[DEBUG] Bot %s needs to avoid grenade.\n", pBot->name);
   
}
   if (!
FNullEnt (pSmoke)) // KWo - 13.09.2008
   
{
      
// Check if in field of view of the Bot
      
iInField BotInFieldOfView (pBotpSmoke->v.origin vecView);
      if (
iInField < (pEdict->v.fov 1.0 5.0)) // more wide - even +/-85 degress in this case...
      
{
//         ALERT(at_logged, "[DEBUG] Bot %s checks a smoke grenade in his field of view.\n", pBot->name);
         
fDistance = (pSmoke->v.origin pEdict->v.origin).Length ();
         
// Shrink Bots Viewing Distance to Smoke Grens Distance
         
if (pBot->f_view_distance fDistance)
            
pBot->f_view_distance fDistance;
      } 
LukeyB is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-18-2011 , 05:31   Re: Anyone able to convert this to work with cz bots?
Reply With Quote #2

cz bots are already affected by smoke grenades
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
LukeyB
Member
Join Date: Dec 2011
Old 12-18-2011 , 05:53   Re: Anyone able to convert this to work with cz bots?
Reply With Quote #3

Yes, but not well at all. You can stand in the smoke and they will never see you so you can kill all of them. Any ideas to fix this? Maybe have them randomly shoot in the middle of the smoke? Would be amazing if that was possible.
LukeyB is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-18-2011 , 06:46   Re: Anyone able to convert this to work with cz bots?
Reply With Quote #4

So the code you asked to be converted wouldn't help in any way !!
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
LukeyB
Member
Join Date: Dec 2011
Old 12-18-2011 , 07:01   Re: Anyone able to convert this to work with cz bots?
Reply With Quote #5

I was hoping it would make a difference. Do you have any idea how to fix the current bot smoke code?
LukeyB is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-18-2011 , 07:07   Re: Anyone able to convert this to work with cz bots?
Reply With Quote #6

not at all
have you try high bot level ?
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-18-2011 at 07:08.
ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode