Raised This Month: $32 Target: $400
 8% 

[HowTo] Detect fired particle creation/type/number/attack/obstacle/vector


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
VEN
Veteran Member
Join Date: Jan 2005
Old 01-03-2007 , 00:54   [HowTo] Detect fired particle creation/type/number/attack/obstacle/vector
Reply With Quote #1

[Note: i recommend to use this method only for tests/research purpose because this method may produce some false positives when there are a big amount of lags.]

Most of a "shot/bullet/shell/fire/trace/particle/projectile/etc" plugin authors instead of fired particle trace vector is use player's aim vector. FYI: the angle difference between such vectors may reach even more than 30 degrees [!] because of the fired particle spreading/gun recoil. The correct method would be to perform a TraceLine hook, filter out fired particle trace and retrieve it's vector.

You have to note that some guns:
  • are powerful and it's bullet may sequentialy create 2nd and even 3nd trace for 1st and 2nd collision with the world/brush/entity/player obstacle
  • support burst-fire mode, so every attack action is performed a multiple shots with a little shots delay, every shot is spread a single bullet
  • support shotgun spread fire, so every attack action is performed a single shot that is spread a multiple particles
Let's review the script that will show how to:
  • filter out fired particle trace
  • distinguish a fired particle type: bullet or shotgun shot particle
  • calculate the current shotgun shot particle number for the current shot
  • detect whether the fired particle is hit a world/brush or entity/player
  • get the current actual vector of the fired particle
Attached Files
File Type: sma Get Plugin or Get Source (fired_particle_details.sma - 1749 views - 6.9 KB)

Last edited by VEN; 04-12-2007 at 15:05.
VEN is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 07-17-2008 , 07:58   Re: [HowTo] Detect fired particle creation/type/number/attack/obstacle/vector
Reply With Quote #2

Great tutorial!
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
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 01:24.


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