Debug OXP 1.72

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Debug OXP 1.72

Post 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.)”
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Hmm. I thought we had that beat.

What OS?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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!
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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.
User avatar
Commander McLane
---- E L I T E ----
---- 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:

Post 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.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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).
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post 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? :-)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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).
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Thargoid wrote:
I'll have a check and see if I can unbreak it (the 1.72 version).
Any luck?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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:
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post 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:
Post Reply