Discussion and information relevant to creating special missions, new ships, skins etc.
Moderators: winston , another_commander
hiran
Theorethicist
Posts: 2403 Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...
Post
by hiran » Sat Jul 27, 2024 4:43 pm
I just died in my ship. Looks like I was rammed again by a Thargoid missile. To verify I opened the log and found lots of JavaScript errors. Here's an excerpt...
Code: Select all
18:34:27.804 [script.javaScript.exception.notDefined]: ***** JavaScript exception (oolite-starter-oxp 0.1): ReferenceError: sender is not defined
18:34:27.804 [script.javaScript.exception.notDefined]: AddOns/org.oolite.hiran.OoliteStarter.oxp/Config/script.js, line 395.
18:34:27.939 [script.javaScript.exception.notDefined]: ***** JavaScript exception (oolite-starter-oxp 0.1): ReferenceError: sender is not defined
18:34:27.939 [script.javaScript.exception.notDefined]: AddOns/org.oolite.hiran.OoliteStarter.oxp/Config/script.js, line 661.
18:34:27.939 [script.javaScript.stackTrace]: 0 (/home/hiran/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.Commander_McLane.Auto_Eject.oxz/Config/script.js:58) <anonymous function>
18:34:29.955 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (safetycatch 1.3): TypeError: m is undefined
18:34:29.955 [script.javaScript.exception.unexpectedType]: /home/hiran/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.Norby.SafetyCatch.oxz/Scripts/safetycatch.js, line 94.
18:35:06.154 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (<unidentified script>): TypeError: p.velocity is undefined
18:35:06.154 [script.javaScript.exception.unexpectedType]: /home/hiran/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.Gnievmir.VimanaHUD.oxz/Scripts/VimanaHUD.js, line 1009.
18:35:06.167 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (<unidentified script>): TypeError: p.velocity is undefined
18:35:06.168 [script.javaScript.exception.unexpectedType]: /home/hiran/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.Gnievmir.VimanaHUD.oxz/Scripts/VimanaHUD.js, line 1009.
18:35:06.181 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (<unidentified script>): TypeError: p.velocity is undefined
18:35:06.181 [script.javaScript.exception.unexpectedType]: /home/hiran/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.Gnievmir.VimanaHUD.oxz/Scripts/VimanaHUD.js, line 1009.
18:35:06.194 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (VimanaHUD 2.07): TypeError: p.fuel is undefined
18:35:06.194 [script.javaScript.exception.unexpectedType]: /home/hiran/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.Gnievmir.VimanaHUD.oxz/Scripts/VimanaHUD.js, line 473.
18:35:06.195 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (<unidentified script>): TypeError: p.velocity is undefined
18:35:06.195 [script.javaScript.exception.unexpectedType]: /home/hiran/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.Gnievmir.VimanaHUD.oxz/Scripts/VimanaHUD.js, line 1009.
18:35:06.207 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (useful_MFDs 0.6): TypeError: ship.fuel is undefined
18:35:06.207 [script.javaScript.exception.unexpectedType]: /home/hiran/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.zirael.UsefulMFDs.oxz/Config/script.js, line 93.
18:35:06.208 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (<unidentified script>): TypeError: p.velocity is undefined
Sunshine - Moonlight - Good Times - Oolite
Wildeblood
---- E L I T E ----
Posts: 2453 Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:
Post
by Wildeblood » Sat Jul 27, 2024 7:11 pm
It's a frame callback not ending on ship.died(), I will bet one dollar.
In your heart, you know it's flat.
phkb
Impressively Grand Sub-Admiral
Posts: 4830 Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.
Post
by phkb » Sun Jul 28, 2024 6:40 am
I regularly have to test crashing my ship, to make sure I've included the right tests in the right spots, to prevent these sorts of errors.
Basically, any reference to "player.ship" (or any of its properties) will fail if the player dies.
Cholmondely
Archivist
Posts: 5364 Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:
Post
by Cholmondely » Sun Jul 28, 2024 7:22 am
Wildeblood wrote: ↑ Sat Jul 27, 2024 7:11 pm
It's a frame callback not ending on ship.died(),
Thy eminence,
when I google "frame callback" I find nothing that seems to explain what it is.
Any chance of explaining to this dumb pilot... and also why it is important?
hiran
Theorethicist
Posts: 2403 Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...
Post
by hiran » Sun Jul 28, 2024 7:37 am
Cholmondely wrote: ↑ Sun Jul 28, 2024 7:22 am
Wildeblood wrote: ↑ Sat Jul 27, 2024 7:11 pm
It's a frame callback not ending on ship.died(),
Thy eminence,
when I google "frame callback" I find nothing that seems to explain what it is.
Any chance of explaining to this dumb pilot... and also why it is important?
Seems the big almighty Google is not all-knowing:
https://wiki.alioth.net/index.php?title ... back&go=Go
search.php?keywords=frame+callback
Sunshine - Moonlight - Good Times - Oolite
another_commander
Quite Grand Sub-Admiral
Posts: 6680 Joined: Wed Feb 28, 2007 7:54 am
Post
by another_commander » Sun Jul 28, 2024 8:01 am
And, because reading Jens' tech stuff sometimes feels like high level post-PhD physics, here is the one- sentence summary:
Frame callbacks are user-defined JavaScript functions that run on every single game frame update.
Cholmondely
Archivist
Posts: 5364 Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:
Post
by Cholmondely » Sun Jul 28, 2024 8:05 am
Thanks for this!
So there are only the two types of "animation" in Oolite then? Or have newer ones been added?
I'll have to have a look at Thargoid's
Frame Callback: Animation Demo - when I added it to the wiki I had no idea what it was about.
Wildeblood
---- E L I T E ----
Posts: 2453 Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:
Post
by Wildeblood » Sun Jul 28, 2024 9:29 am
Cholmondely wrote: ↑ Sun Jul 28, 2024 8:05 am
So there are only the two types of "animation" in Oolite then? Or have newer ones been added?
If you're alluding to
timers and
frame callbacks , then yes, two.
In your heart, you know it's flat.
hiran
Theorethicist
Posts: 2403 Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...
Post
by hiran » Sun Jul 28, 2024 9:50 am
Wildeblood wrote: ↑ Sun Jul 28, 2024 9:29 am
Cholmondely wrote: ↑ Sun Jul 28, 2024 8:05 am
So there are only the two types of "animation" in Oolite then? Or have newer ones been added?
If you're alluding to
timers and
frame callbacks , then yes, two.
I'd think of them rather as triggers than animations.
So on specific events (e.g. change in alert status), or when a frame is about to be rendered an OXP-defined function can be called.
Similarly a timer would call a user-defined function just because time has progressed.
The OXP defines the function but it is Oolite to call them when the specific event happens. That's why it is called 'callback' or 'event handler'.
Sunshine - Moonlight - Good Times - Oolite
another_commander
Quite Grand Sub-Admiral
Posts: 6680 Joined: Wed Feb 28, 2007 7:54 am
Post
by another_commander » Sun Jul 28, 2024 9:57 am
Yeah, animations are just one application of timers and/or frame callbacks.
Anything that requires accurately timed updates (or per-frame updates in the case of frame callbacks) can make use of them.