Page 18 of 117

Posted: Tue Aug 11, 2009 12:47 pm
by Commander McLane
Thargoid wrote:
Commander McLane wrote:
saint wrote:
One question. Is it possible to have a ship bound to a character and have that character unique (that is, you can meet him until he's alive)?
This is a bit creepy, you know. :shock:
Says the Commander who wrote the Flying Dutchman ;)
Well, yeah :lol: ; but the Flying Dutchman is more a case of was-once-alive than hasn't-yet-been-alive.

*** static noise ***

Posted: Tue Aug 11, 2009 1:42 pm
by saint
Hmmm.... Unlive edible poets...

Btw, as for the Flying Dutchman, do i need oolite>1.65 ho have working turrets ?

Posted: Tue Aug 11, 2009 1:54 pm
by Commander McLane
saint wrote:
Btw, as for the Flying Dutchman, do i need oolite>1.65 ho have working turrets ?
Hmm, although I don't see the connection between the Dutchman and turrets; if you are talking about working turrets for player ships, and about really working, as in: without any issues, you would need at least the current trunk version, and even that wouldn't be really working.

If you just want to try out turrets on your ship (at your own risk), you need the latest test release 1.72.2.

Posted: Mon Aug 24, 2009 11:08 am
by Eric Walch
I just noticed that apple has changed the syntax rules for plist's in OSX 10.5. It is now compatible with the rule as used on windows:

Every element of an array ends now with an ,:

Code: Select all

(
    element1,
    element2,
    element3,
)
or

Code: Select all

(
   {
   },
   {
   },
   {
   },
)
Specially the last , in an array was allowed with windows but not with OSX 10.4. This sometimes resulted in code readable by windows but not on a mac.

I just noticed that the mac plist editor that ships with OSX 10.5, now always ends the elements in an array with a , as shown in my examples above. (No preferences to put it off to save it in a way as it was before).

This means code saved with this editor will be unreadable on Mac OSX 10.4 (tiger) or earlier! Be warned for those that write oxp's on a mac.

Posted: Mon Aug 24, 2009 10:04 pm
by wackyman465
What's the mac .plist editor? I've got leopard but haven't seen it, and I just use textedit.

Posted: Mon Aug 24, 2009 11:27 pm
by JensAyton
It goes by the clever secret code name “Property List Editor”. It’s installed with Xcode.

Posted: Tue Aug 25, 2009 3:00 am
by wackyman465
ooh.. and there was me using a demo vers of plist edit pro... well I'll put that on as soon as I get back to where my OSX install disc is.

Posted: Tue Aug 25, 2009 7:18 am
by Eric Walch
wackyman465 wrote:
ooh.. and there was me using a demo vers of plist edit pro....
After noticing that the current macs plist editor generates a plist that probably generates errors with older Mac OS, I also used plist edit pro. That still saves in a way old macs and windows can read the plists.

Posted: Tue Aug 25, 2009 6:54 pm
by Cmd. Cheyd
This is probably Easy-As-Dirt™, but how can I toggle a variable within one OXP's script from a second OXP's script?

Code: Select all

OXP_A
.....Script.js
..........Var Foo = False;

OXP_B
.....Script.js
..........Oxp_A.Script.Foo = True;
[/i]

Is it a simple issue of using:

Code: Select all

OXP_A
.....Script.js
..........This.Foo = False;

OXP_B
.....Script.js
..........This.Foo = True;
[/i]

Posted: Tue Aug 25, 2009 6:56 pm
by wackyman465
Eric Walch wrote:
wackyman465 wrote:
ooh.. and there was me using a demo vers of plist edit pro....
After noticing that the current macs plist editor generates a plist that probably generates errors with older Mac OS, I also used plist edit pro. That still saves in a way old macs and windows can read the plists.
I don't mind just using textedit anyway..

Posted: Tue Aug 25, 2009 7:05 pm
by Thargoid
Cmd. Cheyd wrote:
This is probably Easy-As-Dirt™, but how can I toggle a variable within one OXP's script from a second OXP's script?

Code: Select all

OXP_A
.....Script.js
..........Var Foo = False;

OXP_B
.....Script.js
..........Oxp_A.Script.Foo = True;
[/i]

Is it a simple issue of using:

Code: Select all

OXP_A
.....Script.js
..........This.Foo = False;

OXP_B
.....Script.js
..........This.Foo = True;
[/i]
worldScripts["<script name here>"].<variable> is your man, where the script name is what you define at the top of the script using this.name.

So if your script has this.name = "Black Hole OXP Script" containing a variable eventHorizon, then from a second worldScript you can test for and change the variable using worldScripts["Black Hole OXP Script"].eventHorizon.

You can also use this to check if the script exists in the first place, using if(worldScripts["<script name here>"]), that being true if the script is loaded...

Where I say variable above, it can be any parameter of the script, such as a timer or a function as well (the this. in many script commands can be thought of as a shortcut for a worldScript call to the script that the command is within).

Posted: Wed Sep 02, 2009 10:53 am
by Svengali
Is it possible for a script to determine if a machine has shader support and if the player has enabled it?

Posted: Wed Sep 02, 2009 10:58 am
by ovvldc
Ahruman wrote:
It goes by the clever secret code name “Property List Editor”. It’s installed with Xcode.
And if you do not want to install Xcode, ask someone who has it installed Xcode to zip it and send it to you - Property List Editor doesn't depend on Xcode.

Posted: Wed Sep 02, 2009 7:24 pm
by Frame
Svengali wrote:
Is it possible for a script to determine if a machine has shader support and if the player has enabled it?
No

We cannot access information in regard to a graphics card abilities from Oolite Java scripting

And

as far as I know, we cannot access player settings either...

I would suspect such a value to be found

in Oojsoolite.m

relevant section here...

Code: Select all

static JSPropertySpec sOoliteProperties[] =
{
	// JS name					ID							flags
	{ "version",				kOolite_version,			JSPROP_PERMANENT | JSPROP_ENUMERATE | JSPROP_READONLY },
	{ "versionString",			kOolite_versionString,		JSPROP_PERMANENT | JSPROP_ENUMERATE | JSPROP_READONLY },
	{ "jsVersion",				kOolite_jsVersion,			JSPROP_PERMANENT | JSPROP_ENUMERATE | JSPROP_READONLY },
	{ "jsVersionString",		kOolite_jsVersionString,	JSPROP_PERMANENT | JSPROP_ENUMERATE | JSPROP_READONLY },
	{ 0 }
};
However, Oolite should take care of all the shading specific things for you..
when enabled and when not.

Posted: Wed Sep 02, 2009 9:10 pm
by zevans
But... you can make ships that fall back to different textures if shaders aren't available, if I remember a similar discussion correctly... would that fix whatever it is you're trying to do?