DebugConsole questions

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2028
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

DebugConsole questions

Post by maik »

I'm trying to understand what I can do via the DebugConsole, but fail at this: dumpObject(player.ship) gives me more ship data (e.g. I get player.ship.speed here) than JSON.stringify(player.ship), player.ship.speed is missing here. Where does dumpObject get the additional information from, or why is it missing if I stringify player.ship?

Is there documentation on what I can access via the DebugConsole?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: DebugConsole questions

Post by another_commander »

maik wrote: Mon Feb 08, 2021 7:39 pm
Is there documentation on what I can access via the DebugConsole?
The best documentation on what can be accessed via the Debug Console is the source code itself. You want to look into src/Core/Scripting. Every JS class' methods and properties are listed there, with comments explaining their type, whether they are read only or read/write and with a description of the parameters in case of methods.

As for dumping objects, I don't know the difference between dumpObject and stringify, but I almost always use the :d macro, which expands to dumpObject and is guaranteed to serve the entire object dictionary every itme.
Post Reply