BGS and adding background sounds to mission screens

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4814
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

BGS and adding background sounds to mission screens

Post by phkb »

In BGS there is code to allow the various contract mission screens to have the background sound effects continue playing. For all other mission screens the sound effects basically stop while the screen is active. It looks like the method BGS uses to work out the contract screens are active is to look at the screen ID, split the string based on a "-" separator character, check the first element for "oolite", then check the last element for either "summary", "map" or "none".

If I want to apply the same rules to a mission screen, the most obvious way to achieve it would be to just give my mission screens a screen ID that conforms with the above specification. But is there a more "official" way of doing it? I checked the documentation on the Wiki but couldn't seem to find anything that covered this situation. Have I missed something? Actually I think I must have missed something so any pointers would be greatly appreciated.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: BGS and adding background sounds to mission screens

Post by Svengali »

phkb wrote:
But is there a more "official" way of doing it?
screenID only has to be a String. There's no other rule or another way to identify a specific missionscreen.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4814
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: BGS and adding background sounds to mission screens

Post by phkb »

I'm sorry, I wasn't clear enough. I mean official from a BGS point of view. What's the best way to get BGS to continue playing the background ambient sounds on a mission screen, without giving it a screen ID that looks like "oolite-blah-blah-map" etc. I'm trying to make my mission screens more integrated, and the sound component is one I've ignored for a while. At the moment there is a jarring halt to all sounds when one of my mission screens open, so I'd like to get BGS to continue to play ambient sounds while they're running.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: BGS and adding background sounds to mission screens

Post by Svengali »

Ah, ok. At least Tricky's github-repo doesn't contain anything beyond the v1.77.1 handling you've described above. The ship registering screens are not handled as well.
Post Reply