Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
ironmanmine12

How to make separate sounds for chaingun and pistol?

Recommended Posts

For a custom WAD, I want to make one of the weapons an MP5SD (replaces the chaingun) and have it have a custom silenced sound, but it shares a sound with the pistol. Is there a way I can make it so the pistol and the chaingun have a different fire sound?

 

Share this post


Link to post

If you're making a wad for (G)ZDoom, this is really easy to do via the Slade program with DECORATE and SNDINFO entries. Without modifying anything else about the chaingun's properties, you define a new actor in the DECORATE file for your wad like this:


 

actor MP5SD : Chaingun replaces Chaingun
{
  states:
	{
	Fire:
     CHGG A 0 A_PlaySound("weapons/MP5SD", CHAN_WEAPON)
     CHGG A 0 A_GunFlash
     CHGG A 4 A_FireBullets(5.6, 0, 1, 5, "BulletPuff")
     CHGG B 0 A_PlaySound("weapons/MP5SD", CHAN_WEAPON)
     CHGG B 0 A_GunFlash("Flash2")
     CHGG B 4 A_FireBullets(5.6, 0, 1, 5, "BulletPuff")
     CHGG B 0 A_ReFire
     Goto Ready
	}
}

 

Then you import your new chaingun sound and make a SNDINFO file for your WAD, and write something like this in it:

 

weapons/MP5SD		MP5FIRE

where "MP5FIRE" is the name of the new sound effect you put in.

Share this post


Link to post

Do I need an editor for this? If so, where can I find the weapon file and do I need a specific text editor to use?

28 minutes ago, SMG_Man said:

If you're making a wad for (G)ZDoom, this is really easy to do via the Slade program with DECORATE and SNDINFO entries. Without modifying anything else about the chaingun's properties, you define a new actor in the DECORATE file for your wad like this:

 


 


actor MP5SD : Chaingun replaces Chaingun
{
  states:
	{
	Fire:
     CHGG A 0 A_PlaySound("weapons/MP5SD", CHAN_WEAPON)
     CHGG A 0 A_GunFlash
     CHGG A 4 A_FireBullets(5.6, 0, 1, 5, "BulletPuff")
     CHGG B 0 A_PlaySound("weapons/MP5SD", CHAN_WEAPON)
     CHGG B 0 A_GunFlash("Flash2")
     CHGG B 4 A_FireBullets(5.6, 0, 1, 5, "BulletPuff")
     CHGG B 0 A_ReFire
     Goto Ready
	}
}

 

Then you import your new chaingun sound and make a SNDINFO file for your WAD, and write something like this in it:

 


weapons/MP5SD		MP5FIRE

where "MP5FIRE" is the name of the new sound effect you put in.

 

Share this post


Link to post

Yes, you need an editor to edit the files - Slade3 is ideal.

 

Download, run, set gzdoom.pk3 as a base resource and open your wad. And then, outside the markers or folders create a text file named DECORATE(New entry button > name > select type Text). The text editor is right there too. You can use the code SMG_Man posted, but that won't change the look of the gun(unless your new sprites have the same names as the old ones).

 

If you haven't done this before, I'd check thisthis or some tutorial on how to edit actors, there are YT videos and such.

Share this post


Link to post

The code that SMG_Man provides gives me an error. I'm not really making a custom weapon, I just want a separate sound for one weapon rather than the chaingun and pistol sharing a sound. (The MP5SD is just a reskin of the chaingun but with custom graphics and firing speed. I plan on adding a separate sound.)

Screenshot 2021-09-12 120616.png

Edited by ironmanmine12 : edit

Share this post


Link to post

The problem with the provided code is the colon after "states". It should be "states", not "states:".

Share this post


Link to post
1 minute ago, Gez said:

The problem with the provided code is the colon after "states". It should be "states", not "states:".

When I do that, the chaingun is unusable.

 

Share this post


Link to post
5 minutes ago, Gez said:

The problem with the provided code is the colon after "states". It should be "states", not "states:".

 whoops, my bad

 

4 minutes ago, ironmanmine12 said:

When I do that, the chaingun is unusable.

what exactly isn't working? Is the game not letting you select the gun? What happens if you use IDKFA or "give MP5SD" in the command line?

Share this post


Link to post

It won't let me select the weapon.

When I do give MP5SD, it gives me the chaingun but it's dead silent. I also can do damage but can't select it after unequipping it. It also won't allow the custom sprites i used.

Share this post


Link to post

alright, so to the other issues:

 

4 minutes ago, ironmanmine12 said:

it gives me the chaingun but it's dead silent.

 

The DECORATE/SNDINFO stuff I mentioned assumes you have your sound in the lump as well, and that the sound effect name matches up with the lump name used in SNDINFO ("MP5FIRE" in this case). Either rename the sound effect or change the "MP5FIRE" thing in the SNDINFO to fix it.

 

6 minutes ago, ironmanmine12 said:

It also won't allow the custom sprites i used.

 

Similar in nature, your custom weapon sprites need to either be named the same as the default Chaingun ones to override them, or you need to further modify the weapon's DECORATE entry to use the new sprites if they don't use the same name as the Chaingun ones.

Share this post


Link to post

Another way to make new sounds in GZDoom is to redefine the names in SNDINFO. If you only want to change the sound, you do not need to make a new actor.

 

You should be able to make a sndinfo lump and redefine existing sound names they will be replaced.
 

weapons/chngun		MP5FIRE

And even replace the chaingun zombie's sound to match the new sounds too if you want too.

 

chainguy/attack		MP5FIRE

 

The pistol and chaingun both technically use the same sound, but they have different names in the sound info lump so they can be replaced with different sounds from each other. I recommend consulting the predefined sounds on the wiki.

 

But making a new actor will have it's advantages of allowing you to change how the weapon works, and even making something totally new, so it's a good thing to learn how to do if you want to make mods with new weapons.

Edited by Xim : more info, edit words

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×