Library

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

Moderators: winston, another_commander

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13554
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Library

Post by Cody » Tue Oct 11, 2016 3:01 pm

Svengali wrote:It's already gone...
Already Gone? Any excuse for a song! <grins>

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2365
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali » Tue Oct 11, 2016 3:09 pm

Cody wrote:
Svengali wrote:It's already gone...
Already Gone? Any excuse for a song! <grins>
Till you put me down ... sigh

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2365
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali » Tue Nov 01, 2016 11:26 am

Library1.1 for current trunk is available -> Library1.1.oxp.zip (801.7 KB)

Changes:
- Master volume for Lib_Music settable through Lib_Config.
- Added volume parameter for tracks in Lib_Music.

See Separate Volume Controls

User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 886
Joined: Wed Feb 23, 2011 10:08 pm
Location: With Simona Barr, commander of the Nocturnal Maru.
Contact:

Re: Library

Post by CaptSolo » Tue Nov 01, 2016 3:39 pm

I am playing Oolite 1.84. Does this OXP negate the need to have both BGS and CCL in my AddOns folder?

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13554
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Library

Post by Cody » Tue Nov 01, 2016 3:49 pm

Yes - you'll need BGS 2.0, but not CCL, if you install Library.

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2365
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali » Wed Nov 02, 2016 2:12 pm

CCL? It depends on what kind of AddOns you're using.
As Cody already pointed out BGS2.0 doesn't need it and my other AddOns (Snoopers and Vector) will switch to Library as well. Library also replaces OXPConfig and Hyperradio - both were just to limited and Library offers better functionality.

User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 886
Joined: Wed Feb 23, 2011 10:08 pm
Location: With Simona Barr, commander of the Nocturnal Maru.
Contact:

Re: Library

Post by CaptSolo » Thu Nov 03, 2016 11:29 pm

With Hyperradio.js I added .ogg filenames to the playList array and moved the .ogg files to the Music folder. How is this handled with Library 1.0?

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2365
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali » Fri Nov 04, 2016 12:56 pm

CaptSolo wrote:With Hyperradio.js I added .ogg filenames to the playList array and moved the .ogg files to the Music folder. How is this handled with Library 1.0?
To add a radio channel

Code: Select all

this.startUpComplete = function(){
	delete this.startUpComplete;
	worldScripts.Lib_Music._addChannel({name:"MyCustomChannel",radio:1,sounds:[
		{snd:"MyOXPTrack01.ogg",dur:240},
		{snd:"MyOXPTrack02.ogg",dur:223}
	]});
};
Custom channels are not automagically played, but you can activate them through Lib_Config (the setting is saved with your savedgame). It is possible to activate them via script, but this should be done only for missions to take over.

User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 886
Joined: Wed Feb 23, 2011 10:08 pm
Location: With Simona Barr, commander of the Nocturnal Maru.
Contact:

Re: Library

Post by CaptSolo » Fri Nov 04, 2016 8:56 pm

So, looking at your music demo, am I correct in assuming I need to code a separate OXP and then use Library's Config AddOn to get back the functionality I had with Hyperradio?

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2365
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali » Fri Nov 04, 2016 10:56 pm

It depends on what you really want .-)

The simplest way would be to add your files to the "generic" channel (as per demo). This channel (and "docking" and "fight") are automagically used and don't have to be activated through Lib_Config. The same is true for entity name channels (e.g. "Rock Hermit").

Custom radio channels on the other hand are meant to be used by music expansions, e.g. a Blues channel. Users can install a few and select what they want through Lib_Config. The activated channels are then cloned+merged into one playlist.

And yes, in all cases it needs an OXP which tells Lib_Music what to do.

User avatar
CaptSolo
---- E L I T E ----
---- E L I T E ----
Posts: 886
Joined: Wed Feb 23, 2011 10:08 pm
Location: With Simona Barr, commander of the Nocturnal Maru.
Contact:

Re: Library

Post by CaptSolo » Sun Nov 06, 2016 9:47 pm

Doing a little experimenting and I must say, Library and the new version of BGS rock!

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2365
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali » Mon Nov 07, 2016 7:29 pm

.-)

Just as sidenote: I really think that we are in dire need of a community driven library to aid AddOn-developers and players. If you take a look at available AddOns you can see that a lot of code goes into duplicated functionality and attempts to be compatible to other AddOns. What a waste.

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2365
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali » Fri Jul 07, 2017 3:13 pm

Library1.2 for current trunk is available -> Library1.2.oxp.zip (801.9 KB)

Changes:
- Solves issue 225 (thanks a_c and phkb)
- Added temporary freeze for $IDRules in Lib_GUI

User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 13554
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Library

Post by Cody » Mon Aug 07, 2017 1:18 pm

Latest trunk - 1.85.0.6988-170807-934bd29

Code: Select all

12:44:44.805 [WARNING]: Warning! Global namespace polluted by:
12:44:44.805 [WARNING]: ["getScreenBackgroundForKey","setScreenBackgroundForKey"]

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2365
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali » Mon Aug 07, 2017 5:57 pm

Cody wrote:
Mon Aug 07, 2017 1:18 pm
Latest trunk - 1.85.0.6988-170807-934bd29

Code: Select all

12:44:44.805 [WARNING]: Warning! Global namespace polluted by:
12:44:44.805 [WARNING]: ["getScreenBackgroundForKey","setScreenBackgroundForKey"]
Thanks Cody.-) I'll implement the new method names.

Post Reply