Split: viewDirectionChanged woes
Moderators: winston, another_commander
- 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.
Re: Split: viewDirectionChanged woes
Is anything showing up in your "latest.log" file? If everything is working OK, you should see your OXP name in the list of loaded OXP's. If there's a problem you could see a Javascript error or a message indicating a problem reading a plist file.
-
- Average
- Posts: 13
- Joined: Sat Jun 20, 2015 1:06 am
Re: Split: viewDirectionChanged woes
cheers, looking into it now.
10:34:31.967 [script.javaScript.exception.curlyAfterBody]: ***** JavaScript exception (view.myship.js.anon-script): SyntaxError: missing } after function body
10:34:31.968 [script.javaScript.load.failed]: ***** Error loading JavaScript script ../AddOns/myship.oxz/Scripts/view.myship.js -- compilation failed
10:34:31.968 [script.load.notFound]: ***** ERROR: Could not find script file view.myship.js.
-
- Average
- Posts: 13
- Joined: Sat Jun 20, 2015 1:06 am
Re: Split: viewDirectionChanged woes
Fixed that last one...
now this:
should I try dumping all my extra addons and try with vanilla oolite?
now this:
Still no change in the views... grrrr.14:19:39.664 [LogEvents]: Player launched from Coriolis Station 25176
14:19:39.672 [Total_patrol]: Adding additional police.
14:19:39.680 [Total_patrol]: Adding additional police.
14:19:40.976 [LogEvents]: Player VIEW_AFT
14:19:41.528 [script.javaScript.unrootedTimer]: ----- WARNING: Timer <OOJSTimer 0x251071b0>{nextTime: 9.075, one-shot, running, function: anonymous} is being garbage-collected while still running. You must keep a reference to all running timers, or they will stop unpredictably!
14:19:41.528 [script.javaScript.unrootedTimer]: ----- WARNING: Timer <OOJSTimer 0x25109f10>{nextTime: 9.075, one-shot, running, function: anonymous} is being garbage-collected while still running. You must keep a reference to all running timers, or they will stop unpredictably!
14:19:41.528 [script.javaScript.unrootedTimer]: ----- WARNING: Timer <OOJSTimer 0x251053b0>{nextTime: 9.075, one-shot, running, function: anonymous} is being garbage-collected while still running. You must keep a reference to all running timers, or they will stop unpredictably!
14:19:41.528 [script.javaScript.unrootedTimer]: ----- WARNING: Timer <OOJSTimer 0x3312aa70>{nextTime: 8.554, one-shot, running, function: anonymous} is being garbage-collected while still running. You must keep a reference to all running timers, or they will stop unpredictably!
14:19:41.528 [script.javaScript.unrootedTimer]: ----- WARNING: Timer <OOJSTimer 0x33127ef0>{nextTime: 8.554, one-shot, running, function: anonymous} is being garbage-collected while still running. You must keep a reference to all running timers, or they will stop unpredictably!
14:19:41.528 [script.javaScript.unrootedTimer]: ----- WARNING: Timer <OOJSTimer 0x33111930>{nextTime: 8.554, one-shot, running, function: anonymous} is being garbage-collected while still running. You must keep a reference to all running timers, or they will stop unpredictably!
14:19:41.863 [LogEvents]: Player VIEW_PORT
14:19:42.281 [LogEvents]: Player VIEW_STARBOARD
14:19:43.167 [LogEvents]: Player VIEW_FORWARD
should I try dumping all my extra addons and try with vanilla oolite?
Re: Split: viewDirectionChanged woes
Yes. And you might want to get the developer release. It gives more detailed error information.BladeRunner wrote:should I try dumping all my extra addons and try with vanilla oolite?
-
- Average
- Posts: 13
- Joined: Sat Jun 20, 2015 1:06 am
Re: Split: viewDirectionChanged woes
cool, will give it a go, thanks for the help...
Re: Split: viewDirectionChanged woes
Hmmm. This won't work. Apart from that missing, bracket you've corrected, you're first checking thatBladeRunner wrote:Code: Select all
this.name = "view-myship"; this.author = "BR"; this.copyright = "Creative Commons: attribution, non-commercial, sharealike."; this.description = "Ship's HUD View"; this.version = "1.0"; this.viewDirectionChanged = function(viewString) { if (viewString === "VIEW_CUSTOM") { var p = player.ship; switch (viewString) { case "VIEW_FORWARD": p.hud = "myship-hud-fore.plist"; break; case "VIEW_AFT": p.hud = "myship-hud-aft.plist"; break; case "VIEW_PORT": p.hud = "myship-hud-port.plist"; break; case "VIEW_STARBOARD": p.hud = "myship-hud-star.plist"; break; } }
viewString
is "VIEW_CUSTOM"
and then you're checking cases where viewString
is "VIEW_FORWARD"
, "VIEW_AFT"
, "VIEW_PORT"
or "VIEW_STARBOARD"
. That naturally does not work. Drop that "VIEW_CUSTOM"
check and it should work.-
- Average
- Posts: 13
- Joined: Sat Jun 20, 2015 1:06 am
Re: Split: viewDirectionChanged woes
nailed it, thanks!
-
- Average
- Posts: 13
- Joined: Sat Jun 20, 2015 1:06 am
Re: Split: viewDirectionChanged woes
If you could be so kind as to point me in the right direction for hiding the custom hud screens when viewing the manifest (etc) in flight and the fore hud when docked?
Cheers.
Cheers.
- 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.
Re: Split: viewDirectionChanged woes
In your switch statement, add
and then you can decide what you want to do, possibly switching to a another HUD that is designed for use with the GUI screens (like the manifest).
For the docked HUD, you can either add HUD elements with the "alertCondition" set to 1 (docked), and make sure all the other elements have their "alertCondition" set to 14 (status green, yellow and red); or you can create a docked HUD that just has the elements you want, and switch to it like you're doing with the other view directions.
Does that make sense?
Code: Select all
case "VIEW_GUI_DISPLAY":
For the docked HUD, you can either add HUD elements with the "alertCondition" set to 1 (docked), and make sure all the other elements have their "alertCondition" set to 14 (status green, yellow and red); or you can create a docked HUD that just has the elements you want, and switch to it like you're doing with the other view directions.
Does that make sense?
-
- Average
- Posts: 13
- Joined: Sat Jun 20, 2015 1:06 am
Re: Split: viewDirectionChanged woes
cheers, will look into it soon and get back if there are issues.
Again, thanks for your help with this.
Again, thanks for your help with this.