Left 4 Dead 2

Left 4 Dead 2

Not enough ratings
How to Make a Custom Flashlight Addon
By noahthenova
a straight to the point tutorial on how to replace the base flashlight with your own flashlight in Left 4 Dead 2.

I didn't include images because they would make the guide page WAY longer than it needs to be. I may include a few later on if enough people ask for them though.
   
Award
Favorite
Favorited
Unfavorite
Setting Up
-----------------------------------------------------------------------------------------------------
BEFORE STARTING ANY OF THE STEPS OF THE ADDON CREATION PROCESS, MAKE SURE YOU HAVE DOWNLOADED THE LEFT 4 DEAD 2 AUTHORING TOOLS FROM STEAM.

To do this, follow these 4 steps:
  • Click on "Library" on the top left corner of the Steam application window, and then select "Home" from the dropdown menu
  • Click on the Box above the search bar on the upper left hand side of the Steam window, and click on the row which has the title "Tools" to make sure it has a blue check mark on its left side
  • Use the search bar above the list of applications or scroll down until you see "Left 4 Dead 2 Authoring Tools"
  • Right or left-click on "Left 4 Dead 2 Authoring Tools" and then click "Install" and go through the process to install the tools

Downloading the Left 4 Dead 2 Authoring Tools will allow you to package your addon folder for use in-game and upload your addon to the Steam workshop, so they are essential for this tutorial.
-----------------------------------------------------------------------------------------------------

You will first want to download 3 programs before you start creating the addon:

You may also need to download these tools if VTFEdit has problems:

Now create a folder path with this format: ([your addon name] → materials → effects)

Afterwards, find the image that you want to replace the default flashlight, and have it ready for the next part of the addon-making process.
Creating the Addon
1. In Image-Editing Program (Photoshop, GIMP, etc.)
  • Open your image-editing program and load your custom flashlight image into the application

  • Change the appearance of your image if you feel like it (not its size though). Make sure to fill any transparent areas of your image (where there is no background) with the color black. Also make sure to rotate your image 1 time/90 degrees counter-clockwise (left) or 3 times/270 degrees clockwise (right)

  • Make the image 512 x 512 pixels (5.12 x 5.12 inches)

  • Save your image as a .png file to have it ready for the last step in the addon creation process

2. In VTFEdit
  • Bring your newly exported custom flashlight image into VTFEdit by dragging your image into the program's .exe file or by opening VTFEdit up and going to File → Import

  • Under the "Flags" section within VTFEdit, make sure these boxes have check marks in them:

    - Trilinear
    - Clamp S
    - Clamp T
    - No Mipmap
    - Clamp All

  • Save your custom image in VTFEdit as a .vtf file by going to File → Save As. Make sure to name your flashlight file as "flashlight001" and to save it in the "effects" folder located at ([addon name] → materials → effects)

3. On Computer
  • Drag your addon folder into vpk.exe, which is located at steam → steamapps → common → Left 4 Dead 2 → bin → vpk.exe (I recommend making a shortcut of vpk.exe somewhere that's it's easy and convenient to access) A .vpk (Valve package) file of your addon folder will then be created in the same area that vpk.exe (or its shortcut) is located

  • Drag the .vpk file of your addon into the folder "addons", located at steam → steamapps → common → Left 4 Dead 2 → left4dead2 → addons

  • Test your custom flashlight in-game

Alternate Tutorial: Editing the Base Flashlight Directly
  • Go to steam → steamapps → common → Left 4 Dead 2 → left4dead2 → and open "pak01_dir". Now navigate to materials → effects → flashlight001.vtf

  • Open flashlight001 in VTFEdit by going to File → Open or by dragging it into the program

  • Go to File → Export and save the flashlight texture as a Targa (.tga) file to wherever

  • Bring flashlight001.tga into your image editor

  • Change the appearance of the flashlight image however you want (not its size though). Make sure to fill any transparent areas of the image (where there is no background) with the color black. Also make sure to rotate the image 1 time/90 degrees counter-clockwise (left) or 3 times/270 degrees clockwise (right)

  • Make the image 512 x 512 pixels (7.11 x 7.11 inches)

  • Save your image as a .png file and then follow the tutorial as I describe above from Step 2 "In VTFEdit" downwards

OPTIONAL: Adding Details and Image of Addon to In-Game List

Addon Details
  • Create a text file called "addoninfo" and set it up like this (copy&paste text block below):

    "AddonInfo"
    {
    addonSteamAppID 550 ------ (don't change; ID is specific to Left 4 Dead 2)
    addontitle "title goes here"
    addonversion version number goes here (1,2, etc.)
    addonauthor "author goes here"
    addonDescription "description goes here"
    }

  • Place the addoninfo file into the main folder of your addon ([addon name] → addoninfo)
Addon Image
  • Find an image of your choosing (.jpg and .png for example) and name it "addonimage"

  • Place this image within the main folder for your addon
Uploading to the Workshop
Open the Left 4 Dead 2 Authoring Tools Steam app

Click the "+" symbol or go to File → Publish New Add-on

Select the .vpk file of the addon that you want to upload to the workshop, title the addon, and add an image for it. Add a description and tags as well if you feel like it

Accept the terms of the Steam License Agreement and click on the "Upload" button on the in the bottom right area of the window

44 Comments
noahthenova  [author] 25 May @ 10:03pm 
@Trigonomancer Thank you for the comment. I made this tutorial with the original VTFEdit in mind (to this end, an original VTFEdit version has been listed and linked on this tutorial since it was published), and I didn't even find out about VTFEdit Reloaded until a little over a week before your comment here, when a person on my video version of this tutorial ran into a problem making a skin/texture addon because they had this successor VTFEdit. Unfortunately, some people think that redesigned versions of tools used for L4D2 modding will function the same as the original versions for the same programs without problems, but as you pointed out, there can be compatibility issues.
Trigonomancer 9 May @ 4:59pm 
I'd like to addendum something to the VTF creation step, you're likely to find yourself using VTFEdit Reloaded, the latest version of which will export v7.5 VTFs , these are incompatible with Left 4 Dead's engine branch, either download an older version of VTFEdit Reloaded or use VTF version changer [github.com] by antim0118 to downgrade specifically from v7.5 to v7.4 which is supported.
noahthenova  [author] 29 Jul, 2024 @ 12:55pm 
@Pwnage Peanut you're welcome
Pwnage Peanut 22 Jul, 2024 @ 8:12pm 
Thanks
noahthenova  [author] 11 Sep, 2022 @ 3:06pm 
@soppythesopmodfan You're welcome.

I sort of explained (but not in detail) in an earlier comment to you that once you switch from guns to some other guns (like the MP5), melee weapons (like the baseball bat), equipment (like medkits), and objects (like propane tanks) your flashlight will turn sideways, and there isn't really anything you can do about it as far as I know. I remember that I had looked at someone else's popular flashlight addon in the workshop a while ago, and they said that they didn't know of a way to stop flashlights from turning sideways once you switch to certain items. If this really is a big problem for you, and you don't want your image to turn on its side every time you switch to the items I mentioned, I would recommend that you use images that are the same size, shape, and color-wise on all 4 sides; this will make it pretty much impossible for you to notice a difference with the image once it turns, after you switch to another item.
Soppy 11 Sep, 2022 @ 1:51pm 
thank you
Soppy 11 Sep, 2022 @ 1:42pm 
oh wait its for some guns
Soppy 11 Sep, 2022 @ 1:41pm 
it works but the light is turned instead of it being straight up. is there a way i can fix it???
noahthenova  [author] 11 Sep, 2022 @ 10:45am 
@soppythesopmodfan If you packaged the addon folder into a vpk file and put that new vpk file into your addons folder, it should should normally work.

I set up your addon folder correctly and packaged your flashlight addon into a .vpk file for you: https://mega.nz/file/VrIHUToA#8PQ9SXagmc7KBxfXNB4w9DX6KGP_BLMtRZvQMHdCF0Q

Put this into your "addons" folder after disabling any other workshop flashlight addons and move your other local flashlight addons out of the addons folder, and then test the flashlight in game.

If this doesn't work for you, I would say to do it again, but after you follow the steps that I said in my 2nd to last comment, in which I say to try clearing your game cache, uninstalling Left 4 Dead 2 and reinstalling it, and trying what I said above in this comment on another computer if you can.
Soppy 11 Sep, 2022 @ 8:41am 
i used the vpk shortcut thing that you use