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

[L4D/L4D2] Pistol Reloading


Post New Thread Reply   
 
Thread Tools Display Modes
Arthedains
Junior Member
Join Date: Nov 2016
Location: Europe
Old 12-09-2016 , 07:02   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #11

Thank you, MasterMind.
That's great news. Gotta say, I'm very curious about the cvars and can't wait to test them this evening.

Test report is coming soon.
Arthedains is offline
Arthedains
Junior Member
Join Date: Nov 2016
Location: Europe
Old 12-09-2016 , 18:32   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #12

Ok, I've tested this plugin for a bit on my l4d1 server. Could not test it on a l4d2 yet, so others might have other experiences with it.

+ 1 bullet ammo lock can be disabled via cvar
+ pistol ammo reserve can be changed via cvar
- Getting ammo from ammo piles for the pistol doesn't work anymore. It only works by picking up another pistol. I know that it used to work with the older plugin version. There even came a message that said "reloaded". I didn't like that message though so edited it out from your .sp file for my use.

Some ideas I have:
cvar to enable/disable the plugin itself
cvar to enable/disable the old reloaded message that showed up by picking up ammo on ammo piles

What is this cvar exactly for? Could this cvar somehow be related to my ammo problem?
l4d2_pistol_ammo_use_distance "96" // 96 - distance at which you want to use ammo piles

Last edited by Arthedains; 12-09-2016 at 18:41.
Arthedains is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 12-09-2016 , 18:55   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #13

Quote:
Originally Posted by Arthedains View Post
Ok, I've tested this plugin for a bit on my l4d1 server. Could not test it on a l4d2 yet, so others might have other experiences with it.

+ 1 bullet ammo lock can be disabled via cvar
+ pistol ammo reserve can be changed via cvar
- Getting ammo from ammo piles for the pistol doesn't work anymore. It only works by picking up another pistol. I know that it used to work with the older plugin version. There even came a message that said "reloaded". I didn't like that message though so edited it out from your .sp file for my use.

Some ideas I have:
cvar to enable/disable the plugin itself
cvar to enable/disable the old reloaded message that showed up by picking up ammo on ammo piles

What is this cvar exactly for? Could this cvar somehow be related to my ammo problem?
l4d2_pistol_ammo_use_distance "96" // 96 - distance at which you want to use ammo piles
Thanks for the report, i've decided to continue supporting this plugin separately from the other plugin I made. I will add your suggestions which is something I already did in my other plugin.
l4d2_pistol_ammo_use_distance "96" This is used to change the distance at which you can pickup ammo, picking up ammo for pistols doesn't use ammo_pickup event so I had to add this or else you could pickup ammo from anywhere as long as you just aimed at the ammo pile. You can modify the distance, 96 is default for ammo_pickup and item_pickup distances. Or set it higher so you can reload pistols from further away...
MasterMind420 is offline
Arthedains
Junior Member
Join Date: Nov 2016
Location: Europe
Old 12-10-2016 , 21:30   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #14

Quote:
picking up ammo for pistols doesn't use ammo_pickup event so I had to add this or else you could pickup ammo from anywhere as long as you just aimed at the ammo pile. You can modify the distance, 96 is default for ammo_pickup and item_pickup distances. Or set it higher so you can reload pistols from further away...
Ah, that makes sense. Is it possible to use the older ammo pick up code again to fix it? Because no matter what distance I set, it doesn't work. :0 Don't know if it's working for l4d2. Or do you have something else in mind?

I tested it further and have another suggestion. When I had used all my pistol ammo, it switched my weapon automatically to the other weapon. Would be cool if this could be disabled. But maybe you can't. Because if you burn through all your ammo of your primary weapon in vanilla l4d, it switches automatically to the pistols, too. Could be hard-coded, very hard to do or more belong to the plugin request thread though.

Last edited by Arthedains; 12-10-2016 at 23:22.
Arthedains is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 12-11-2016 , 09:41   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #15

Quote:
Originally Posted by Arthedains View Post
Ah, that makes sense. Is it possible to use the older ammo pick up code again to fix it? Because no matter what distance I set, it doesn't work. :0 Don't know if it's working for l4d2. Or do you have something else in mind?

I tested it further and have another suggestion. When I had used all my pistol ammo, it switched my weapon automatically to the other weapon. Would be cool if this could be disabled. But maybe you can't. Because if you burn through all your ammo of your primary weapon in vanilla l4d, it switches automatically to the pistols, too. Could be hard-coded, very hard to do or more belong to the plugin request thread though.
Ya it definitely works in L4D2 last time I tested it, i'm gonna make a version just for you to test to see whats going on. I'll seperate the code for L4D1/L4D2 and remove the distance checking for L4D1 just to see if thats causing your reload problem.
MasterMind420 is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 12-13-2016 , 16:17   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #16

Alright i've decided to release what I have thus far for bug checking sake, it should be bug free but I can't test every possible scenario.

Added no reloading on max ammo.
Added a better method of identifying ammo piles.
Added convar l4d_pistol_reload_notify to enable/disable reload message(hint/chat).
Added convar l4d_pistol_empty_notify to enable/disable empty message(hint/chat).
Added convar l4d_pistol_reset_clip to force reload the pistol when ammo is picked up.
Added ammo locked at 1 will now reset the clip to 0 to give default ammo reloading effect.

As always delete your cfg in order for the new convars to take effect. Let me know if there are any issues with this release.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_pistol_reloading.sp - 473 views - 14.6 KB)
MasterMind420 is offline
Arthedains
Junior Member
Join Date: Nov 2016
Location: Europe
Old 12-16-2016 , 21:13   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #17

Thank you. I will check it out and report, of course.

//edit

Ok, I tested this plugin on L4D1. First of, thank you for your work!

Picking up ammo is working fine now. Also, I can disable messages without any problem, which is very nice. Unforcing automatic reloading seems to have no effect, but I guess most people won't ever use that since only pistols would be affected. It's a nice idea though.

I would say it's good enough now. You surely have other projects you want to work on than L4D1 you don't even seem to play lol. You made a great addition to a good game, thank you.
I'm fairly new here. Can I +rep you or something or like that?

Last edited by Arthedains; 12-16-2016 at 22:51. Reason: edit after testing
Arthedains is offline
ngcaobinh92
New Member
Join Date: Dec 2016
Old 12-30-2016 , 15:26   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #18

Can you fix this bug?
https://youtu.be/8wAsQThp3Rs
ngcaobinh92 is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 01-06-2017 , 22:51   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #19

Quote:
Originally Posted by ngcaobinh92 View Post
Can you fix this bug?
https://youtu.be/8wAsQThp3Rs
I'm not exactly sure what bug your referring to. The ammo locking at 1? Or switching to another single pistol with ammo and the other without? You need to explain in detail whats happening...
MasterMind420 is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 05-21-2017 , 10:35   Re: [L4D/L4D2] Pistol Reloading
Reply With Quote #20

---VERSION 1.3---
Converted to new syntax
MasterMind420 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 19:56.


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