Page 1 of 14

The official --=jscam=-- thread

Posted: 19 Oct 2014, 20:21
by NoQ
I've got the good news and the bad news. I'll start with the good news: the long-awaited and long-feared rewrite of campaign in JavaScript has been taken up. The bad news: it was me again.

The bad news is bad because i'm weekend-only at most, and its going to take forever for me to finish this (the current rate prediction is one or two missions per week; but unless it's a weekend, i can at most answer some questions). So you don't need to blame me for breaking the game, or whine that i shouldn't change anything - most likely i wouldn't finish it anyway, so you don't need to bother.

On the other hand, if somebody's going lend me a hand, however poorly-mannered i may be, then probably we'd be having a solid and bug-free campaign, true to the original, by 3.2 release, whenever it is coming, so patches are welcome, and it should be pretty easy for anybody to figure things out and help with the easy part of the work.

I'd leave the rest of the talk to the wiki page, which would contain up-to-date information on the jscam status. If you found a bug or made a patch or have any other sort of useful stuff, please post in this thread.
vexed wrote:Please upload the patches to trac when done here #4234 , don't use the forums.

(For asking for help / debugging / collaboration, it is fine to use the forums.)

Thanks! :3

Re: The official --=jscam=-- thread

Posted: 19 Oct 2014, 20:48
by Goth Zagog-Thou
I'm lending a hand. ;) Bad news is, it'll be extremely difficult for me to avoid changing anything ..

I jest. It'll be fine. :lol2:

Re: The official --=jscam=-- thread

Posted: 19 Oct 2014, 21:01
by NoQ
Oh well, i guess you're unstoppable now XD Mentioned that Goth takes cam1-1s on the wiki.

For the power module, you'd need custom victory conditions, so don't rely on camSetStandardWinLossConditions(), but call camNextLevel() from eventStructureBuilt() directly, or something like that.

Then, the transporter needs to be coded, and i have no idea how, so far. Whatever way you find to make it work is good, then later we'd think how to make the code re-usable and move to libcampaign.js.

I'm gn8 for today, i guess. Thx all (:

Re: The official --=jscam=-- thread

Posted: 19 Oct 2014, 21:30
by Goth Zagog-Thou
No problem. I'll get that figured out and posted when it's done. I have a household to run and people to take care of so my time is divided between that and Warzone.

Enjoy your day, buddy.

Re: The official --=jscam=-- thread

Posted: 21 Oct 2014, 07:19
by ClockWork
The jscam project could use your help! While being a complicated project with a barely visible instant effect, in fact, very little knowledge is required to be helpful.
I'm there! Bad news, I know next to nothing. If I could have things explained to me as if I were a 5 years old, then I think I'd be golden.

About this, "Labeling" gig, from what I understand it's about putting the coordinates (x,y) about the important places and structures for a file, right?
You need to be reading the original WZScript data and code to understand what stuff it considers important
Where could I find this WZScript data and code? I think I tried writing a guide on how to understand it before, but it got bizzarly confusing.

Re: The official --=jscam=-- thread

Posted: 21 Oct 2014, 07:26
by NoQ
Yay thanks ClockWork, welcome to the club.
I'll now try to expand this section of the wiki to include an answer to your question.

Re: The official --=jscam=-- thread

Posted: 21 Oct 2014, 09:10
by NoQ
:lecture: Done, see "File Locations" and "Labeling" sections.
Not sure if it looks easier now :oops:

Made me think: we don't really need to define GROUP labels for enemy bases, wzcam goes without it by simply defining base groups as "all structures but not walls in the cleanup area". I think i'd simplify things when i get to it, no need to label base groups now.

Re: The official --=jscam=-- thread

Posted: 21 Oct 2014, 20:05
by Goth Zagog-Thou
My personal preference is to label them in FlaME so that I can keep track of what area I'm trying to do things in when I'm writing the script for it. Labels seem to be depreciated in 3.2 now, so there's no need to really do it (as far as I can tell) other than organizing.

Re: The official --=jscam=-- thread

Posted: 21 Oct 2014, 20:14
by Goth Zagog-Thou
I have time to work on Mission 3 today (finally). I'll check Github for any changes to libcampaign.js before I get started, and we'll go from there. :3

Re: The official --=jscam=-- thread

Posted: 21 Oct 2014, 20:33
by NoQ
For the labels, the work still needs to be done - one way or another, we need to define the areas for JavaScript to refer to. And yeah, one of the advantages of labels is the possibility of using FlaME as a WYSIWYG labels editor.

Now, if you find an easy way to actually use FlaME, please let shout out loud (preferably at the wiki). Because it doesn't, at least out of the box, open maps that do not have terrain data in place (but referenced from another map instead), which is typical in campaign.

Yeah, current master is most likely broken (big long-awaited changes yay), so try to patch against the latest commit tagged as "jscam:" for now (9d6203e).

The documentation is already up, btw. It is up to date, but may have bugs (:

Re: The official --=jscam=-- thread

Posted: 21 Oct 2014, 21:17
by Goth Zagog-Thou
The latest Buildbot I'm using is from (I believe) Sunday evening where Mission 2 got its' JS port done, so I'm able to run it. It *is* a little crashy in some spots though. (Not Mission 2, but the build in general).

I've never had any trouble opening Campaign maps in FlaME. I open the .gam file then select my terrain, voila. Works fine.

As far as needing to define the labels, that's fine. That's old hat to me. ;) I plan to keep all labels, group names, etc "direct-from-slo" anyway. Direct port, nothing fancy or unusual.

I do have an item some more functions that I'd to add to libcampaign.js already. Has a separate forum or Wiki thread been created for that purpose yet?

Re: The official --=jscam=-- thread

Posted: 22 Oct 2014, 05:10
by NoQ
some more functions that I'd to add to libcampaign.js
Throw in whatever you need to make the level running, i'd see later if i can improve it. In fact, it's only worth putting stuff to the library when it was used in more than one level, so it's even ok if the first commit has everything in the level code, and later we move it.

Re: The official --=jscam=-- thread

Posted: 22 Oct 2014, 07:30
by Goth Zagog-Thou
No worries, the stuff I want to add I'm still testing anyway. I want to make sure that it's quality code. No harm if I dev it on my machine first, right? :)

Re: The official --=jscam=-- thread

Posted: 23 Oct 2014, 01:35
by Goth Zagog-Thou
Still working on some additions to libcampaign.js today and Mission 3. No timetable for when it'll be ready.

Re: The official --=jscam=-- thread

Posted: 23 Oct 2014, 03:24
by vexed
Please upload the patches to trac when done here #4234 , don't use the forums.

(For asking for help / debugging / collaboration, it is fine to use the forums.)

Thanks! :3

Sidenote, buildbot is down for the count, until we fix the Qt5 stuff. :annoyed: :stressed: