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

How do i make a projectile only make a sound, when it hits an enemy?

Recommended Posts

Hello, while i was making a few adjustments to my weapons, i stubled across a problem.

while i was doing the projectile sound thing, it didnt´t work

298516621_SLADE04_04.202101_11_57.png.1419e3c65b11b1867ca58baa1230a1dc.png

i tried putting it in spawn, but it wont work too.

(with and without a_checkblock)

Then i realised that it wont work with both of them

any ideas how to make this happen?

(you can also put it in ACS)

thanks, and i hope the answer will help others too.

Share this post


Link to post

Been a little while since I've handled decorate but I think you can simply use "seesound " " ". (Place it ABOVE the States section).

 

If the engine kicks up a fuss about SNDINFO, I think "seesound "BLANK" " is fine, then in a SNDINFO textfile, type "BLANK BLANK.wav". (make sure a BLANK.wav is added and contains no sound).

Share this post


Link to post

In theroy it's good, but i also want it to play it a different Sound (forgot to mention that) as you can see in decorate line 134, i have an idea what wil fix this bug by just replacing the "Stop" in the death state with a "goto "customfunction"" (i know that works) and Will make a Report on how it went. I can forgive you for stuff like that a projectile has no see sound normaly so it would not make a sound because you also mentioned that it was a while sience you did Something with decorate. still Thanks for the advice.

 

 

 

Share this post


Link to post

Remove the "50". Max volume is 1. If it's too quiet you'll have to edit the sound in Audacity or something.

 

It should be:

 

PCTP A 1 A_PlaySound("Bonebreak", 0)

 

and

 

PCTP A 1 A_PlaySound("THONK", 0)

Share this post


Link to post
17 hours ago, Lippeth said:

Remove the "50". Max volume is 1. If it's too quiet you'll have to edit the sound in Audacity or something.

 

It should be:

 

PCTP A 1 A_PlaySound("Bonebreak", 0)

 

and

 

PCTP A 1 A_PlaySound("THONK", 0)

It would just play a sound, even if it hits a wall (i don't want that to happen). The thing i wanted to try did not work, so i will try another thing

 

Share this post


Link to post

I can't make sense of what you're saying. You can use different states for projectiles. Here's a sample:


	Spawn:
		TRAC A 1 Bright A_ChangeVelocity(0, 0, -0.25, CVF_RELATIVE)
		Loop
	Death:
		TNT1 A 0 A_Explode(5*random(1,5),24,0)
		TNT1 A 1 A_SpawnItemEx("BuellerPuff")
		Stop
	XDeath:
		TNT1 A 0
		Stop

 

If the bullet hits a wall it calls the death state. If it hits something that bleeds it goes to xdeath.

Here's more info. https://zdoom.org/wiki/Creating_new_projectiles

Share this post


Link to post
20 hours ago, Bryan T said:

I can't make sense of what you're saying. You can use different states for projectiles. Here's a sample:



	Spawn:
		TRAC A 1 Bright A_ChangeVelocity(0, 0, -0.25, CVF_RELATIVE)
		Loop
	Death:
		TNT1 A 0 A_Explode(5*random(1,5),24,0)
		TNT1 A 1 A_SpawnItemEx("BuellerPuff")
		Stop
	XDeath:
		TNT1 A 0
		Stop

 

If the bullet hits a wall it calls the death state. If it hits something that bleeds it goes to xdeath.

Here's more info. https://zdoom.org/wiki/Creating_new_projectiles

Ohhh of course, zdoom wiki was the solution! (This also helped), Thanks for the reminder (and the solution)

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

×