Left 4 Dead 2

Left 4 Dead 2

Not enough ratings
How to Setup a WWZ-Style AIMING System
By Doc903 and 1 collaborators
(Note, for now this is purely visual, I will be looking to make the aiming feature actually have a function later on.)

In this guide, I will show you the relatively simple steps to add a WWZ-style ADS system for your game; it is not true ADS, but it more similar to "iron-sights" that you see in hl2:mmod, and some other source mods.
   
Award
Favorite
Favorited
Unfavorite
Quick Setup (if you know how to make a .cfg, all you need is to copy the code)
If you know how to to create a .cfg file, you can skip this portion!

In order for this setup to work(for individual use, I intend to make a script later), you need to create a config(.cfg) file that uses cvars to mess with your FOV. These are completely player-preferential, and can be edited how you desire.

First thing I would recommend is grabbing Notepad++, if you do not have it already.

Upon starting Notepad++, click on "File", and then click "New". Your screen should look like this:


Then, copy+paste this section:

alias +fovzoom "fov_desired 90; +speed; bind Mouse2 +fovzoom" alias -fovzoom "fov_desired 120; -speed" bind Mouse2 "+fovzoom"




Then, click the "File" button in the upper left-hand corner, and go to "Save As":



Next, you need to locate your "cfg" folder. If you have the game installed directly to your PC, and not on a USB/External Drive, you will follow this path:

C:\ProgramFiles86x\Steam\steamapps\common\left 4 dead2\left4dead2\cfg

Then, name your file whatever you want; but, don't click save, yet.

Click the drop-down for "save as type", and select "all files" at the top of the massive scroll menu.

Now you can click "Save As", but make sure to keep track of the cfg folder location, you will need it, soon.
Editing your AutoExec
!!!Now, I am not very experienced with scripting, so I will just warn you that there may be issues if you have FOV Sliders, but I haven't experienced any personally(but I would heavily anticipate it)!!!

Now, we shall return to the cfg folder in:
C:\ProgramFiles86x\Steam\steamapps\common\left 4 dead2\left4dead2\cfg

Find the file labeled "autexec.cfg"; do not mess with the one labeled "autoexec360.cfg", I claim no responsibility for issues causes messing with that file.

NOTE: I have L4D2 installed on an External Drive, but the instructions will be the same!


Right-Click on the file, and look for Notepad++ under the "open with" options. If you are on Windows 11, and it does not automatically show NP++, you will need to click "more options" in the context menu, select "open with", and select Notepad++.


Once open, if your autoexec.cfg has nothing written in it(mine has a few to hide glows, so feel free to copy what I have in the screenshot), then type in
exec aim.cfg
using the filename you used during your initial setup. (Yes, I realized np++ had dark mode at this point).


Click the "Save" icon, or click File>Save, and close out NP++. Feel free to change the FOV settings to what you think would be comfortable.

Then you should be able to start Left 4 Dead 2 with the script running, but let's setup for the actual gameplay by taking note of the control changes!
General Changes/Controls
What is generally being applied, with this script, is key-binds and basic cvars to change the Right-Click function from the "shove", to both "fov" and "walk" functions. Essentially giving you the extra accuracy at the cost of slower speed.

Here is some general notes, where it concerns re-binds:

1. Right-Click is now the primary aiming button, in-line with WWZ
2. Shove has been binded to my Mouse4, as my mouse has 5 buttons to use.
3. Middle-Mouse is still good for snipers, that is not affected
4. This leaves your SHIFT key un-binded, in-case you want to add a function to it as well.

In general, I know some people like the faster pace of Left 4 Dead 2, but I believe this is a good way to keep that fast-pace, but give the player a little extra reward for their accuracy.

Special Thanks!
I couldn't have figured this out without the help of kurochama, mrfunreal, and the Left4Mod Discord server, for generally providing me with a basic script layout, and talking me through the process of refining it. Now to try and make a vpk of it.
1 Comments
Doc903  [author] 2 Dec, 2024 @ 3:38pm 
Update; using a listen server, the mod now gives the player the accuracy of a laser sight when aiming. Now I just need to figure out how to do this without the laser/sound of the laser playing.


crosshair 0

alias +fovzoom "fov_desired 45; +speed; cl_viewmodelfovsurvivor 37; bind Mouse2 +fovzoom; crosshair 1; upgrade_add laser_sight"
alias -fovzoom "fov_desired 90; -speed; cl_viewmodelfovsurvivor 74; -duck; crosshair 0; upgrade_remove laser_sight"

bind Mouse2 "+fovzoom"