Jump to content

Custom water splash for small objects?


D2Jk

Recommended Posts

Hello,

If an ejected shell hits the water in Heretic, it will use the default splash sound, which is too loud. I'm trying to make it use a custom water splash sound effect instead, but could use some help here.

Let me know if there's a smarter way to do this, but here's the code I've been trying with so far:

ACTOR BulletCasing1
{
 Projectile
 BounceType "Doom"
 BounceFactor 0.55
 BounceSound "ShellSound"
 +DONTSPLASH
 +EXPLODEONWATER
 +FLOORCLIP
 -NOGRAVITY
 States
  {
   Spawn:
    SHEL ABCDEFGH 2
    Loop
   Death:
    TNT1 A 0 A_JumpIf(waterlevel >> 0, "SmallSplash")
    SHEL A -1
    Stop
   SmallSplash:
    TNT1 A 0 A_PlaySound("smallsplash")
    SPSH ABCDD 8
    Stop
  }
}
In the Death state, the shell should detect when it's lying on water, and jump to create a splash effect. Also, if I've understood correctly, the +EXPLODEONWATER flag should go to the Death state immediately, but it does not (the shell bounces on water as well).

Share this post


Link to post

If you reduce the mass of the casings enough, it should make a small splash (thus, a small splash sound) as opposed to the normal one. A mass value less than 10 should do it, I think.

D2Jk said:

    TNT1 A 0 A_JumpIf(waterlevel >> 0, "SmallSplash")

I think you meant: "waterlevel > 0" or "waterlevel >= 0"? The ">>" is the bitwise right shift operator.

Share this post


Link to post

Thanks for the reply. It's true that lowered mass property causes a lighter water splash graphics to appear, however, doing that won't change the splash sound effect. Actually, when you suggested lowering the mass, I was expecting it to maybe play at slightly lower volume.

Anyway, the lighter splash graphics is ok, but I really would like to be able to use a custom sound effect. I just need help with the code above. Unfortunately I've already tried with single ">" as well, and that didn't do it. But thanks for the advice.

Share this post


Link to post

Try this:

  Spawn:
    SHEL ABCDEFGH 2 A_JumpIf(waterlevel > 0, "SmallSplash")
    Loop
  Death:
    SHEL A -1
    Stop
  SmallSplash:
    TNT1 A 0 A_PlaySound("smallsplash")
    SPSH ABCDD 8
    Stop

Share this post


Link to post

It still bounces on water. Testing with "waterlevel >= 0" at least makes the jump (the shell looks like a splash of water), but that's of no use.

Share this post


Link to post

Sorry about that. That was me being stupid.

D2Jk said:

It's true that lowered mass property causes a lighter water splash graphics to appear, however, doing that won't change the splash sound effect.

Checking things, it'd seem that the sound effect for both small and big splashes is the same. So what you want to do is redefine the sound (in SNDINFO) so it uses the sound effect you want:

world/drip SSPLASH
"world/drip" is the sound definition used for the small splash. "SSPLASH" is just an example. Replace it with your sound.

Share this post


Link to post

Wow, you da man. It didn't even cross my mind to check something like that. Thanks a lot. :-)

The water bouncing behavior of this actor will remain a mystery for me I guess, but for now it doesn't matter.

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...