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?
DebugConsole questions
Moderators: winston, another_commander, Getafix
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
Re: DebugConsole questions
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.