DOOM 3
Wrench May 3, 2022 @ 8:12pm
Help modding pk4 file
Im trying to mod the shotgun to get its spread reduced, however its not doing anything in game. Something im missing? Im using Doom 3 enhanced edition mod.
< >
Showing 1-1 of 1 comments
Lippeth May 16, 2022 @ 12:13am 
What have you tried so far?

There are two ways people usually go about it, if just reducing the spread you can edit either the def file or the script file, but if you also want to adjust the amount of projectiles to compensate, only editing the script file is simpler than editing both the def and script.

Def Method:
In the base folder, create a new folder called "def", then open "pak000.pk4" with something like 7zip, open the def folder and drag "weapon_shotgun.def" into your new folder. Open that file with a text editor and go to line 91 or search for the keyword "spread". Change "22" to whatever you like and enjoy your new spread size.

For example:

default:
"spread" "22"
modified:
"spread" "11"

Script Method:
In the base folder, create a new folder called "script", then open "pak006.pk4" with something like 7zip, open the def folder and drag "weapon_shotgun.script" into your new folder. Open that file with a text editor and go to line 136 or search for the keyword "launchProjectiles". Change the word "spread" to a number lower than the default of 22 and enjoy your new spread size.

For example:

default:
launchProjectiles( SHOTGUN_NUMPROJECTILES, spread, 0, 1.0, 1.0 );
modified:
launchProjectiles( SHOTGUN_NUMPROJECTILES, 11, 0, 1.0, 1.0 );

You can also change the amount of projectiles shot at once on line 10 of the script file by changing "#define SHOTGUN_NUMPROJECTILES" from 13 to whatever number you wish. You can also change nearly any and every value if you really want to experiment. You can learn a lot just by poking around the files.

If you want to pack your changes up nicely, you can highlight the folders containing your modifications, save as a zip file and change the extension to pk4, or copy and paste an existing pk4, delete its contents and replace it with your folders. Name the file something that starts with a later letter of the alphabet, as Doom 3 reads files alphanumerically, so something like "z_reduced_shotgun_spread" or even "pak009".

Avoid editing the pk4 files that came with the game and create patches instead, or you'll have to reinstall the game if you want to revert to the defaults which will also cause you to lose any changes you've made. Enhanced Edition doesn't do anything to the shotgun, so there won't be any conflicts or overriding.
< >
Showing 1-1 of 1 comments
Per page: 1530 50

Date Posted: May 3, 2022 @ 8:12pm
Posts: 1