Javascript API documentation
Re: Javascript API documentation
Ah, you mean something that cross-references WZscript to JavaScript, so people editing a WZscript can see how to port to JavaScript?
I'd be happy to do that, but I might need some help. I'll get an initial draft of it done this week and post URL.
I'd be happy to do that, but I might need some help. I'll get an initial draft of it done this week and post URL.
Last edited by aubergine on 15 Jan 2013, 20:54, edited 2 times in total.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Javascript API documentation
yeah, I think it would be helpfulaubergine wrote:Ah, you mean something that cross-references WZscript to JavaScript, so people editing a WZscript can see how to port to JavaScript?
I'd be happy to do that, but I might need some help. I'll get an initial draft of it done this week and post URL.
Re: Javascript API documentation
@originway: Here's the first bit I've done so far - is this the sort of thing you are after? https://warzone.atlassian.net/wiki/page ... d=18776189
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Javascript API documentation
yeah
your site is very well done, I think they should host that stuff for you so it becomes a official part of the site!
your site is very well done, I think they should host that stuff for you so it becomes a official part of the site!
- Goth Zagog-Thou
- Regular

- Posts: 1582
- Joined: 06 Jan 2007, 08:08
- Location: Delta Base
- Contact:
Re: Javascript API documentation
This will be EXTREMELY helpful to me. Thanks Aubergine! 
Re: Javascript API documentation
I've just added the events/triggers section, with a table that cross-references all <callback> wzscript triggers to their related events in JS API.
I found lots of missing events, however most are related to the tutorial mode and GUI buttons. I think those events should not be implemented yet, instead wait until we've got GUI API exposed as that will determine requirements much more clearly.
Anyway, let me know if the conversion guide is going in the right direction - I've never done any wzscript so you'll have to let me know if anything there isn't making sense.
I'll continue on with expressions and the other bits of the document posted by Originway now, might even be able to get this finished tonight!
I found lots of missing events, however most are related to the tutorial mode and GUI buttons. I think those events should not be implemented yet, instead wait until we've got GUI API exposed as that will determine requirements much more clearly.
Anyway, let me know if the conversion guide is going in the right direction - I've never done any wzscript so you'll have to let me know if anything there isn't making sense.
I'll continue on with expressions and the other bits of the document posted by Originway now, might even be able to get this finished tonight!
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Javascript API documentation
Now done pretty much everything -- a lot of it I could just link to internet resources about Javascript coding (big benefit of using JS for scripting!!) and existing documentation in the wiki: https://warzone.atlassian.net/wiki/page ... d=18776189
Please let me know what other stuff is required - either post here, PM me, comment on the wiki page, whatever you want. My Skype app is currently dead (stuuupid auto-update not checking OS version!).
Please let me know what other stuff is required - either post here, PM me, comment on the wiki page, whatever you want. My Skype app is currently dead (stuuupid auto-update not checking OS version!).
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Javascript API documentation
excellent work you have done!
have you ever thought about doing a pdf book/guide from your site then those can be read offline?
have you ever thought about doing a pdf book/guide from your site then those can be read offline?
Re: Javascript API documentation
You can export any page on that site to PDF (although possibly you need to create a user account on there first via the login link).
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Javascript API documentation
You can export javascript API documentation to pdf by calling in the game's source code directory (you need LaTeX installed).
Code: Select all
make javascript-docMaps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Javascript API documentation
or just download the html of the 1-page JS API guide
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Javascript API documentation
Just realised that even though cyborg engineer's .droidType JS property is equal to DROID_CONSTRUCT, cyborg engineers don't get enumerated by enumDroid(me, DROID_CONSTRUCT), because enumDroid only considers C-style droid types (so it needs to be called with DROID_CYBORG_CONSTRUCT instead). Same applies to DROID_CYBORG_REPAIR, i think.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Javascript API documentation
Is that the bug you mentioned on nullbot with 3.1.0 and earlier that's fixed in 3.1 master?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Javascript API documentation
No.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Javascript API documentation
Also, range parameter in enumRange() needs to be converted to world coordinates or something like that.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam


