Scripts Provided:
uexpconverter.py
Edits the uexp hex data for you so you don't have to do it manually. Does not encode or convert .wav files. Does not back up any files.
Requires the corresponding (ID).json files for each .uexp inside a folder called "json_files". This is where it gets the unmodded ubulk file size from.
- You can get the json file using FModel. Right click a .uasset and select "Save Properties (.json)." It will appear where your other files get exported to by default.
Have the modded ubulk inside the same folder as your script and run py uexpconverter.py
If all goes well, you should see "Size replaced successfully."
Troubleshooting:
- If you see "Old size not found in hex data", this more than likely means the .uexp file has been edited before. This script requires the unmodded .uexp file.
- "No ubulk file found for x.uexp". You need to have your modded ubulk file alongside the uexp file in the same folder.
- "Error: Old size not found in JSON file for x.uexp" - Either the json file is missing, or it is not structured properly.
- High pitched audio: setting the audio's bitrate to 2304k may fix this (thanks Wednesday Enthusiast)
ffmpeg -i input.wav c:a pcm_s16le -b:a 2304k output.wav
nullifyuexp.py
Does not back up any files.
Changes the hex data where the file size is stored in a .uexp to 0. This essentially means that the game cannot play said audio.
So, it mutes all .uexp files in the same folder as the script. Meaning you can don't even need the related .uasset or .ubulk files for your audio mod if you're just muting things.
littleendian.py
Requires ffmpeg.
Converts all the .wav files in the same folder as the script to little-endian (the equivalent to ffmpeg -i input.wav -c:a pcm_s16le output.wav
)
All the converted files will be put into a folder, "little_endian" within the same folder as the script.
copyexportedfiles.py
Useful if you exported all the audio files in the game using FModel like me.
Checks the IDs file specified (something like IDs.txt) for the files to copy.
You can either have IDs.txt like "Wwise_Name xxxxxxxxxx" per line. (For example using Wednesday's Resource but removing the lines you don't need) OR you can set it up so it's just one ID per line.
Has options to copy over .uasset, .uexp, and .ubulk
files, or .json
files.
The source directory you use is saved to a .json
file in your AppData/Roaming
folder or ~./config
folder with the name snoozeds_copyexportedfiles_options.json
How to Use Scripts:
Install python - I used 3.12.2
- I recommend checking the "Add Python x to PATH" option.
Open a command prompt, I recommend Windows Terminal as you can simply right click in File Explorer, then click "Open in terminal".
You can also click the bar at the top of File Explorer that shows the location and type "cmd".
I would not recommend using Python's IDLE to run scripts as that has lagged out my system in the past because it can spam command prompt windows.
Enter py scriptname.py
and the script will run.
payday 3 modding is painful