Suggested updates to Wiki JS info.

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Suggested updates to Wiki JS info.

Post by Capt. Murphy »

Morning,

Do peeps think it's about time to update the scripting section of the Wiki?

I'm thinking that on http://wiki.alioth.net/index.php/OXP_how to the A preview of things to come section is misleading for someone new to Oolite/OXPing as JS is now the preferred and main scripting method, and this page needs updating to make that clear.

Also do you think a relatively non-technical beginners/laymans guide to JS scripting in Oolite would be useful? Linked to from http://wiki.alioth.net/index.php/Script ... JavaScript

I'm thinking of a single page that explains the different kinds of script (world, ship and activated equipment), and the basic structure of a script as a serious of event-handler or self defined functions, an overview of the different variable types, when it is appropriate to use/not use them, and naming issues, plus a brief guide to JS syntax and some of the common JS commands, loops, switches etc.

I'd be happy to do an initial draft having been in a totally clueless beginner's shoes not so long ago.

I think the event handler pages should be either recombined, but with 3 sections or split into 3 - worldscript event handlers only, world and shipscript event handlers and shipscript only event handlers.

Finally some of the event handlers and properties/methods on the objects pages could do with more examples of their use.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: Suggested updates to Wiki JS info.

Post by Kaks »

All worthy stuff, as far as I can see! :)

Documentation has traditionally always been the weak spot of projects everywhere, so any update/clarification is always welcome...

About the event pages, three pages sounds sensible to me, after all, avoiding duplication avoids making & correcting the same mistakes twice...

Just my 2p worth! ;)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Suggested updates to Wiki JS info.

Post by Eric Walch »

Svengali also made a good start with an introduction. But at the moment I can't find it on the wiki.

And there are a large number of pages that only present core AI files, without any explanation. Everyone can find those files in oolite itself. And most are quite old and very different than the current versions. I better remove them all.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Suggested updates to Wiki JS info.

Post by Capt. Murphy »

Would you prefer I post any suggested revisions/additions I make here in full first or edit the wiki and post a link to the revised/new page here so it can be checked and easily undone if necessary?
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Suggested updates to Wiki JS info.

Post by Svengali »

Good ideas. I think this will be a big help for new OXPers.
Eric Walch wrote:
Svengali also made a good start with an introduction. But at the moment I can't find it on the wiki.
Oops. You mean the JS-Tut for Oolite I've started nearly 2 years ago and then forgotten? It was never on the WIKI and Ahruman would slap me with a big stick if I would place it there, because it contained a lot of nonsense .-)
Capt. Murphy wrote:
Finally some of the event handlers and properties/methods on the objects pages could do with more examples of their use.
I think a link to example pages will be better, as it keeps the docs itself short. You can see what happens if too much examples are placed in my own docs and someday I'll go and clean up.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Suggested updates to Wiki JS info.

Post by Capt. Murphy »

http://wiki.alioth.net/index.php/OXP_howto

I've changed A preview of things to come

to
Scripting with JavaScript

For current test releases (Oolite 1.75.x and above) JavaScript is the preferred scripting interface for worldScripts and shipScripts. The legacy scripting interface (see script.plist) is still supported. See Scripting Oolite with JavaScript for more information.
Also created a new page http://wiki.alioth.net/index.php/Variab ... _Variables which is linked to from http://wiki.alioth.net/index.php/Script ... t#See_Also
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Post Reply