With Oolite 1.75 there is the new frame callback available, allowing for some nice possibilities in animation.
I've been playing with this a little, and to aid my own understanding I've put together a small demo OXP (with the assistance of Ahruman and Eric Walch). It is available here.
Once installed, to activate it just launch from the main station (any system) and within 10 seconds target the nav buoy. Two test drones should be spawned, one on either side of the buoy. One uses the callback, and the other the old javascript timer way of doing animation as a comparison.
Aside from that it doesn't do anything but give an example to OXP makers - for me there are many interesting possibilities for new ships and features. Oh and be warned, watching the drones gets hypnotic after a while
As the first line above may suggest - requires Oolite 1.75 or higher to run.
Animation Demo OXP
Moderators: winston, another_commander
Animation Demo OXP
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Animation Demo OXP
Flying_Dutchman.oxp in version 1.6 contains an example for frame callback as well. I found it very useful for raising the ship temperature. The example actually combines frame callbacks and a standard timer, because I needed the timer to check if a certain temperature treshold has been reached.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Animation Demo OXP
Have you by any chance forgotten to remove the frame callback?
My log file is now 8MB filled with this message, and counting.
EDIT: I jumped out, which means the
By the way: what do all the '$' mean?
Code: Select all
Exception: TypeError: "use strict";this.ship.subEntities is undefined
aniDemo_script.js, line 51:
this.ship.subEntities[0].position = this.ship.subEntities[0].vectorForward.multiply(offset);
EDIT: I jumped out, which means the
shipDied
handler wasn't triggered. Better to add = this.playerWillEnterWitchspace
.By the way: what do all the '$' mean?
Re: Animation Demo OXP
To show that they are custom properties, not built-in ones (to make it clear and remove the chance of namespace pollution) - it was one of Ahruman's requests.
With regard to jumping out, I will update the OXP for that. I must admit this is the one part of the frame callback I'm not fully convinced of yet, as I can see one or two other scenarios where problems may occur.
An updated version including the callback removal on player jumping is now uploaded.
With regard to jumping out, I will update the OXP for that. I must admit this is the one part of the frame callback I'm not fully convinced of yet, as I can see one or two other scenarios where problems may occur.
An updated version including the callback removal on player jumping is now uploaded.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Animation Demo OXP
Thargoid wrote:To show that they are custom properties, not built-in ones (to make it clear and remove the chance of namespace pollution) - it was one of Ahruman's requests.
Ah! So that is something we all should generally do?
As I'm in the process of OXP-updating that's something I could implement now—at least for the OXPs I still have to update in the current roll call.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: Animation Demo OXP
Yes. (The built-in scripts actually use underscores instead, but Kaks pointed out that dollar signs are more idiomatic in JavaScript. Either is fine by me, but note that there are a few special properties identified by double underscores used by SpiderMonkey and Oolite.)Commander McLane wrote:Ah! So that is something we all should generally do?
E-mail: [email protected]