View Single Post
SVC
Junior Member
Join Date: Mar 2021
Old 04-04-2023 , 23:13   Re: [TUT] Properly Detect Weapon Shot (Every Shot)
Reply With Quote #8

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
@SVC, thanks for dedicating your time.
No problem, I like help when i can.
Also, can you tell me what is offset 220? I dont remember in this moment.
On the other hand:

Quote:
Originally Posted by WATCH_D0GS UNITED View Post
...we want to accurately detect the weapon shot moment.

The less time the functions are active, the less CPU/RAM usage and the higher the fps rate.
Completely agree with you, always trying to keep the less CPU usage rather than RAM. But there are some things I can see using this way:

1) I can't test rigth now (maybe tomorrow, i hope), but reading a bit, can see that not only from weapons shots is called TraceLine but from other places/conditions.

2) In the above example (as you see, and other places), TraceLine will be called continually on each StatusBar update, and this is only for 1 player. Now imagine a 25+ players scenario ----> you will make an extra lot of checks unnecessary.

3) Honestly speaking of CPU usage, this din't use a 10~20% of all CPU using by engine-routine in just 1 frame. Of course, everyone programs like want.

4) I supposed the only thing that makes the "filter" to detect the shoot is the "220 offets" check (of course, with weaponid, but is not as many important than the first).

There is one bad thing, I forget to made in my code and it wast a pistol-check (since like how is coded, I'm almost sure if you keep +attack press with pistol it will do a fake shoot-detect).

Last edited by SVC; 04-04-2023 at 23:17.
SVC is offline