Page 2 of 2

...

Posted: Thu Sep 11, 2008 10:24 am
by Lestradae
pagroove wrote:
On a side note: I also made a new breakpattern.ogg
You hear the tunnel and it's quite cool. If anyone wants to have then let me know.
Hi pagroove :D

I would like to have it!

Posted: Thu Sep 11, 2008 5:23 pm
by pagroove
I'il give you the link this weekend. This evening I get visitors. (no not the Abba LP) 8)

Posted: Thu Sep 11, 2008 5:24 pm
by Thargoid
As promised, a proposal for a v0.2 script below. This one should be fully compatible with OXPConfig too. Here I've given examples of each functionality as detailed in the script header.

At the moment the logging just lists where the player witchspaces into (galaxy, planet name and number) and when music is played. Again it should give you an idea of code lay-out, but by all means change or remove the switches ;)

I've tested it as far as I can, but of course I don't have the music. As it's not yet built into OXPConfig (talk to Svengali about that), my tests were via the JS console and the worldScripts command (worldScripts ["Famous Planets Launch Script"].logging = true and variations thereon).

Code: Select all

this.name = "Famous Planets Launch Script"; 
this.author = "PAGroove and Thargoid"; 
this.copyright = "© 2008 the Oolite team."; 
this.description = "Play selected music files and displays greetings when the player witchspaces into or undocks from the main station in a Famous Planet system."; 
this.version = "0.2"; 

/* this.logging, this.audio, this.extraA and this.extraB are for compatability with OXPConfig.oxp.

	this.logging - turns logging to stderr.txt and JSConsole on and off (off by default).
	this.audio - turns the tunes at witchspace entry and undocking from the main station in FP locations on and off (on by default).
	this.extraA - turns on/off welcome console messages after witchspace arrival in FP location (on by default).
	this.extraB - turns on/off departure console messages main station undocking in FP location (on by default).
*/

this.startUp = function()
{
	this.logging = false; this.audio = true; this.extraA = true; this.extraB = true;
}

this.shipExitedWitchspace = function() 
	{ 
	if(this.logging) {log("Player in galaxy " + (galaxyNumber+1) + "  at " + system.name + " (" + system.ID + ")."); };
	if(galaxyNumber == 0) 
		{ 
		switch(system.ID) 
			{ 
			case 7: 
				{ 
				if(this.audio) {Sound.playMusic('LaveWitch.ogg'); } else {Sound.stopMusic(); };
				if(this.logging && this.audio) {log("Playing Lave witchspace music."); };
				if(this.extraA) {player.consoleMessage("Welcome to " + system.name + " Commander " + player.name) };
				break; 
				} 
			case 147: 
				{ 
				if(this.audio) {Sound.playMusic('DisoWitch.ogg'); } else {Sound.stopMusic(); };
				if(this.logging && this.audio) {log("Playing Diso witchspace music."); };
				if(this.extraA) {player.consoleMessage("Welcome to " + system.name + " Commander " + player.name) };
				break; 
				} 
			case 246: 
				{ 
				if(this.audio) {Sound.playMusic('TianveWitch.ogg'); } else {Sound.stopMusic(); };
				if(this.logging && this.audio) {log("Playing Tianve witchspace music."); };
				if(this.extraA) {player.consoleMessage("Welcome to " + system.name + " Commander " + player.name) };
				break; 
				} 
			} 
		} 
	} 

this.shipLaunchedFromStation = function() 
	{ 
	if(galaxyNumber == 0 && system.mainStation) 
		{ 
		switch(system.ID) 
			{ 
					case 7: 
				{ 
				if(this.audio) {Sound.playMusic('LaveLaunch.ogg'); } else {Sound.stopMusic(); };
				if(this.logging && this.audio) {log("Playing Lave launch music."); };
				if(this.extraB) {player.consoleMessage("We hope you enjoyed " + system.name + " station Commander " + player.name) };
				break; 
				} 
			case 147: 
				{ 
				if(this.audio) {Sound.playMusic('DisoLaunch.ogg'); } else {Sound.stopMusic(); };
				if(this.logging && this.audio) {log("Playing Diso launch music."); };
				if(this.extraB) {player.consoleMessage("We hope you enjoyed " + system.name + " station Commander " + player.name) };
				break; 
				} 
			case 246: 
				{ 
				if(this.audio) {Sound.playMusic('TianveLaunch.ogg'); } else {Sound.stopMusic(); };
				if(this.logging && this.audio) {log("Playing Tianve launch music."); };
				if(this.extraB) {player.consoleMessage("We hope you enjoyed " + system.name + " station Commander " + player.name) };
				break; 
				} 
			} 
		} 
	} 

Posted: Thu Sep 11, 2008 10:45 pm
by Svengali
Thargoid wrote:
I've tested it as far as I can, but of course I don't have the music. As it's not yet built into OXPConfig (talk to Svengali about that), my tests were via the JS console and the worldScripts command (worldScripts ["Famous Planets Launch Script"].logging = true and variations thereon).
For adding it into OXPConfig I need a fixed script-name (e.g. this.name = "Famous Planets") and a short description for the switches. Then it's done within 3 minutes :-) I'm already planning the next version, so it is better to wait till pagroove has released his next version.

But if you want to test it with your script, just open decriptions.plist and set OXPCONFIG_OVERALLB to 3

Code: Select all

OXPCONFIG_OVERALLB = "3";
add

Code: Select all

	OXPCONFIG2_INFO0 = "Famous Planets Launch Script";
	OXPCONFIG2_INFO1 = "15";
	OXPCONFIG2_INFO2 = "Audio - Switch on/off music in FP systems\nExtraA - Switch on/off exiting witchspace message in FP systems\nExtraB - Switch on/off launching message in FP systems";
In missiontext.plist add Famous Planets to line 23

Code: Select all

OXPCONFIG_PAGEA2 = "Configure Famous Planets";
That's it. And you don't have to use all switches to be fully compatible :-) The script checks if a switch is declared or not, even if the database says that all switches should be used.