jsdebug

For AI and campaign script related discussions and questions
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

jsdebug

Post 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.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: jsdebug

Post 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.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: jsdebug

Post 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.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: jsdebug

Post by Goth Zagog-Thou »

Just like Armada II. ;) That's exactly how that one works.
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: jsdebug

Post 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?
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: jsdebug

Post by aubergine »

go in to cheat mode, then enter cheat code "jsdebug"
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: jsdebug

Post by Goth Zagog-Thou »

Excellent, thanks. ^_^
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: jsdebug

Post 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.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: jsdebug

Post 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.
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: jsdebug

Post 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.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: jsdebug

Post 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).
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: jsdebug

Post 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.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: jsdebug

Post 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?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: jsdebug

Post 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.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: jsdebug

Post 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?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Post Reply