Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: My new mod weapon won't use the sound effect I've included  (Read 1096 times)

Inhilicon

  • Lieutenant
  • **
  • Posts: 61
  • I like when the ship
    • View Profile
My new mod weapon won't use the sound effect I've included
« on: April 12, 2021, 07:12:52 AM »

Is there something I'm missing? I've tried pointing to it in various ways via the .weapon file, the standard way appears to be "gun_fire", for example. I've tried including the format; "gun_fire.ogg" and "gun_fire_01" as well as "gun_fire_01.ogg" and nothing seems to work. It does not have the exact same bitrate or audio sample rate as the vanilla sound effects but I don't know if that matters.

What're the general ground rules I should follow to make sound effects play in the game?

EDIT: I realized there is a thread for minor questions that don't warrant their own thread, how do I delete my own thread?
« Last Edit: April 12, 2021, 07:15:25 AM by Inhilicon »
Logged

lgustavomp

  • Ensign
  • *
  • Posts: 32
    • View Profile
Re: My new mod weapon won't use the sound effect I've included
« Reply #1 on: April 12, 2021, 08:22:05 AM »

As far as I know, the bit rate does not matter. But the sample must be MONO.

Did you create your "sounds.json" on your data/config folder? if you don't you'll need to make something like this:

Quote
    "my_weapon_fire":
    [
        {"file":"my_sounds_folder/weapon_fire.ogg","pitch":1.00,"volume":1.00},
    ],

then, on your "weapon.wpn" file:

Quote
   "fireSoundTwo":"my_weapon_fire",
Logged

Inhilicon

  • Lieutenant
  • **
  • Posts: 61
  • I like when the ship
    • View Profile
Re: My new mod weapon won't use the sound effect I've included
« Reply #2 on: April 12, 2021, 08:40:26 AM »

I was following the "Intro to Modding" guide on the Starsector fandom site and it entirely glossed over anything to do with audio, so I was veritably left in the dark.

Have not yet created a sounds.json file, that must be the missing step! I really should've looked at the data/config folder of other mods earlier. Whoops.

That should fix everything, thank you very much!
Logged

AccuracyThruVolume

  • Commander
  • ***
  • Posts: 133
    • View Profile
Re: My new mod weapon won't use the sound effect I've included
« Reply #3 on: April 13, 2021, 12:29:46 AM »

Hmmm is it possible to make multiple "file" entries to include multiple slightly different sounds that it would choose from? Or would it just play all of them all the time?
Logged

lgustavomp

  • Ensign
  • *
  • Posts: 32
    • View Profile
Re: My new mod weapon won't use the sound effect I've included
« Reply #4 on: April 13, 2021, 04:10:28 AM »

Hmmm is it possible to make multiple "file" entries to include multiple slightly different sounds that it would choose from? Or would it just play all of them all the time?

If you want them to be randomly chosen, its simple.

same sample, slightly different pitch:

Quote
    "my_weapon_fire":
    [
        {"file":"my_sounds_folder/weapon_fire.ogg","pitch":1.10,"volume":1.00},
        {"file":"my_sounds_folder/weapon_fire.ogg","pitch":1.00,"volume":1.00},
        {"file":"my_sounds_folder/weapon_fire.ogg","pitch":0.90,"volume":1.00},
    ],

Different sample:

Quote
    "my_weapon_fire":
    [
        {"file":"my_sounds_folder/weapon_fire_01.ogg","pitch":1.00,"volume":1.00},
        {"file":"my_sounds_folder/weapon_fire_02.ogg","pitch":1.00,"volume":1.00},
        {"file":"my_sounds_folder/weapon_fire_03.ogg","pitch":1.00,"volume":1.00},
    ],
« Last Edit: April 13, 2021, 04:14:55 AM by lgustavomp »
Logged

AccuracyThruVolume

  • Commander
  • ***
  • Posts: 133
    • View Profile
Re: My new mod weapon won't use the sound effect I've included
« Reply #5 on: April 14, 2021, 03:18:36 AM »

That answers it, thx  ;)

Makes for some interesting possibilities....
Logged