Raised This Month: $7 Target: $400
 1% 

IsShootableThruObstacle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 03-25-2007 , 17:32   IsShootableThruObstacle
Reply With Quote #1

What is the easiest way to check if the weapon I have is able to shoot at something throught some obstacle (some wall or some doors)? I mean if I can make some damage of the enemy which is behind some obstacle like a wall of a door.
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.
KWo is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-26-2007 , 02:41   Re: IsShootableThruObstacle
Reply With Quote #2

I do not think you can know whether it shootable or not unless you hack game dll attack tracing.
VEN is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 03-26-2007 , 04:40   Re: IsShootableThruObstacle
Reply With Quote #3

Isn't there a way to know the thickness of the obstacle - which should affect shootable thing the most?
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.
KWo is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-26-2007 , 04:58   Re: IsShootableThruObstacle
Reply With Quote #4

Would you know "max. value of thickness" of obstacle when it's still possible to shoot though it for every weapon?

Furthermore thickness isn't the only aspect that is used to determine that. It's also depends on:
  • obstacle material
  • whether silencer is used or not
  • angle of bullet vector
  • whether it's a first obstacle or not
  • etc etc etc
Now question: would you be able to create accurate formula to handle all possible aspects?

Last edited by VEN; 03-26-2007 at 05:11.
VEN is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 03-26-2007 , 10:01   Re: IsShootableThruObstacle
Reply With Quote #5

I just want to replace this function in podbot mm by something simpler and written more optimized:
Code:
bool IsShootableThruObstacle (edict_t *pEdict, Vector vecDest)
{
   // Returns if enemy can be shoot through some obstacle
   // TODO: After seeing the disassembled CS Routine it could be speedup and simplified a lot

   Vector vecSrc = GetGunPosition (pEdict);
   Vector vecDir = (vecDest - vecSrc).Normalize (); // 1 unit long
   Vector vecPoint;
   int iThickness = 0;
   int iHits = 0;

   edict_t *pentIgnore = pEdict;
   TraceResult tr;

   UTIL_TraceLine (vecSrc, vecDest, ignore_monsters, ignore_glass, pentIgnore, &tr);

   while ((tr.flFraction != 1.0) && (iHits < 3))
   {
      iHits++;
      iThickness++;
      vecPoint = tr.vecEndPos + vecDir;

      while ((POINT_CONTENTS (vecPoint) == CONTENTS_SOLID) && (iThickness < 98)) // KWo - 23.10.2006
      {
         vecPoint = vecPoint + vecDir;
         iThickness++;
      }

      UTIL_TraceLine (vecPoint, vecDest, ignore_monsters, ignore_glass, pentIgnore, &tr);
   }

   if ((iHits < 3) && (iThickness < 98)) // KWo - 23.10.2006
   {
      float f_distance = (vecDest - vecPoint).Length ();

      if (f_distance < 121.95) // KWo - 23.10.2006
         return (TRUE);
   }

   return (FALSE);
}
That "// TODO" comment it's original Count Floyd's comment, but I have no idea what he was thinking about, that's why I'm asking here the people they have better HL knowledge than me.
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.
KWo is offline
Reply


Thread Tools
Display Modes

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 03:37.


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