PAYDAY 2

PAYDAY 2

111 ratings
Basic Mod Making
By marijn211
The old Payday 2 modding guides are outdated and limited in data, I therefore decided to make a guide on some basics.
I will not go in dept on modeling, .PDMODs and this does not include info on workshop skins, I might add sound editing later.
3
   
Award
Favorite
Favorited
Unfavorite
Introduction
Looking around the community there is a lot of modding info but most is limited or outdated, this should be a summary of up-to-date info on simple mod making.
For more complex things post a comment, it might be worth a try to ask it on the ModWorkshop Discord after you read the BLT documentation.
Some of this stuff was explained to me in there too, thanks to the people that helped me.

If you are in need of support or would like to be informed of updates or new releases of content by me (mods/YT/Twitch/other), check my brand new Discord:
https://discord.gg/9xdDJmb7ar
Video alternative
I made this video a while ago, the guide is probably more clear as it shows each step in detail but if you prefer a video here is one:
General Info
Some info that will be refered to in the guide.
Enabling the viewing of file extensions
File extraction
For making most mods you will first need the game files extracted (unless you only want to make LUA mods, add music or replace the intro).

Update 2022: The old bundle tool is no longer much supported, this might be more useful: https://modworkshop.net/mod/27741

To extract the game files you can use the Bundle Modder from here: http://modwork.shop/22724 and the hashlist from here: https://modworkshop.net/mod/23854
After you downloaded those you can start extracting the files, put the bundle tool anywhere (but it's most useful if you either put it somewhere in the game folder or a folder you will use for storing your mods), put the hashlist in it's folder and extract the files:
Go to Game File Extraction

And then choose a folder where to extract the files and after that click start.
After you extracted the files you might notice all code files are gibberish, those need to be decoded, you can download the files here: https://github.com/steam-test1/Payday-2-LuaJIT-Complete , then just override all the gibberish files with these.
mod_override mods
Mod_override mods are the most simple mods, this is how they work:
A mod_override mod contains files that will be overriden when the game loads, this works with most files but code mods work different and will most often go in your "mods" folder.
When you want to edit and override a file/files first search it/them in your extract folder, then look at it's location

each file needs to have the same path in your mod as in your extract folder so for each file make sure the folders after the name of your extract folder are the same.

Then if you have the folder paths the same copy the file(s) you want to be overriden from that/those folder(s) into your mod
Now my example file is correctly placed I can edit it and after I am done doing that placing the mod in my mod_overrides folder will overwrite the file my mod has.
Editing textures
To edit textures .dds/.texture files you need either GIMP[www.gimp.org] or Photoshop and a .dds plugin in case of photoshop, I will be showing this with GIMP but Photoshop is similar in use.
Normal textures
  • Load your texture
  • Make your edits
  • If you created new layers make sure you merge the visible layers before exporting
    (Flatten image which removes transparency should only be used when necessary, even if you don't see any transparancy this option might break the texture)
  • Export the texture as .dds
  • Go into the folder and rename the extension to .texture
  • Place the edited texture in your mod_override mod like I described there

Textures with reflections
For textures with reflections you will have to edit differently if you don't want your object to look like it's made of light emitting plastic, on Photoshop this is apparently easier because you can hide the alpha layer, on GIMP you can't so you will have to do it differently.
To do this with GIMP download XnViewMP[www.xnview.com].
These textures are df textures that are covered in a semi-transparent alpha layer, you can not do this for nm textures as these work different, you have to edit those like normal textures.
    Note: I accidentally grabbed a file that did not have anything important in the reflections layer, the rest is still the same tho
  • First find the texture in XnViewMP.
  • Select everything and copy it.
  • Paste it in a program that does not support the alpha layer like paint.
  • Then copy the image from paint into GIMP.
  • Make your edits.
  • While keeping the other file open, open the original file with alpha layer with GIMP.
  • Go to layers, hide all layers, then copy the alpha layer and make the copy visible.
  • Now you only have the alpa layer visible copy everything on the layer to your clipboard.
  • In your edited texture without alpha layer merge all visible layers if you had not done that already.
  • Create a layer mask with the default white (full opacity) option and make sure "Edit layer mask" is checked.
  • In this layer mask you want the alpha layer you copied, because just pasting the data would put it in a new layer select the clipboard brush, set it to a opacity of 80 and it's size to that of the texture file and then select the copied pixels as brush, then place your brush in the center of the texture and click once to place it.
    (note that my cursor is at (512, 512), that because this is the center of this texture which is 1024x1024 pixels)
  • Export the texture as .dds
  • Go into the folder and rename the extension to .texture
  • Place the edited texture in your mod_override mod like I described there
BLT and LUA modding
BLT mods load through a mod.txt or main.txt, here I will explain both.
I assume you already have the BLT hook and decoded script files (see file extraction).
First copy the LUA files you want to be adjusted from extract and put those in your mod folder, then make a mod.txt with this format:
{ "name":"Drag not bag", "description":"Carry bodies withouth using bags", "author":"marijn211", "contact":"[email protected]", "version":"3", "color": "40 40 255", "blt_version": 2, "image" : "mod.png", "hooks" : [ { "hook_id":"lib/managers/playermanager", "script_path":"playermanager.lua" }, { "hook_id":"lib/tweak_data/carrytweakdata", "script_path":"carrytweakdata.lua" } ] }
This is what the lines stand for:
"name": the name that will be displayed for your mod in the BLT mod menu
"description": the description for your mod that will show up in the BLT menu
"author": who made the mod
"contact": where can people contact you with issues with the mod
"version": what version of the mod this is
"color": the color your mod will have in the BLT menu in RGB
(RGB: Red, Green, Blue for each you can choose a value between 0 and 255, 0 being none of this color and 255 being the maximum amount of this color, these values will be used to create your color)
"blt_version": always put a 2 here
"image": if you have an image for the mod put it in the folder and put the name of the file (and a possible path) here
"hooks": what code files your mod will override, "hook_id" is the filepath the code file had in your extract folder (but without its extension), "script_path" is the path it has in your mod folder (with extensions), if you want to add more files simply copy the block, don't forget all blocks except the last one should have a comma after the }

When you have the file you can do 2 things:
Either you override the entire file (you can edit what you want but don't remove lines you didn't edit)
You use hooks I will show that here with as example economytweakdata.
This is the original file:
The basic format for a hook is:
Hooks:PostHook(function "location" , "function" , "the name you give the new function" , function(possibly arguments sometimes)
So here that becomes this:
Because:
I added self in the arguments because this function is full of lines with .self and tweak_data as it's a tweak_data file, other arguments will be in the original function already so you can copy paste them from that one.

Now you hooked this function you can change the file much more as it won't be overriden in it's entirety (however don't forget to put a ")" behind the "end" at the end of your function to close the posthook), you can remove parts in the function don't want to override, just remember to keep lines complete, in our example we could remove some of the self lines and only override one number as the others already loaded before the mod, remember that when using hooks you need to hook every function separately in the same format.

Adding auto-update with BeardLib
Combined with BeardLib (required for the auto-updating, also for other users) you can add auto-updating, to do so make a file named "main.xml" in the folder of your mod, in this file add the following code:
<mod name="insert the mod's name here"> <AssetUpdates id="insert id" version="1" provider="modworkshop"/> </mod>
The version is what version the mod is, if the version in here is different then the version you have entered on ModWorkshop it will give an update notification.
The ID is what number your mod page has on ModWorkshop, this is simply the number placed after "did=" in the url or just simply http://modwork.shop/the ID is here with shortened links.
Mod name is the name your mod will appear under in the BeardLib mod menu.
Adding music
Scince BeardLib has music code it became much easier to make and use music mods, first download BeardLib here: http://modwork.shop/14924
Then download a template to make a music mod, I prefer my personal template[modwork.shop], you can also use Luffy's original but I will explain it based on mine.
First you will want to download the music, if it's a Youtube video I recommend using https://yt1s.com/ because this site allows the downloading of music while some other sites like ClipConverter don't.
Download the music as mp3 and put it anywhere, where is not important yet because you first need to convert the mp3.
Payday uses .movie files, these are simular to .bik files so you can use RAD Video Tools[www.radgametools.com] to convert you music file to one.
After you downloaded the tool open up the software.First navigate to your mp3 file (RAD does not support MP3 files with variable bitrate, make sure that after you edit any files you export them without having this option selected)
When you are in it's folder click the file and click "Bink it!"in the down left corner.
The default options in this menu are fine so click Bink, then wait some time until it's done.
After the file is converted move it inside the template folder into \Template\Assets\music\CHANGE .
Make sure you have the viewing of file extensions on (see the general info), now rename the file to an easy name and also change the ".bik" in it's name to ".movie", it will give a renaming confirmation, click yes.
After you have done this go one folder up and rename the folder "CHANGE" you were just in to something else you can easily use. (The reason for this is that multiple mods with the same folder name for that folder will override and break each other)
After this go back to the main folder and open up "main.xml", it can be opened with notepad but I recommend using software like Notepad++[notepad-plus-plus.org].
In here replace "CHANGE" with the name you gave the folder and replace "track" with the name you gave the file don't put .movie in it's name.
After this choose a name for your mod and replace "custom" with an easy ID name, if you want it to be a heist track remove the < !-- and --> before the event lines and replace "track" with the names of the files you want for each event, if you add extra files you can only use them here, you can not add them as seperate track unless you make a new mod.
If you use these lines these are the event meanings:
"control" -> this is stealth
"assault" -> this music plays while assaults are in progress
"build" -> this plays before assaults
"anticipation" -> this plays shortly before an assault wave starts
There are also intro variants of these events for more advanced users, these play in between the other events as transitions, I've never used these (because it's impossible to make proper transitions from most songs, it's more for when you get it from a soundtrack from a different game or make one yourself) and would recommend asking a different music modder about this.
After you made the changes you want you can save and close this file.
After that move into the "Loc" folder and open "EN.txt".
In here replace "custom" with the ID you chose and replace "Custom Music" with the name you want the music to show up with in-game.
After this your mod should work, move the Template folder into mod_overrides to test it (and rename the folder to the name of your mod).
Replacing videos
The method I show here requires BeardLib[modwork.shop] for the user.
If you want to replace a file in extract/movies like the intro first get it as mp4, if it's a Youtube video try https://www.clipconverter.cc/ .
After that you want to convert it to a .avi file, most (if not all) online converters do this differently then it should be done so install ffmpeg[ffmpeg.zeranoe.com] to do this correctly.
When you have downloaded the correct build for your OS go in the zip file and into the "bin" folder and move the .exe files into C:/Windows/System32 so you can run the software from the cmd/powershell.
Now how to convert it:
  • Open up powershell/the cmd in the folder where your mp4 file is or navigate to it
  • Enter the following command: ffmpeg -i videoname.mp4 -vb 20M videoname.avi
    (If your videoname is very long or has spaces you can use the tab key so it automaticly selects it)
    Now you have the video as .avi, this process can give low quality videos so check wether the video is good and if not try this process again with a higher bitrate.
Now you have it as .avi but you want the file to be a .movie so it needs to be converted a second time with RAD Video Tools.
  • Open up RAD Video Tools and find your file
  • Select Bink in the down-left corner
  • Convert it with the default settings
  • Go to the location of your converted file and rename it to the name of the video you want to overwrite, "intro_trailer.movie" for example.
  • Now create a folder for your mod if you had not done that yet and create a folder named movies in there and put your file in there.
  • Go back to your main mod folder and create a file named "add.xml", in that file add the following code:
    <table> <movie path="movies/the name of the file you want overriden without extension" force="true"/> </table>
Now you have a mod_override mod that will override the video file.
Modeling
Overriding models works throught mod_override mods so look there for the basic format.
For editing models you can use the free software Blender[www.blender.org].
The model files in the game are default in .model format which can not be opened in Blender, you therefore need to convert any file you want to edit to a .obj file with Znix's converter[superblt.znix.xyz].
Then you can import the obj as an object (it's not loadable as a file directly) in Blender until they are done and you can use the tool to convert them back.
49 Comments
marijn211  [author] 24 Dec, 2024 @ 3:42am 
No, theres dedicated tools for all audio that isnt music, PDsoundbankeditor is the main one I think
coolkevin9 24 Dec, 2024 @ 2:58am 
i know this is necroposting and you no longer mod the game but is the music method the same for replacing or adding voice lines?
Twitchy 1 Jul, 2024 @ 5:34pm 
Oh alright
marijn211  [author] 1 Jul, 2024 @ 2:17pm 
Sorry I no longer mod PAYDAY, I can only help with the basics
Twitchy 1 Jul, 2024 @ 1:23pm 
Im trying to add weapon sights for the s&w could you give me some help
YOUR FRIEND 15 Nov, 2023 @ 4:02am 
Hi, i am trying to make a perk deck and i want to give it a new effect, i figuerd out how to give my perk deck an effect from different perck deck, but i dont know how to make a new effect that will give something like 2s inv from Anarchist, but instead it will give 100 dodge when your armor breaks, can you help me?
marijn211  [author] 2 Jan, 2023 @ 3:56am 
That's a text file afaik
mickey 1 Jan, 2023 @ 9:56pm 
can i edit a gui file or no?
J.C. Menton 22 Nov, 2022 @ 1:34pm 
i was wondering. is it possible to make a vocalizer mod with this? i was thinking of something very specific.
marijn211  [author] 6 Sep, 2022 @ 2:48pm 
Ive added a link to the Bundle Viewer, a more recent and possibly useful tool over the old Bundle tool