Jump to content

How to change number of shots fired from the machine gun in doom 3


Recommended Posts

Posted (edited)

How do i change the number of shots fired from the machine gun in doom 3? ie how much the ammo screen goes down by, so in my case i want the ammo count to go down by 3 each shot. How?

Edited by Sees232

Share this post


Link to post
Posted (edited)

Do you mean in one shot like a shotgun, or like a three round burst? Or do you want the ammo display to decrease by three while firing a single shot?

 

All three can be done by editing the weapon_machinegun::Fire() state found at line 98 in base/pak006.pk4/script/weapon_machinegun.script. To make changes in a nondestructive way, create a folder in your Doom 3 directory called script and copy weapon_machinegun.script into it. You can always zip it later and change the extension from zip to pk4 (I assume it's safe to do that, someone lemme know if there's a better way). 7-Zip and Notepad++ might be helpful if you don't already have them.

 

To reduce the ammo counter by three while only firing one projectile, underneath launchProjectiles on line 109, write in useAmmo(2); to decrease the ammo by an extra two, in addition to the one already used by launchProjectiles.

launchProjectiles( MACHINEGUN_NUMPROJECTILES, spread, 0, 1.0, 1.0 );
useAmmo(2);
playAnim( ANIMCHANNEL_ALL, "fire" );

 

To fire three projectiles at once like a shotgun and still reduce ammo by three, paste launchProjectiles two times underneath itself.

launchProjectiles( MACHINEGUN_NUMPROJECTILES, spread, 0, 1.0, 1.0 );
launchProjectiles( MACHINEGUN_NUMPROJECTILES, spread, 0, 1.0, 1.0 );
launchProjectiles( MACHINEGUN_NUMPROJECTILES, spread, 0, 1.0, 1.0 );
playAnim( ANIMCHANNEL_ALL, "fire" );

 

To do a three round burst, you can extend the value of MACHINEGUN_FIRERATE to something like 0.45 on line 7, and then replace lines 109 and 110 with the following:

launchProjectiles( MACHINEGUN_NUMPROJECTILES, spread, 0, 1.0, 1.0 );
playAnim( ANIMCHANNEL_ALL, "fire" );
sys.wait(0.075); //or a value of your choice
launchProjectiles( MACHINEGUN_NUMPROJECTILES, spread, 0, 1.0, 1.0 );
playAnim( ANIMCHANNEL_ALL, "fire" );
sys.wait(0.075);
launchProjectiles( MACHINEGUN_NUMPROJECTILES, spread, 0, 1.0, 1.0 );
playAnim( ANIMCHANNEL_ALL, "fire" );

 

It wasn't explicitly clear which of these you meant, and there very well may be cleaner ways to do each one, but hopefully this is still helpful!

Edited by Lippeth

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...