Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

A few "simple" questions...

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

Moderators: winston, another_commander

Post Reply
User avatar
Phasted
Competent
Competent
Posts: 51
Joined: Wed Jun 09, 2010 3:56 pm

A few "simple" questions...

Post by Phasted »

Copied from the Oolite Wiki JS reference:
scriptInfo
scriptInfo : Object (read-only)
The contents of the script_info key in the ship’s shipdata.plist entry, if any. This may be any property list object, but the reccomended approach is to use a dictionary whose keys have a unique prefix (such as you should be using for file names, ship names etc.). A property list dictionary is converted to a JavaScript object with properties corresponding to the dictionary’s keys. All other property list types used with Oolite have directly corresponding JavaScript types.
"...directly corresponding JavaScript types"??

1.) Does this mean that Oolite property lists are (oh please oh please oh please) scriptable objects?

2.) If they are scriptable objects, where [** panting and drooling **] might these objects be located, in the grand scheme of the Oolite object hierarchy?

3.) If I wanted [and I do...] a turret that sports a WEAPON_MILITARY_LASER rather than a WEAPON_PLASMA_CANNON, how would I go about it?

4.) Is it possible to call AI methods directly from JavaScript?

5.) What does "in trunk" mean??
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: A few "simple" questions...

Post by JensAyton »

Phasted wrote:
"...directly corresponding JavaScript types"??
For example, a plist string is translated into a JavaScript string, an plist array into a JavaScript array etc.
Phasted wrote:
Does this mean that Oolite property lists are (oh please oh please oh please) scriptable objects?
No.
Phasted wrote:
Is it possible to call AI methods directly from JavaScript?
No (well, you can when the debug OXP is installed, but obviously you can’t rely on that in an OXP). What you can do is use a sequence of setAI(), sendAIMessage() and exitAI().
Phasted wrote:
What does "in trunk" mean??
“trunk” is the current mainline development version.
Post Reply