Page 1 of 1

Debug OXP 1.72

Posted: Mon Nov 03, 2008 3:00 pm
by JensAyton
An updated version of the Debug OXP is available from EliteWiki.
This introduces some fancy new macros:
  • :nearest role — find nearest ship with specified role.
  • :tnearest role — target nearest ship with specified role.
  • :find expr — find entities matching expr; for example, “:find entity.isShip” to find all ships.
  • :findS expr — find ships matching expr; for example, “:find ship.scanClass == 'CLASS_BUOY'”.
  • :target expr — target closest ship matching expr.
The macros that “find” entities put their result in the variable result. :nearest produces a ship, while :find and :findS produce arrays of ships.

There are also new functions to control logging, but I appear to have forgotten to add convenience macros. The functions are:
  • console.displayMessagesInClass(class : String) : Boolean — true if log messages of the specified class are being logged, false otherwise.
  • console.setDisplayMessagesInClass(class : String, flag : Boolean) — enable or disable logging for the specified log message class.
For example, when the Debug OXP is installed, the legacy debugOn command can be simulated with “console.setDisplayMessagesInClass("$scriptDebugOn", true)”. If fiddling with log settings is your idea of fun, I suggest the following commands:

Code: Select all

:setM logOn console.setDisplayMessagesInClass(PARAM, true)
:setM logOff console.setDisplayMessagesInClass(PARAM, false)
…after which “:logOn $scriptDebugOn” will have the same effect.

There is also a new property console.debugFlags (and a corresponding menu item under Mac OS X). I don’t think this will be of any interest if you’re not hacking on Oolite, but there’s some documentation in oolite-debug-console.js.

Edit: Actually, enabling display of normals might be useful if you’re debugging lighting issues. “console.debugFlags ^= 0x100” will toggle normals.

Edit 2: Also, as per release notes, “Debug console now allows definitions to be split over several lines; for instance, you can type "this.test = function() {" on one line and "return 3: }" on the next. Enter an empty line to cancel multi-line input. Lines which are considered "incomplete" are echoed with a _ prefix instead of >. (Mac-only: the integrated console also supports multi-line input using option-return, as it always has.)”

Posted: Mon Nov 03, 2008 9:55 pm
by Thargoid
To add to the list I'm afraid, this doesn't seem to work for me either under WinXP and 1.72.

Using the same console as for 1.71.2 (is that right?) and the new OXP, I can't get the two to talk. In the log file I get the error below, basically the same as if the console isn't running.

Code: Select all

[debugTCP.disconnect]: Debug console disconnected with message Lost connection to remote debug console. Stream status: 7. Stream error: A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.


[debugTCP.connect.failed]: Failed to connect to debug console at 127.0.0.1:8563.

Posted: Mon Nov 03, 2008 10:23 pm
by JensAyton
Hmm. I thought we had that beat.

What OS?

Posted: Tue Nov 04, 2008 7:32 am
by Thargoid
Ahruman wrote:
Hmm. I thought we had that beat.

What OS?
Thargoid wrote:
...I'm afraid, this doesn't seem to work for me either under WinXP and 1.72.

Posted: Tue Nov 04, 2008 9:22 am
by JensAyton
Thargoid wrote:
Ahruman wrote:
Hmm. I thought we had that beat.

What OS?
Thargoid wrote:
...I'm afraid, this doesn't seem to work for me either under WinXP and 1.72.
Whut? Whut? Who stole my glasses, hmm? I’ll git you yet, you little whippersnappers!

Posted: Wed Nov 05, 2008 2:21 pm
by Thargoid
I make no comment, or you'll threaten me with that killAllThargoids script again ;) :lol:

Although I've just done a quick test with the debug OXP for 1.71, and that works with 1.72 (after a quick bit of adjustment in its requires.plist). At least as a temporary stop-gap solution until you've finished sorting the main code and have time for this bit.

Posted: Thu Nov 06, 2008 6:49 am
by Commander McLane
Noticed one change: The Create Ship... option now creates the ship close to the player (although in the dialogue box it still says "close to the station").

But I like it better this way, because it allows you to check things, wherever you currently are in the system.

Perhaps just change the text in the box.

Posted: Sun Nov 16, 2008 5:39 pm
by JensAyton
Commander McLane wrote:
Noticed one change: The Create Ship... option now creates the ship close to the player (although in the dialogue box it still says "close to the station").

But I like it better this way, because it allows you to check things, wherever you currently are in the system.
Oh yes, it now uses “system.legacy_addShipsWithinRadius('%@', 1, 'abs', player.ship.position, 10000)” (as seen in the console). This was definitely deliberate. :-) Dialog box corrected.

I actually came to this thread because I thought we’d had some progress on the console-not-working issue, but couldn’t remember what. Anyone?

Posted: Sun Nov 16, 2008 7:26 pm
by Thargoid
None that I know of (and it was me that first flagged it as problematic). Unless you include the going back to the v1.71 debug.oxp and that working with v1.72 (but without any of the updates for the new version of course).

Posted: Sun Nov 16, 2008 7:54 pm
by JensAyton
There isn’t really much in the debug OXP itself that can affect network connections. Are you sure you haven’t customized debugConfig.plist in your 1.71 version? :-)

Posted: Sun Nov 16, 2008 8:31 pm
by Thargoid
Not that I know of, unless it was part of the set-up.

I'll have a check and see if I can unbreak it (the 1.72 version).

Posted: Thu Dec 11, 2008 12:56 am
by JensAyton
Thargoid wrote:
I'll have a check and see if I can unbreak it (the 1.72 version).
Any luck?

Posted: Thu Dec 11, 2008 7:09 am
by Thargoid
Sorry, I got sidetracked from the thing that was sidetracking me from testing this.

Will try and add it somewhere to the OXP stack on my to-do list :oops:

Posted: Sun Dec 14, 2008 6:00 pm
by Thargoid
Ahruman wrote:
Thargoid wrote:
I'll have a check and see if I can unbreak it (the 1.72 version).
Any luck?
OK, just tried it with the new install of 1.72.1 and it seems to be working again (at least the two seem to be talking to one another).

No idea what was going weird before, as it's the same file of debug that was failing before (I'd stored it away for inspection). Personally I blame trained Trumble saboteurs... :oops: