Raised This Month: $ Target: $400
 0% 

[DOD] Weaponmod ini


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
TheVaskov
Member
Join Date: Sep 2021
Location: Russia
Old 05-13-2024 , 14:56   [DOD] Weaponmod ini
Reply With Quote #1

Description

The plugin changes the behavior of standard weapons. Not significantly, but based on catching standard functions, you can try and write unique behavior.

Functional
say mm to open custom weaponmenu list



Technical part
I’ll tell you a special case of conversion for only one weapon, expanding this to several weapons is a matter of processing an array, which is solved in this plugin.
We take the weapon entity index from the player's inventory.
And we’ll assign this specific index to private so that this particular class object differs from others according to our rules
PHP Code:
idx_wpn get_pdata_cbase(id_ownerm_pActiveItemlinux_diff_player);
entity_set_int(idx_wpnEV_INT_iuser4custom_idx 
Now, when we catch the primary fire event, we will check for the presence of a special index on the class object, and if it is there, then this is a special weapon, to which we assign special behavior, assign a v_model and p_model, sounds and HUD.
If you throw a weapon out of your hands, then a special w_model will be assigned to it, and if someone picks up this weapon, then it is he who picks up the special weapon.

ini-file
PHP Code:
CODE weapon_reference weapon_newname f_damagemultipier f_fire1rate f_fire2rate f_reloadtime maxcxlip maxammo hud_clip hud_ammo soundfire1 soundfire2 v_model p_model w_model v_subnum p_submodelnum w_submodel num
1 weapon_colt 273 weapon_tt33 0.1 0.15 2.0 5.0 3 11 28 4 
"" "" "models/v_colt.mdl" "models/p_colt.mdl" "models/w_colt.mdl" 0 0 0 0 
Youtube demo video

Issue
1. At the moment a weapon is fired, a special sound is heard on the surface of a standard weapon, and sometimes with a delay.

2. To imitate a shotgun, we need to parse the decal index from one bullet, and after multiple tracing, assign them, this function has not yet been fully implemented
Attached Files
File Type: sma Get Plugin or Get Source (dod_weaponmod_ini.sma - 6 views - 37.0 KB)
File Type: ini w_weapons.ini (1.0 KB, 5 views)
__________________

Last edited by TheVaskov; 05-14-2024 at 04:00.
TheVaskov is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-13-2024 , 22:28   Re: [DOD] Weaponmod ini
Reply With Quote #2

Did you actually write this code? I'm starting to think you didn't and you are relying on terrible AI to create bad code. It looks like the entire post was written by AI. Don't use AI, it's terrible, especially at this (AMX Mod X plugins). You have a massive wall of text that is practically unreadable.
__________________

Last edited by fysiks; 05-13-2024 at 22:30.
fysiks is offline
TheVaskov
Member
Join Date: Sep 2021
Location: Russia
Old 05-14-2024 , 04:01   Re: [DOD] Weaponmod ini
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Did you actually write this code? I'm starting to think you didn't and you are relying on terrible AI to create bad code. It looks like the entire post was written by AI. Don't use AI, it's terrible, especially at this (AMX Mod X plugins). You have a massive wall of text that is practically unreadable.
Yes, I wrote this code myself, mostly. I took some short inserts from other weapon plugins
The description has been edited and will be improved and filled out later.
What specific complaints do you have about the functions and how can it be improved?
__________________

Last edited by TheVaskov; 05-14-2024 at 04:06.
TheVaskov is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-14-2024 , 21:16   Re: [DOD] Weaponmod ini
Reply With Quote #4

Well, the biggest thing that made me respond the way I did was that you duplicated, one for one, large parts of an include file that is literally already part of your code and there are an unreasonably large number of warnings. These both point to someone who appears to not really understand the code that they "wrote". I didn't notice the compiler warning until after seeing the duplication of pre-defined constants. I then went to the other plugin you submitted which I thoroughly reviewed and provided feedback and noticed even there you have warnings that can easily be resolved, not as many or as bad but it's more than it should be.

Fix the warnings (in both of your plugins) and remove code duplicated from include files. I have no idea why "ini" would be part of the file name or plugin name as it has nothing to do with the primary functionality of the plugin. Also, IMO, it doesn't make any sense to me to explain the code in the post, explain confusing/novel code in the code with comments.

Also, use the comments/suggestions from my post on your other plugin to improve this plugin, where applicable. After that, I will likely look through it a little more closely.
__________________
fysiks is offline
TheVaskov
Member
Join Date: Sep 2021
Location: Russia
Old 05-15-2024 , 08:38   Re: [DOD] Weaponmod ini
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
Well, the biggest thing that made me respond the way I did was that you duplicated, one for one, large parts of an include file that is literally already part of your code and there are an unreasonably large number of warnings. These both point to someone who appears to not really understand the code that they "wrote". I didn't notice the compiler warning until after seeing the duplication of pre-defined constants. I then went to the other plugin you submitted which I thoroughly reviewed and provided feedback and noticed even there you have warnings that can easily be resolved, not as many or as bad but it's more than it should be.

Fix the warnings (in both of your plugins) and remove code duplicated from include files. I have no idea why "ini" would be part of the file name or plugin name as it has nothing to do with the primary functionality of the plugin. Also, IMO, it doesn't make any sense to me to explain the code in the post, explain confusing/novel code in the code with comments.

Also, use the comments/suggestions from my post on your other plugin to improve this plugin, where applicable. After that, I will likely look through it a little more closely.
These warnings disappear when I edit the code using indentations and tabs, but then the code becomes unreadable for me and VScode stops importing the list of published methods. I would like to stick to Hungarian notation, but the main problem is my general level of programming. I'm still a newbie, however the plugin works in this state.

Today the main question for this plugin is whether I have chosen the best way to catch primary fire that would be as close as possible to such a plugin integration so that it would work well, and not like a shotgun or flamethrower plugin on well-known servers.
Because there the shotgun fires with a delay, and the flamethrower looks terribly unattractive and has nothing in common with the visual component of the standard package from Valvе.

In all other respects, it doesn’t matter to me what name the plugin will have later. the ini mark only means that I can dynamically change the parameters and list of additional weapons using a separate configuration file. I haven’t yet come up with a suitable name for the plugin, but this is not a hindrance to viewing and editing it.

For those interested, I can put together a set of sounds and models for full testing.
In my opinion, the initial description of the plugin in the post was comprehensive in order to become familiar with its architecture. I will try to make this plugin better
__________________
TheVaskov is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-15-2024 , 23:24   Re: [DOD] Weaponmod ini
Reply With Quote #6

The "New Plugin Submissions" subforum is not the place to ask for support for your plugin. This subforum is for releasing fully complete plugins.

I never said you had to abandon Hungarian notation. I assume this comment about notation is because I mentioned in another thread that you should properly name your global variables to indicate scope. It is very common around here to use Hungarian notation with the modifier that global variables get an extra prefix to denote globalness. When in Rome . . . as they say.

Doing bad indentation shouldn't make VS Code work better. If that's the case, you need to fix whatever extension you're using in VS Code. No idea who it's possible for the code to become unreadable may making it more readable (indentation is specifically for readability).
__________________

Last edited by fysiks; 05-15-2024 at 23:25.
fysiks 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 02:34.


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