Modding Help Playing two weather sounds at once

Discussion in 'Starbound Modding' started by stealthXG, Jul 14, 2017.

  1. stealthXG

    stealthXG Pangalactic Porcupine

    Hello, I'm not very knowledgeable on starbound modding but bare with me. I'm trying to play the animal crossing rainy day theme when it starts raining. I know I can merge the two sounds together but I thought it'd be easier to play them both at once.

    Here's what I changed to all the rain files.

    Code:
    "weatherNoises" : [ "/sfx/weather/rain_light.ogg", "/custom/rainyday.ogg" ]
    It only plays one or the other.

    I've also tried adding "musicTrack" to the rain files below "weatherNoises" but that didn't work as well. If this isn't possible or simplistic then I think I will just merge the sounds together....
     
  2. cpeosphoros

    cpeosphoros Orbital Explorer

    Hi @stealthXG. I'd never had a look at weather modding before, and I know zip about ogg manipulating (I didn't know it was possible to merge them), so I may be wrong on some of my assumptions. That said, I did a fast but thorough research on weather and sound related files on vanilla and some major mods, and this is what I came to:

    I have ran a grep for "weatherNoises" on vanilla and FU and in all cases "weatherNoises" either points to a single file name or an empty list.

    By what you have described, it seems the engine randomly selects a sound from that list when playing that weather's sound.

    This piece from doc/lua:

    Code:
    #### `void` animator.setSoundPool(`String` soundName, `List<String>` soundPool)
    Sets the list of sound assets to pick from when playing a sound.
    seems to corroborate that understanding.

    I've ran another grep for "weather" on doc/lua/, and there is no documented API for detecting the current weather, so scripting the second sound (via animator.playSound), seems not viable wither, unless there is some form to detect the current weather.

    So, in resume, at a first approach, yes, it probably would be simpler to just merge the sounds if you want them to be played together, not alternatively.

    On the other hand, though, there seems to be a circuitousness way to do that:

    1: .weather files accept this field: "statusEffects" : ["myStatusEffect"]
    2: statusEffects have animations (which can be made with blank transparent frames, so to be effectively invisible)
    3: animations have sound...
     
    Last edited: Jul 14, 2017
    IHart likes this.
  3. lazarus78

    lazarus78 The Waste of Time

    Yeah, that is a JSON array, and most all arrays that I know of in this game are used as "selection pools" rather than an inclusion list.
     

Share This Page