Page 1 of 1

New chainsaw makes additional sound of end of Fire:

Posted: Sun Mar 22, 2015 12:31 pm
by ninja2000
Hello.

The saw makes additional noise (when player dies while attacking). The sound is played every time when the player ends the attack. I've tried a lot to remove this sound. Any suggestions to remove it from the attack section?

The chainsaw code:

Code: Select all

ACTOR "chain saw" : weapon replaces chainsaw
{
  Weapon.Kickback 0
  Weapon.SelectionOrder 2200
  Inventory.PickupMessage "$GOTCHAINSAW"
  Obituary "$OB_MPCHAINSAW"
  +WEAPON.MELEEWEAPON
 States
  {
  Ready:
    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_PlaySound ("weapons/sawidle")
    SAWG CD 4 A_WeaponReady
    Loop
  Deselect:
  SAWG C 0 A_Lower
    SAWG C 1 A_Lower
    Loop
  Select:
  TNT1 A 0 A_PlaySound ("weapons/sawup")
  SAWG C 0 A_Raise
    SAWG C 1 A_Raise
    Loop
  Fire:
    SAWG AB 4 A_Saw ("weapons/sawfull", "weapons/sawhit", 3, Bulletpuff)
    SAWG B 0 A_ReFire
    Goto Ready
  Spawn:
    CSAW A -1
    Stop
  }
}

RE: New chainsaw makes additional sound of end of Fire:

Posted: Sun Mar 22, 2015 4:27 pm
by Arctangent
I'm really tempted to say that it's not actually any new sounds, but just a part of sawfull or sawhit that you usually don't hear because the sound is more than 0.11 seconds long and the idle sound interrupts them. Try replacing those with a far shorter sound and see if that happens.

RE: New chainsaw makes additional sound of end of Fire:

Posted: Sun Mar 22, 2015 4:45 pm
by ninja2000
Thank for the tip, but I've already patched this up. It took me like 30 minutes of thinking (I should get more breaks, so I can see more stuff in the code).

This is the new chainsaw code

Code: Select all

ACTOR "chain saw" : weapon replaces chainsaw
{
  Weapon.Kickback 0
  Weapon.SelectionOrder 2200
  Decal Bulletchip
  Inventory.PickupMessage "$GOTCHAINSAW"
  Obituary "$OB_MPCHAINSAW"
  +WEAPON.MELEEWEAPON
 States
  {
  Ready:
    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_PlaySound ("weapons/sawidle")
    SAWG CD 4 A_WeaponReady
    Loop
  Deselect:
  SAWG C 0 A_Lower
    SAWG C 1 A_Lower
    Loop
  Select:
  TNT1 A 0 A_PlaySound ("weapons/sawup")
  SAWG C 0 A_Raise
    SAWG C 1 A_Raise
    Loop
  Fire:
    TNT1 A 0 A_PlaySound ("weapons/sawfull")
    SAWG AB 2 A_Saw (0, "weapons/sawhit", 2.5)
    SAWG B 0 A_ReFire
    Goto Ready
  Spawn:
    CSAW A -1
    Stop
  }
}

RE: New chainsaw makes additional sound of end of Fire:

Posted: Sun Mar 22, 2015 6:34 pm
by Dusk
A_Saw plays sounds on CHAN_WEAPON while A_PlaySound uses CHAN_BODY by default, so the A_PlaySound call didn't override the existing weapon channel sound. Your new code plays everything on the body channel.

I'd advise using the first code and supplying CHAN_WEAPON to all A_PlaySound calls (or use A_PlayWeaponSound as a short-hand for this).