[Help] Problem with weapon sounds.

Started by SlayR, March 06, 2014, 03:48:47 PM

Previous topic - Next topic

SlayR

So I made some new weapons  (tools) and gave them new sounds downloaded from Freesound.org, but none of them works. They simply don't play when attacking. The sounds are WAV. format so it should work, but it does not for some reason. If you can help, please leave a comment.  :)

SlimeCrusher

Having the same problem with my flamethrower mod, i will be so happy to fix that... Although it may be a bug

Evul


Kilroy232

Having the same problem with adding a firing sound to a turret. I tries changing the file type to .ogg using audacity but that did nothing that I can tell.

StalkerCZ

Hey guys. You need to have right wav format. and then good coding.. thats is all. I got it and my sound work.. if someone need help ---> PM me
Project Armory v1.17
Project Catering v1.3

Tynan

Sounds require SoundDefs - did you make any?
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Kilroy232

Quote from: Tynan on March 11, 2014, 03:17:11 PM
Sounds require SoundDefs - did you make any?

That was where I messed up, I didn't know about the SoundDefs. Thanks!

SlimeCrusher

Umm as for myself, i already have a SoundDefs, i still don't understand too well what is happening, if someone can help, here's the code:
Quote<?xml version="1.0" encoding="utf-8"?>
<SoundDefPackage>
  <SoundDef>
    <name>FlameBrust</name>
    <sustain>False</sustain>
    <eventNames />
    <maxVoices>4</maxVoices>
    <maxSimultaneous>1</maxSimultaneous>
    <priorityMode>PrioritizeNewest</priorityMode>
    <slot></slot>
    <sustainStartSound></sustainStartSound>
    <sustainStopSound></sustainStopSound>
    <subSounds>
      <li Class="SubSoundDef">
        <name>UnnamedSubSoundDef</name>
        <onCamera>False</onCamera>
        <grains>
          <li Class="AudioGrain_Clip">
            <clipPath>Guns/FlameBrust<clipPath>
          </li>
        </grains>
        <volumeRange>
          <min>50</min>
          <max>50</max>
        </volumeRange>
        <pitchRange>
          <min>0.936413</min>
          <max>1.063587</max>
        </pitchRange>
        <distRange>
          <min>25</min>
          <max>70</max>
        </distRange>
        <repeatMode>NeverLastHalf</repeatMode>
        <paramMappings />
        <filters />
        <sustainLoop>True</sustainLoop>
        <sustainLoopDurationRange>
          <min>9999</min>
          <max>9999</max>
        </sustainLoopDurationRange>
        <sustainInterval>0</sustainInterval>
        <sustainAttack>0</sustainAttack>
        <sustainSkipFirstAttack>True</sustainSkipFirstAttack>
        <sustainRelease>0</sustainRelease>
      </li>
    </subSounds>
  </SoundDef>
</SoundDefPackage>

Tynan

Assuming you have a sound in Sounds/Guns/FlameBrust.wav (are you sure about the spelling?), you should be able to play it with SoundDef.Named("FlameBrust").Play();

For in-world sounds, you'll want to make a SoundInfo with the proper position and pass it to Play().

There is an in-game editor for sounds. Turn on dev mode and then click the two tiny squares at the top of the screen.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

SlimeCrusher

It should be able to work, though i tried everything, i doesn't work, everything is spelled correctly (With caps also, i know its caps sensitive  ;))
Umm how do i start the sound to atleast check it works? Like its that a command of some sort or i should put that somewhere in the code?

Bonus: A piece of my Flamethrower's code
Quote
   <ThingDef ParentName="BaseGun">
      <defName>Flamethrower</defName>
      <label>Flamethrower</label>
      <description>Burn! Buuuurn! The favorite weapon of a pyroman!</description>
      <texturePath>Things/Item/Equipment/Flamethrower</texturePath>
      <interactSound>InteractBoltActionRifle</interactSound>
      <purchasable>True</purchasable>
      <basePrice>500</basePrice>
      <verb>
         <projectileDef>Bullet_Flame</projectileDef>
         <accuracy>2</accuracy>
         <burstShotCount>30</burstShotCount>
         <ticksBetweenBurstShots>2</ticksBetweenBurstShots>
         <warmupTicks>250</warmupTicks>
         <range>10</range>
         <fireSound>FlameBrust</fireSound> <--- This is the most important
      </verb>
   </ThingDef>

Tynan

First try giving it the name of a standard gun sound that's already in the game.

If that works, copy that gun sound and give it a new name and try that.

If that work, change that gun sound to what you want.

You'll pinpoint the problem.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

StalkerCZ

Send my your files and i try to repire it. Need xml. Of sound weapon and wav sound you want to use i try to fix it. Maybe youhave wav in wrong format.
Project Armory v1.17
Project Catering v1.3