Library

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

Moderators: another_commander, winston

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

Re: Library

Post by Cody »

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: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali »

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: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali »

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: 891
Joined: Wed Feb 23, 2011 10:08 pm
Location: Hermit's Pipe
Contact:

Re: Library

Post by CaptSolo »

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: 13805
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Library

Post by Cody »

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: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali »

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: 891
Joined: Wed Feb 23, 2011 10:08 pm
Location: Hermit's Pipe
Contact:

Re: Library

Post by CaptSolo »

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: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali »

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: 891
Joined: Wed Feb 23, 2011 10:08 pm
Location: Hermit's Pipe
Contact:

Re: Library

Post by CaptSolo »

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: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali »

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: 891
Joined: Wed Feb 23, 2011 10:08 pm
Location: Hermit's Pipe
Contact:

Re: Library

Post by CaptSolo »

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: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali »

.-)

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: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali »

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: 13805
Joined: Sat Jul 04, 2009 9:31 pm
Location: Corke's Drift
Contact:

Re: Library

Post by Cody »

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: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Library

Post by Svengali »

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