Page 1 of 4

Cabal_Common_Library

Posted: Thu Dec 09, 2010 11:57 am
by Svengali
Image

A while ago there was a discussion about functions libraries, but JS was new for nearly all of us. He - the situation has changed a little bit and OXPers are doing cool things in all kinds of flavours and we thought it's time... The Cabal_Common_Library is a collection of helpers and snippets and a documentation for OXP-Developers is available too.

A special thanks to Micha - your input and help was absolutely great and has improved it so much.

WIKI page - Cabal_Common_Library

Authors: Cmd.Cheyd, PhantorGorth and Svengali

Posted: Thu Dec 09, 2010 2:29 pm
by another_commander
Awesome job guys. Well done and I am sure that this library will be of great help to OXPers. I just browsed quickly through the documentation and I am very impressed with the potential for opportunities that are now opened to scripters.

Posted: Thu Dec 09, 2010 3:42 pm
by CaptKev
Nice work guys. Very professional

Posted: Thu Dec 09, 2010 8:44 pm
by Svengali
Thanks. And yes - it makes life a lot easier.

The documentation was (at least for me) the most difficult part and took a lot longer than writing the OXP, but in the end I'm pleased with it. And Michas pointers/questions and suggestions have led to a much higher quality in OXP and documentation.

Posted: Thu Dec 09, 2010 10:28 pm
by Commander McLane
That looks very interesting! I've only just downloaded it, so I can't yet say anything, but it looks very promising indeed! :D

Re: Cabal_Common_Library

Posted: Fri Feb 18, 2011 8:12 pm
by Svengali
Cabal_Common_Library1.1 is online.

Changes:

Cabal_Common_Functions
* .entGetScreenModel() marked as deprecated. Oolite v1.75 provides mission.displayModel.
* .pseudoRand() changed to Oolites v1.75 system.scrambledPseudoRandomNumber(n).
* .strScreenString() fixed.
* .strToWidth() behaviour changed to Oolites v1.75 new defaultFont.measureString(string).

Cabal_Common_Keyboard
* .start() changed. New optional parameters (scpic, scovl and scmod) added.
* .keyboard.model changed.
* .keyboard.modelSC added.
* .keyboard.pic changed.
* .keyboard.overlay added.

* Documentation updated

Re: Cabal_Common_Library

Posted: Fri Feb 18, 2011 8:39 pm
by Okti
Good work Svengali,

I will try to find out where it can be usefull.

As an example I always save my games as a number descending with every save. So I end up Commander 988889 in the mission screens rather than Commander Okti. If I can set my commander name rather than my save file name, this will be perfect. With 1.75 we have an event before saving a commander, I am not sure we have one after loading though?

Re: Cabal_Common_Library

Posted: Fri Feb 18, 2011 10:05 pm
by Svengali
Okti wrote:
As an example I always save my games as a number descending with every save. So I end up Commander 988889 in the mission screens rather than Commander Okti. If I can set my commander name rather than my save file name, this will be perfect. With 1.75 we have an event before saving a commander, I am not sure we have one after loading though?
Thanks Okti, but I can't follow you here.

Cabal_Common provides only some functions that are not that easy to code for JS-beginners, but does not change OXPs and native objects. Stripping a string in your own OXPs only needs a .substr(), .substring() or via Regexp

Code: Select all

var test = player.name;
var restA = test.replace(/[^a-zA-Z]/g,"");
var restB = test.substr(0,5);
log(this.name,"test: "+test+" and restA: "+restA+" and restB: "+restB);
And after loading we have .startUp() and usually this is enough. A special case is BGS - it has to stop the looped sound before the player loads a new savedgame. Otherwise it would still play and the script couldn't do anything anymore.

Re: Cabal_Common_Library

Posted: Thu Feb 24, 2011 8:57 pm
by Svengali
v1.2 is online.

Changes:
- Comms for missions (shipScript and worldScripts).
- Documentation updated.

Re: Cabal_Common_Library

Posted: Wed May 18, 2011 10:25 am
by Svengali
Cabal_Common_Library1.3 is online.

Changes:
- new method nBitsUsed()
- new method strDateFromMinutes() - Author: Commander McLane
- Documentation now online -> http://wiki.alioth.net/index.php/Category:OXPDoc

Special thanks to Commander McLane.

Re: Cabal_Common_Library

Posted: Wed May 18, 2011 1:00 pm
by Commander McLane
:) :D

Re: Cabal_Common_Library

Posted: Tue May 31, 2011 6:09 pm
by Svengali
Cabal_Common_Library1.4 is online.

Changes:
- Cabal_Common_Briefing.js - a set of tools for mission briefings.

A short demo is available too -> http://www.box.net/shared/v6ldutgl3l (331.1 KB)

Doc will follow.

Re: Cabal_Common_Library

Posted: Wed Jun 08, 2011 11:20 am
by Svengali
Cabal_Common_Library1.4.1 is online.

Changes:
- Briefing Demo simulates now laserfire and exhaust (both need shaders).

Re: Cabal_Common_Library

Posted: Tue Jul 12, 2011 5:14 pm
by Svengali
Cabal_Common_Library1.4.3 is online (he, v1.4.2 was only one day old)

Changes:
- new method mapCoordsDirection() - Author Eric Walch
- new method strNLZ()
- doc updated

Special thanks to Eric Walch .-)

Re: Cabal_Common_Library

Posted: Tue Jul 12, 2011 11:44 pm
by DaddyHoggy
Well done both!