one fire sound for a whole burst, how?

Started by eatKenny, November 23, 2014, 06:02:06 PM

Previous topic - Next topic

eatKenny

hi all,

i'd like to ask how to make it only play one fire sound for a whole burst? that will make guns like minigun sounds way more better.

one thought is, instead of playing fire sound when spawn the projectile, play it when shoot. but i need some instructions to do the job.

skullywag

Youll need to tie up the burst length of time with the sound length of time, otherwise youll end up with a mismatch, you want a sustainer not a oneshot, youll have to do this in DLL when the weapon burst starts.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Rikiki

It may be possible to tweak the sound properties? Play with the following parameters:

  • <maxSimultaneous>1</maxSimultaneous>
  • <priorityMode>PrioritizeNewest</priorityMode>

Otherwise, I play with sounds in M&Co. Security enforcement mod. Playing the sound when the damage is applied sould work but you would have to overload the Verb_Shoot class...

eatKenny

Quote from: skullywag on November 23, 2014, 06:39:10 PM
Youll need to tie up the burst length of time with the sound length of time, otherwise youll end up with a mismatch, you want a sustainer not a oneshot, youll have to do this in DLL when the weapon burst starts.
for me editing the sound length to match the burst length is easy, since the burst length is fixed if you dont edit the Def. i dont like a sustainer because i want a little echo effect after the burst which i dont think a sustainer can have.

i knew the only way is a custom DLL, i took a peak at core DLL earlier and found it in "Verb.cs" under "TryFireNextBurstShot"


protected void TryFireNextBurstShot()
    {
      if (this.TryShotSpecialEffect())
      {
        if (this.verbProps.fireSound != null)
          SoundStarter.PlayOneShot(this.verbProps.fireSound, (SoundInfo) this.caster.Position);


the question is can i simply remove this and add it to "Verb_Shoot"?

eatKenny

Quote from: Rikiki on November 24, 2014, 03:55:16 AM
It may be possible to tweak the sound properties? Play with the following parameters:

  • <maxSimultaneous>1</maxSimultaneous>
  • <priorityMode>PrioritizeNewest</priorityMode>

Otherwise, I play with sounds in M&Co. Security enforcement mod. Playing the sound when the damage is applied sould work but you would have to overload the Verb_Shoot class...

i've tried it earlier, seems didnt work(actully i think <maxSimultaneous> dont do anything), so i'm heading to the hard way.

Rikiki

Yep, you can overload Verb_Shoot. I did it in M&Co. Sec[...]ment mod. Have a look ;), umh, better with 2 eyes :D