Page 1 of 1

How to build a mission?

Posted: Thu Jun 30, 2011 7:33 pm
by Dragonfire
Okay, I'm totally confused, and I can't make heads or tails of the wiki on this matter. How exactly does one build a mission OXP? I want to write one for the Wyvern OXP I'm working on, but I don't know how to get started.

I kinda need a quick step-by-step (tho a link would help, too). Just note, the wiki guide on how to write OXPs is not helping me.

Re: How to build a mission?

Posted: Thu Jun 30, 2011 7:39 pm
by Thargoid
How are your Javascript skills? Missions are mainly handled by scripts.

The best way to understand them is to look over the existing ones and see if you can follow how they work. For a first look I'd recommend reviewing the scripts for the built-in trunk missions. They are relatively simple and should give you an idea of how things go together.

Re: How to build a mission?

Posted: Thu Jun 30, 2011 7:41 pm
by Dragonfire
My javascript skills are non-existent, but I've been known to learn programming and scripting languages within a one to two week period. If I learn that, then I should be able to make sense of the existing mission OXPs.

Out of curiosity, are there any alternate scripting languages that could be used in place of a .js? I DO know VBScript and Python. Just thought I'd ask.

Re: How to build a mission?

Posted: Thu Jun 30, 2011 7:46 pm
by Thargoid
No, the OXP scripts are in Javascript (Spider Monkey JS from the recent version of Mozilla Firefox iirc).

There is the older XML-type scripts as well (I forget the proper name of it), but they are much less capable as to what you can do.

JS isn't that complex (especially with the wiki as a reference guide), and several of us can help you along if you get stuck. Plus you have many examples to go along with as templates.

Re: How to build a mission?

Posted: Thu Jun 30, 2011 7:47 pm
by Dragonfire
You have just given me great courage. :P I'll start on that tonight, hopefully (after I get some of my REAL programming work done).

Re: How to build a mission?

Posted: Fri Jul 01, 2011 4:28 am
by Capt. Murphy
Dragonfire, as a non programmer (but also someone who picks things up reasonably quickly),
I found the site below a useful resource for basic JS syntax, use of inbuilt objects (Math.random() and the like) etc. The examples are geared towards web scripting, but make the syntax easy to understand.

http://www.w3schools.com/js/js_intro.asp

Coupled with poring over other people's work and the wiki documentation that got me going.
As far as the Wiki documentation goes making sure you understand the use of the event handlers as it's these that kick off the relevant parts of your script at the right time.

http://wiki.alioth.net/index.php/Oolite ... _reference
http://wiki.alioth.net/index.php/Oolite ... t_handlers

And for what aspects of the game engine you can interact with and change via script.

http://wiki.alioth.net/index.php/Oolite ... ject_model

These pages are constantly open whilst I'm writing script.....i.e. you'll use them a lot.

I would suggest starting of with a simple idea, get it working and then go on to something more complex.