AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D & L4D2] Scope Level Adjust v2.4 [12-April-2023] (https://forums.alliedmods.net/showthread.php?t=341112)

NoroHime 01-01-2023 07:13

[L4D & L4D2] Scope Level Adjust v2.4 [12-April-2023]
 
17 Attachment(s)
about
  • using forward key and back key to adjust scope level or config yourself
  • can loop level between min and max
  • can hold key to adjust or adjust if not holding key
  • option to allow which non-scopable weapon using scope, with zoom animation
  • tested on l4d1 and l4d2
  • experimental: use mouse wheels to adjust scope level without binding keys


ConVar

PHP Code:


// max fov zoom level, greater mean see nearer
// higher than 90 will cause 'ultra wide angle' and view can throuth the wall
scope_level_max "89"

// min fov zoom level, less mean see farer, dont suggest less than 1
scope_level_min "1"

// zoom animating step, 5=linear fov but weird animating
// -20=calc to linear scope level by 20%
scope_level_step "-33"

// key to decrease level 16=Back(s), 0=disabled
scope_level_dec "16"

// key to increase level 8=Forward(w) 0=disabled 32=Use(e)
scope_level_inc "8"

// hold key to adjust level, negative is reverse logic
// 131072=most hold shift -131072=if not hold shift key
// see more key on /include/entity_prop_stocks.inc
scope_level_hold "0"

// when zoom level reached bound value, reset level to cause loop
scope_level_loop "0"

// key to cancel zoom level 2048=shove 8192=reload 1=attack 2=jump
scope_level_cancel "10242"

// does enable fake scope on all non-scopable weapon 0=disabled 40=enabled with 40 initial fov
scope_level_fake "40"

// weapon list of fake scope feature, separate by comma, no spaces
scope_level_fake_list "weapon_rifle,weapon_rifle_m60,weapon_rifle_ak47,weapon_smg,weapon_smg_silenced,weapon_smg_mp5"

// add extra zoom sound when open zoom, to fix vanilla game only play on cancel zoom
scope_level_sound "1"

// announce types 0=dont announce 1=center 2=chat 4=hint. add numbers together you want
scope_level_announce "2"

// expermental feature, speculate mouse wheels to adjust scope level,
// prevent weapon switch, 1=enabled if speculation failed increase level
// 2=same as 1 but decrease 0=disabled
scope_level_wheels "1" 

changelog
  • v1.0 just releases; 1-January-2023
  • v1.1 new features and fix:
    - new ConVar *_hold to control which key hold to adjust scope level or vice versa,
    - new ConVar *_inc, *_dec to specify which key to adjust, defaults is forward and back,
    - new ConVar *_loop to allow loop zoom level when reached bound level, usually combined use when set *_inc only or *_dec only,
    - fix sg552 wrong scope level,
    - to cancel zoom dont have to tap zoom key twice anymore; 7-January-2023
  • v2.0 new features and fixes:
    - add ConVar *_cancel to fix scope level wont cancel when reload/shove/jump, this option can use for support '[L4D & L4D2] Unscope Sniper On Shoot' if add 1=attack,
    - new ConVar *_fake to allow non-scopable weapon using scope with animation,
    - new ConVar *_fake_list to control which weapon allow access *_fake feature,
    - new ConVar *_sound to add extra zoom sound when open scope, to fix vanilla game only play on cancel zoom; 13-January-2023
  • v2.1 new feature and fix:
    - support scope adjust hint on pickup available weapon and translation,
    - new ConVar *_announce to control pickup hint text position,
    - optimize fake scope logic to fix sometime work unexpected,
    - version tested on l4d1 and l4d2; 21-January-2023
  • v2.1.1 fixes:
    - fix fake scope features not cancel properly by player being attacked,
    - fix *_cancel not included game default behavior keys cause issue; 21-January-2023
  • v2.2 new features:
    - new experimental feature use mouse wheels to adjust level, but these speculation
    - new ConVar *_wheels to enabled mouse wheels features, 1=increase when failed speculation, 2=decrease,
    - fix pick hint message sometime not happen; 22-January-2023
  • v2.3 new feature:
    - add negative value range for *_step, if set -20 will calc FOV as linear scope level automatically by 20%; 27-January-2023
  • v2.3.1 for fake scope feature: cancel scope when auto-reload or be hurt, to make close to vanilla sniper behavior; 8-February-2023
  • v2.4 new command sm_zoomout to allow user run key binding script (see thread) to using modern game feature: hold to open scope and release to cancel the scope on available weapons; 12-April-2023

.cfg scripts make scoping like modern game
PHP Code:

// right click: hold to zoom, wheel key is 'mouse3'
bind mouse2 "+zooms";
alias +zooms "+zoom";
alias -zooms "-zoom;sm_zoomout";
// v key: shove, not requirement
bind v +attack2

todo
  • i try make non-scopable weapons view model appear on screen if these can be


Installation
  • put l4d_scope_level.smx on /plugins/
  • put l4d_scope_level.phrases.txt on /translations/

replay_84 01-01-2023 14:46

Re: [L4D & L4D2] Scope Level Adjust [1-January-2023]
 
Sounds cool. Thanks for sharing.

SDArt 01-05-2023 15:43

Re: [L4D & L4D2] Scope Level Adjust [1-January-2023]
 
Tested on l4d2 sg552 zoom is locked and doesn't allow me to walk without zooming also here is an idea since you binded keys to zoom in/out properly the plugin could be modified resemble the CSS/1.6 zoom e.g: Binding 'e' key to adjust scope level twice after zoom.
I think people will find it amusing & great job as always.

replay_84 01-06-2023 04:14

Re: [L4D & L4D2] Scope Level Adjust [1-January-2023]
 
And what about a "hold to zoom" feature like in most other games. Scripts for this never seem to work well.

NoroHime 01-06-2023 19:07

Re: [L4D & L4D2] Scope Level Adjust [1-January-2023]
 
Quote:

Originally Posted by replay_84 (Post 2796624)
And what about a "hold to zoom" feature like in most other games. Scripts for this never seem to work well.

infact I wrote newer version, that hold extra key to adjust, or adjust when not holding, but i want listen more idea to know people real needed,
and another mode that use one key only, when adjust to border value then reset scope level, how these sounds?

replay_84 01-06-2023 20:10

Re: [L4D & L4D2] Scope Level Adjust [1-January-2023]
 
Quote:

Originally Posted by NoroHime (Post 2796662)
infact I wrote newer version, that hold extra key to adjust, or adjust when not holding, but i want listen more idea to know people real needed,
and another mode that use one key only, when adjust to border value then reset scope level, how these sounds?

Ah sorry, I did not mean to change zoom while holding , but to actually go to zoom while holding e.g mouse2.

What I had to address when using your plugin is that I can't go out of the zoom mode anymore when using melee attack. But on the other hand, I probably never had to get used to this behaviour when a hold to aim/zoom would exsist in L4D. (as it would just zoom out again when releasing mouse2)

NoroHime 01-06-2023 21:19

Re: [L4D & L4D2] Scope Level Adjust [1-January-2023]
 
Quote:

Originally Posted by replay_84 (Post 2796664)
Ah sorry, I did not mean to change zoom while holding , but to actually go to zoom while holding e.g mouse2.

What I had to address when using your plugin is that I can't go out of the zoom mode anymore when using melee attack. But on the other hand, I probably never had to get used to this behaviour when a hold to aim/zoom would exsist in L4D. (as it would just zoom out again when releasing mouse2)

infact i dont really understand your mean, anyway i updated it more optional, hope that help for you
Quote:

ConVar

PHP Code:

// key to decrease level 16=Back(s), 0=disabled
scope_level_dec "16"

// key to increase level 8=Forward(w) 0=disabled 32=Use(e)
scope_level_inc "8"

// hold key to make adjust level available, negative is reverse logic
// 131072=most hold shift -131072=if not hold shift key
//  see more key on /include/entity_prop_stocks.inc
scope_level_hold "131072"

// when zoom level reached bound value, reset level to cause loop
scope_level_loop "1" 

changelog
  • v1.1 new features and fix:
    - new ConVar *_hold to control which key hold to adjust scope level or vice versa,
    - new ConVar *_inc, *_dec to specify which key to adjust, defaults is forward and back,
    - new ConVar *_loop to allow loop zoom level when reached bound level, usually combined use when set *_inc only or *_dec only,
    - fix sg552 wrong scope level,
    - to cancel zoom dont have to tap zoom key twice anymore; 7-January-2023


replay_84 01-07-2023 04:25

Re: [L4D & L4D2] Scope Level Adjust [1-January-2023]
 
Quote:

Originally Posted by NoroHime (Post 2796665)
infact i dont really understand your mean, anyway i updated it more optional, hope that help for you

I'm talking about holding vs. clicking feature. https://www.youtube.com/watch?v=s3AaQzBqd1M

All modern games support that for a while. But it's a missing game feature and probably a bit unreleated to your plugin. I was just curious if it's possible to do with plugins (as you already added features I didn't see before anyway)

swiftswing1 01-09-2023 18:04

Re: [L4D & L4D2] Scope Level Adjust v1.1 [7-January-2023]
 
i guess i have a similar issue to the person above - is there a way to exit zoom when reloading?

by default, if in zoom with sniper or sg552 and you input reload (or melee-mouse2), it exits the scope and goes back to first person pov. however, when using this mod and in custom/adjusted zoom view, when you reload/melee, you still retain scope view instead of exiting it like normal. is there a way to go back to first person?

other than that, really really great plugin! very nice! :D

EDIT: personally would be nice to include chat hints?

NoroHime 01-11-2023 03:57

Re: [L4D & L4D2] Scope Level Adjust [1-January-2023]
 
Quote:

Originally Posted by replay_84 (Post 2796675)
I'm talking about holding vs. clicking feature. https://www.youtube.com/watch?v=s3AaQzBqd1M

All modern games support that for a while. But it's a missing game feature and probably a bit unreleated to your plugin. I was just curious if it's possible to do with plugins (as you already added features I didn't see before anyway)

i was think similar idea past time, here must few point to known:
1)we shouldnt change right click bahavior to another that will prevent player shove, so might requires player bind other keys
2)you might meaning ADS experience, actually it better using a model to instead script, but we just have very few mods, i only found two "awp,magnum" ADS model
3)to handles the custom view model on L4D2 using plugin i think very hard, the solution i can think is register sm command, it only scope, not any model change like AIMING on screen center


All times are GMT -4. The time now is 11:58.

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