Page 1 of 1

A few "simple" questions...

Posted: Sat Mar 12, 2011 4:39 pm
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??

Re: A few "simple" questions...

Posted: Sat Mar 12, 2011 6:25 pm
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.