Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Music in 0.7 ( and the mystery of the .bin) - solved  (Read 2095 times)

Dibuk

  • Lieutenant
  • **
  • Posts: 71
    • View Profile
Music in 0.7 ( and the mystery of the .bin) - solved
« on: November 29, 2015, 02:06:07 AM »

Fore some reason the game refuses to accept my code, game crashes as soon as I say "hi" to a fleet of the modded faction. the log holler about:
"java.lang.RuntimeException: Spec of class [com.fs.starfarer.loading.specs.e] with id [music_nihil_encounter_hostile] not found"
and I scream back at it.

The apparent non-working code:


Working code:

sound.json (in the mod folder)
Code
	"music":{

"music_nihil_market_neutral":[
{"file":"nihil_2.ogg","source":"sounds/music/","volume":0.2},
],
"music_nihil_market_hostile":[
{"file":"nihil_2.ogg","source":"sounds/music/","volume":0.2},
],
"music_nihil_market_friendly":[
{"file":"nihil_2.ogg","source":"sounds/music/","volume":0.2},
],
"music_nihil_encounter_neutral":[
{"file":"nihil_1.ogg","source":"sounds/music/","volume":0.2},
],
"music_nihil_encounter_hostile":[
{"file":"nihil_1.ogg","source":"sounds/music/","volume":0.2},
],
"music_nihil_encounter_friendly":[
{"file":"nihil_1.ogg","source":"sounds/music/","volume":0.2},
],
},

.faction
Code
	"music":{
"theme":"music_nihil_market_neutral",
"market_neutral":"music_nihil_market_neutral",
"market_hostile":"music_nihil_market_hostile",
"market_friendly":"music_nihil_market_friendly",
"encounter_neutral":"music_nihil_encounter_neutral",
"encounter_hostile":"music_nihil_encounter_hostile",
"encounter_friendly":"music_nihil_encounter_friendly",
},

In the native files the music is all located in a mysterious "music.bin", could it be that dialog music must be set-up in this way? If that's the case how to .bin?
« Last Edit: November 29, 2015, 10:29:56 PM by Dibuk »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Music in 0.7 ( and the mystery of the .bin)
« Reply #1 on: November 29, 2015, 10:20:09 AM »

No, it doesn't have to be in the bin.

The stuff you've got in your sounds.json file - is it inside a "music" section? It has to be inside that to be considered music.

You also need to do it like this:

{"file":"nihil_2.ogg","source":"sounds/music/","volume":0.2},

Not sure if pitch is used or not, but it's not necessary. "source" *is* necessary; can't do a full path in the file attribute.
Logged

Dibuk

  • Lieutenant
  • **
  • Posts: 71
    • View Profile
Re: Music in 0.7 ( and the mystery of the .bin)
« Reply #2 on: November 29, 2015, 10:22:05 PM »

It is in the music section.

I'll do what you said great guru, will try it now!

EDIT: That worked perfectly! Thank you so much!
« Last Edit: November 29, 2015, 10:28:46 PM by Dibuk »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Music in 0.7 ( and the mystery of the .bin) - solved
« Reply #3 on: November 30, 2015, 02:56:45 PM »

Nice, glad to hear it!
Logged