Page 1 of 2

jsdebug

Posted: 04 Feb 2013, 02:48
by aubergine
Loving the stuff being done on jsdebug. :)

I was wondering if JS API could get access to GUI functions for creating dialog boxes similar to that used by jsdebug? Initially just ability to create a window, add some tabs, panels, lists, buttons, etc., and have events for when selection changes, button clicks, etc.

I believe we could create much more advanced debug via script, including custom addon's that are script-specific, such as running unit tests or diagnostics within the script, listing chat commands, and so on.

I'd also like to have much more comprehensive reporting about the global scope and the global object, including non-enumerable properties, property descriptor objects, more accurate reporting of data types, improved rendering of data, ability to browse functions (possibly even with a syntax-highlighting editor) and so on.

It's possible the dialogs could be used in custom campaigns, for example to show a list of mission objectives and their current status.

Re: jsdebug

Posted: 04 Feb 2013, 03:06
by Goth Zagog-Thou
Or even integrate it into Emdek's Map Editor. :D

I'd love for one of our map editors to be able to do campaign stuff in a visual fashion. I know I'm kicking a rabbit hole but Star Trek Armada II's built-in map & mission editing capabilities were nothing short of awesome.

Re: jsdebug

Posted: 04 Feb 2013, 03:09
by aubergine
Well, yes, that too. Although I'd love the map editor to be in the game so I can see exactly how things look and try things out in realtime, with script debugger and entire game environment 100% warzone.

Re: jsdebug

Posted: 04 Feb 2013, 03:11
by Goth Zagog-Thou
Just like Armada II. ;) That's exactly how that one works.

Re: jsdebug

Posted: 04 Feb 2013, 03:22
by Goth Zagog-Thou
Okay, so I've got Master and we're running with --debug=script. How does one call up the jsdebug window?

Re: jsdebug

Posted: 04 Feb 2013, 04:40
by aubergine
go in to cheat mode, then enter cheat code "jsdebug"

Re: jsdebug

Posted: 04 Feb 2013, 20:01
by Goth Zagog-Thou
Excellent, thanks. ^_^

Re: jsdebug

Posted: 04 Feb 2013, 20:12
by aubergine
There's loads of other cheat codes useful for developers: scroll to developer section

The "damage me" code is useful to check units retreat, etc.

Re: jsdebug

Posted: 04 Feb 2013, 20:20
by Per
Yet another new cheat: 'jsload'. It pops up a file dialog (pausing the game while the dialog is up - very bad form in MP!) and allows you to load any AI script you want from the 'scripts' directory in your write directory to run on the current player. New script global 'scriptPath' holds the path to whereever you loaded the script from, and is used automatically for include files. There is no longer any need to specify any paths for include files if they are located in the same directory as your main script.

The events 'eventGameInit' and 'eventStartLevel' are immediately called on the loaded script.

This is basically an 'autogame' that works with qtscript.

Re: jsdebug

Posted: 04 Feb 2013, 20:35
by Goth Zagog-Thou
Nice. Is that in today's Master build?

Had a go with jsdebug and it seems very useful indeed. :)

Now to get cam 4 ported over ...

I do have a question about csv2ini -- can't seem to get it working in a browser. Is it meant to be a commandline tool? And yes, I have php installed on my 'nix install.

Re: jsdebug

Posted: 04 Feb 2013, 20:40
by NoQ
See readme.txt in the same folder.
No, browsers aren't supposed to understand php.

Also, yay.

Also, doesn't compile (false instead of NULL in a couple of places, i think).

Re: jsdebug

Posted: 04 Feb 2013, 21:54
by Goth Zagog-Thou
Looks like I'll be doing this manually. :(

I don't have the patience to deal with difficult-to-use tools today.

Re: jsdebug

Posted: 04 Feb 2013, 22:18
by aubergine
With jsload does it load in to currently selected player, or only player 0? For example, could I use old debug menu to switch to different player then jsload a new script for that player?

Also, I imagine jsload type thing could be used in multiplayer games if a player quits -- they could be replaced by an AI so that the game can continue?

Re: jsdebug

Posted: 04 Feb 2013, 22:34
by Per
aubergine wrote:With jsload does it load in to currently selected player, or only player 0?
"allows you to load any AI script you want from the 'scripts' directory in your write directory to run on the current player."
aubergine wrote:For example, could I use old debug menu to switch to different player then jsload a new script for that player?
Yes.
aubergine wrote:Also, I imagine jsload type thing could be used in multiplayer games if a player quits -- they could be replaced by an AI so that the game can continue?
It is not meant for that purpose, and changing players with cheat menu during multiplayer will create desyncs.

Re: jsdebug

Posted: 04 Feb 2013, 23:24
by aubergine
Thanks for infos :)

I've started documenting the js debugger: https://warzone.atlassian.net/wiki/disp ... t+Debugger

Anyone got a screenie of the 'triggers' tab?