Left 4 Dead 2

Left 4 Dead 2

评价数不足
Hold Right Mouse Button for Crosshair (plus Circle, Overlay, Recoil)
由 Rico Heart 制作
Simulate aiming down sights:
- run around with the crosshair hidden, immerse yourself in the environment
- hold down the right mouse button to see the crosshair, release to hide
- customize your crosshair (color, outline, transparency, thickness, accuracy feedback + circle)

Extras:
- overlay (alternative to or complementing the crosshair)
- recoil
   
奖励
收藏
已收藏
取消收藏
Setup (autoexec.cfg)
0.
If you don't yet have a Steam\steamapps\common\Left 4 Dead 2\left4dead2\cfg\autoexec.cfg, create it as a text document.

1.
The right mouse button is used for shove by default.

In the game options set "Push away enemies" to some other key, I recommend a side mouse button.

Same effect if you put this into autoexec.cfg for the Back button (for most mice):
bind MOUSE5 +attack2

2.
We give the right mouse button two new jobs:
- make the crosshair appear and disappear
- walk

Paste this into your autoexec.cfg:
alias +aim "crosshair 1; +speed" alias -aim "crosshair 0; -speed" bind MOUSE2 +aim

If you want to be able to aim while running, use this:
alias +aim "crosshair 1" alias -aim "crosshair 0" bind MOUSE2 +aim

3.
Hide the crosshair and only use it only when necessary:
crosshair 0

4.
We may want to toggle the crosshair sometimes (here with the Z key):
bindtoggle z crosshair
Customization
Here are some things to play around with and set up to your liking in \cfg\autoexec.cfg:

Crosshair Color

I prefer a white crosshair with black outline:
cl_colorblind 1

Colored crosshairs can't have an outline.
These are the default values, 0 is no color, 255 is max color. (0 0 0 is black, 255 255 255 is white, you already know this probably.)
cl_crosshair_blue 220 cl_crosshair_green 182 cl_crosshair_red 138

Crosshair Transparency
By default transparency is zero, opacity is maximum, set by "cl_crosshair_alpha 255".

With this line in your autoexec you can quickly jump between 5 levels of transparency while playing:
bind v "incrementvar cl_crosshair_alpha 0 255 63"

These alpha values do not affect cl_crosshair_circle, about which I will write below in a separate section.

Crosshair Thiccness :)
1-5, default is 2, I like 1.

With this line in your autoexec you can quickly jump between the thickness levels while playing:
bind b "incrementvar cl_crosshair_thickness 0 5 1"

Dynamic Crosshair

By default the crosshair is dynamic, giving accuracy feedback.

We can have a hotkey to toggle this while playing:
bindtoggle n cl_crosshair_dynamic
Crosshair Circle
Explanation

The circle is a debug tool, it helped development. But IMO the crosshair looks better with circle_mode 2 when it's dynamic as the circle reinforces the accuracy feedback.

The following settings are not cheats but hidden, so we will need to be crafty to apply them for all game modes.

Starting a map from the console, setting sv_cheats 1 allows us to change these variables via console:
cl_crosshair_circle_mode 0 cl_crosshair_circle_alpha 0

Where mode can be 0, 1 or 2, alpha 0-255.
Mode 0 already shows a circle if alpha is not zero.

Official descriptions:
mode 0 = actual aim error + pellet scatter
mode 1 = green is aim error, red is pellet scatter
mode 2 = inside of crosshair lines

Problem

When the accuracy is very high, the circle doesn't turn into a dot but disappears.

For mode 2:
- crouching hides the circle for pistols, AK, M60
- hidden even while standing still for all other rifles and the grenade launcher
- never hidden for shotguns or SMGs

Mode 0 and 1 circles are larger:
- circle is hidden while standing: all sniper rifles except the military sniper
- circle is hidden only when crouching: AK, M60, desert rifle, grenade launcher
- never hidden for pistols, shotguns, SMGs, AK, desert rifle M60

Shooting or moving reveals the circle for even the most accurate gun.

Setting up

But how to have the circle for single player campaigns and even multiplayer?

A) single player / local server only

If we use a mod from the Workshop that has a "convars.txt" file inside \Steam\steamapps\common\Left 4 Dead 2\left4dead2\ems\<modname>\cfg\, we can put the code in there, and it will work in SP campaigns BUT not in multiplayer.
(For example Left 4 Bots 2 or Admin System has a convars.txt.)

B) for all game modes

To have the circle in all game modes we can use a mod by RF aka Recycle_Bin called tracerfix_linux.vpk.

Steps:

1.
Download RF's mod from here: https://www.gamemaps.com/details/30880

2.
Download VPKEdit from https://github.com/craftablescience/VPKEdit/releases
(info here: https://developer.valvesoftware.com/wiki/VPKEdit)

3.
- Open tracerfix_linux.vpk with VPKEdit (just double click).
- Go to \modes\gunbrain.txt
- Find the "convar" section and edit it like this:
"convar" { cl_crosshair_circle_mode 2 cl_crosshair_circle_alpha 128 cl_tracers 0 mp_gamemode gunbrain2 }
- - Use your preference for alpha.
- - You may delete the cl_tracers 0 line to keep seeing tracers (I prefer not to).
- File > Save

4.
Put the new tracerfix_linux.vpk into the \Steam\steamapps\common\Left 4 Dead 2\left4dead2\addons folder.

5.
Add to the bottom of your autoexec.cfg:
map credits gunbrain
(Or add '+map credits +mp_gamemode gunbrain' to launch options.)

6.
The mod will appear in the ADD-ONS menu as Fire Bullets Fix, enable it, then exit and start the game again.

DONE.

Don't be surprised, the game will automatically load credits and return to Main Menu.

Possible issue: Workshop weapon script mods might only work if moved into addons folder.

Circle without Crosshair

Maybe you use a custom dot from some other source, maybe you don't mind the circle disappearing when accuracy is very high.

If you want to try circle only, you can hide the crosshair this way:
cl_crosshair_alpha 0
Or just press the V key a few times if you've used my Crosshair Transparency code above.

- - -
My source for all this: https://psteamcommunity.yuanyoumao.com/app/550/discussions/0/598533015389342238/
Extra: ReShade Layer
Use any .png file (with transparency) as an overlay:

1.
Create a PNG file with a transparent background, same pixel width and hight as your game.
Here's a few I've made with GIMP:


2.
Download ReShade from https://reshade.me/#download

3.
Install ReShade for \Steam\steamapps\common\Left 4 Dead 2\left4dead2.exe, make sure to include Layer.fx.


4.
ReShade will create a \reshade-shaders\Textures\SweetFX folder within \Steam\steamapps\common\Left 4 Dead 2\.

Put your PNG file there.


5.
Start the game, hit the HOME key, do or skip the ReShade tutorial, tick Layer and on the bottom section type in your PNG's filename into the LAYER_SOURCE field.

Play around with Layer Scale (size) and Layer Blend (transparency).



Hotkey

By right clicking (use F9) the Layer.fx item on the upper section of ReShade it's possible to set a hotkey to activate/inactivate an effect. You can see on the screenshot that my hotkey is 9.

This does not accept a mouse button, and can't be combined with AutoHotKey sending a key when the right mouse button is held down because the ReShade UI listening for a keyboard press does not "get it", seems like AHK is not fooling it.

I've found this old solution to activate an effect directly with AHK, but I haven't yet tried it: https://reshade.me/forum/shader-discussion/371-autohotkey-script-for-toggling-effects#2998

The ultimate layer-based ADS simulation would be to hold mouse2 to show a ReShade overlay.

Here's another example reticule I like, because the center is empty and has to be estimated:
Extra: Recoil
Although recoil only makes shooting harder the game considers this a cheat, so it won't take effect from the .vpk that gives us the crosshair circle (and tracers off).

We need to put it into a convars.txt.

If we use a mod from the Workshop that has a "convars.txt" file inside \Steam\steamapps\common\Left 4 Dead 2\left4dead2\ems\<modname>\cfg\, we can put the code in there, and it will work in SP campaigns and local games BUT not online. (For example Left 4 Bots 2 or Admin System has this file.) I do not know a way to have recoil in online multiplayer.

z_gun_kick 0.8

"Firing a gun can knock the player's view this amount of the current spread."
Default is 0, maximum is... I tried 400 with pistols, it still worked but my view was moved a LOT.

Sniper rifles and shotguns are much less affected, 10-15 looks good, but SMGs and pistols are more affected, 1 or even less looks good.

Source: https://developer.valvesoftware.com/wiki/List_of_Left_4_Dead_2_console_commands_and_variables
Summary
So there you go. I've shared all that I've learned while trying to scratch my aiming itches.

Right now I'm using a very transparent mid-sized custom static white circle with a black outline via ReShade plus a white, outlined dynamic crosshair with the circle, activated by holding the right mouse button when I want more precision or accuracy feedback.

Using a fairly large transparent circle allows me to line up my target with the estimated center of the circle, which is a bit similar to aligning iron sights. To me it's more fun this way.

I rarely use the crosshair, so the right mouse button is underutilized but I want to keep using it for aiming and the side button for melee for consistency across games.
Considering putting the scopes on MOUSE2 and completely letting go of the crosshair.

Here are all the codes collected from above:

autoexec

crosshair 0 alias +aim "crosshair 1; +speed" alias -aim "crosshair 0; -speed" bind MOUSE2 +aim cl_colorblind 1 cl_crosshair_dynamic 0 cl_crosshair_thickness 1 bindtoggle z crosshair bind v "incrementvar cl_crosshair_alpha 0 255 63" bind b "incrementvar cl_crosshair_thickness 0 5 1 bindtoggle n cl_crosshair_dynamic map credits gunbrain

tracerfix_linux.vpk

"convar" { cl_crosshair_circle_mode 2 cl_crosshair_circle_alpha 128 cl_tracers 0 mp_gamemode gunbrain2 }

convars.txt

z_gun_kick 0.4

TODO/Wishlist

1.
Activate the ReShade Layer.fx by holding MOUSE2, inactivate by releasing it.

2.
Showing the crosshair and using a gun scope both by holding MOUSE2 could be interesting.
But this doesn't work:
bind "MOUSE2" "incrementvar crosshair 0 1 1; +zoom"

Thank you!

Writing this guide took me a lot of time and effort (relatively), so I'm excited to share it.
Constructive criticism, additional useful information and appreciation are welcome. :)

GLHF