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

COD: HitMarkers v1.7 [Updated April 29th 2021]


Post New Thread Reply   
 
Thread Tools Display Modes
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 01-31-2020 , 13:48   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #51

Quote:
Originally Posted by Napoleon_be View Post
2) Can u explain again what you're trying to do with read_flags() right there? I don't really get it
Quote:
Originally Posted by amxmodx.inc
Converts string to sum of bits.
* Example: "abcd" is a sum of 1, 2, 4 and 8. */
native read_flags(const flags[]);
https://www.amxmodx.org/api/amxmodx/read_flags
You simply use a string cvar again and use this native to convert the letters it contains into a bitsum.
Basically you replace your hardcoded gWeaponList with a cvar.

Quote:
Originally Posted by Napoleon_be View Post
3) I don't really mind a HE grenade showing a hitmarker as it is also damage done to the victim
You don't understand. Any damage done with a delay(in this example by a thrown grenade entity) will still return the weapon the player is currently holding when triggered.
Example: you throw the grenade entity, switch back to m4a1, the grenade explodes while you are holding the m4a1 so you will have an erroneous claim that the damage has been done with the m4a1.

Quote:
Originally Posted by Napoleon_be View Post
4) Won't be using that style, people consider using 255 0 0 to get the red color, the way you're doing it it will always choose a random number if one of the cvars is 0, which is not what we want.
Wrong. Ranges 0 -> 255 will use that specific color amount.
Ranges -256 -> -1 will random a number between 0 to 255.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-31-2020 , 14:07   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #52

Any Image?
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 01-31-2020 , 17:45   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #53

Screen:

https://imgur.com/a/U7PvroV

Last edited by iclassdon; 01-31-2020 at 17:47.
iclassdon is offline
Send a message via MSN to iclassdon
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-09-2020 , 12:52   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #54

Quote:
1) Should the check that georgik57 gave me get added?
It's your plugin, you should decide if it should be added or not. Try to reason about things, don't just take someone else's word about it. Everything in programming should make sense, if it doesn't then it's time to ask yourself some questions(and others if you can't figure it out).

Here the question is really simple: should you show the hitmaker if no damage is done? The hit still occurred, it just did 0 damage. So what is the hit marker really tracking? Hits or damage? That's up to you to decide.

Quote:
2) I've been suggested to change the hitmarker to be red when the victim is killed. Allthough, if i add this, a lot of cvars should be added too. (Honestly i think that would be too much for a simple plugin like this, but the modifications will be endless imo.)

Cvars that should get added when i do this:
amx_hmdead "1" - Will set the red hitmarker enabled/disabled.
amx_hmdeadrcolor "255" // Sets the red RGB code for the dead hitmarker.
amx_hmdeadgcolor "0" // Sets the green RGB code for the dead hitmarker.
amx_hmdeadbcolor "0" // Sets the blue RGB code for the dead hitmarker.
There is nothing wrong in adding more features, as long as they make sense. There's also no reason to be worried about a rich configuration(e.g many cvars). They just give more power to the user without any downside.
I'm also not against refactoring cvars, but you need to think if it will make the plugin easier to use/harder. Because if the price you have to pay to get less cvars is to make the plugin harder to configure then it's pointless.

Quote:
PS: You should also cache the string cvars in this case(either per round or once every X seconds), as TakeDamage can be spammed very much.
I disagree, TakeDamage is not called nearly enough to justify caching cvars.

Quote:
2) Can u explain again what you're trying to do with read_flags() right there? I don't really get it
He's trying to create a cvar to decide which weapon will show a hit marker and he's using letters for it. You could use the weapon name instead of letters, like "scout awp ...". Basically this will replace amx_hmsnipers and extend it to every weapon(right now it's either all weapon or snipers, you can't choose for each individual weapon if it will show the hitmarker or not).

He also has a valid point about hegrenades. If amx_hmsnipers is 1 and you do damage with a hegrenade and switch to a sniper before the grenade explodes it will show a hitmarker, even if the damage is done with a hegrenade, not an awp.
__________________

Last edited by HamletEagle; 02-09-2020 at 12:55.
HamletEagle is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-10-2020 , 07:08   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #55

Quote:
Originally Posted by HamletEagle View Post
I disagree, TakeDamage is not called nearly enough to justify caching cvars.
Any mod which gives a lot of health to players will trigger it a lot(for example zombie mods).
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-10-2020 , 12:17   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #56

Quote:
Originally Posted by georgik57 View Post
Any mod which gives a lot of health to players will trigger it a lot(for example zombie mods).
That's still not a lot.

get_pcvar_num is not an expensive operation: it's an O(1) time complexity operation(this is why we use pcvars over cvars, we don't need to iterate over the entire cvar list because we have a pointer and we can simply access the value that the pointer points to).
Reading the data from the variable that caches the cvar is also O(1) so if you are not trying to optimize that why are you trying to optimize something that's equivalent?

Truth be told, that's half the story. Since get_pcvar_num is a native there's also some time spent in communicating between pawn and c++, BUT it's nothing to worry about in the context of a TakeDamage call. You could argue about caching O(1) natives if your forward was called per frame, but TakeDamage is not and the fact that it may be fired for a few seconds on 16 zombies is literally nothing.

I don't know why people insist on doing worthless "optimizations" that will not provide any speed gain, require more coding time and hurt the user experience. Think about your algorithms and how the plugin is operating as a whole, not small insignificant things. A bad algorithm is a bad algorithm no matter how many cvars you cache, how many times you use static over new or how many bitsums are used over boolean arrays. On the other hand, a good algorithm remains good even if it doesn't cache cvars.
__________________

Last edited by HamletEagle; 02-10-2020 at 12:21.
HamletEagle is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 02-10-2020 , 16:32   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #57

I was referring to get_pcvar_string and read_flags thought.
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-11-2020 , 09:46   Re: COD: HitMarkers [Last Update: 24/01/2020]
Reply With Quote #58

Taking my time to think before i take actions, i'll keep you notified if updates are about to happen.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-07-2020 , 14:40   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #59

Code has been updated. Added new functionality to the plugin.

Update notes:
Code:
  • 1.6: Added new functionality to the plugin + cvars. Hitmarker can now show specific color upon death.
    • amx_hmdead "1" - Shows a specified color by using following cvars
      • amx_hmdeadrcolor "255" - RGB Dead - Red
      • amx_hmdeadgcolor "0" - RGB Dead - Green
      • amx_hmdeadbcolor "0" - RGB Dead - Blue
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Midnight Kid
Member
Join Date: Aug 2017
Location: Chornobay, Ukraine
Old 04-08-2020 , 01:51   Re: COD: HitMarkers v1.6 [Updated 07/04/2020]
Reply With Quote #60

Hurrah. I've taking.

Last edited by Midnight Kid; 04-08-2020 at 04:04.
Midnight Kid 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 21:50.


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