The official --=jscam=-- thread

For AI and campaign script related discussions and questions
Post Reply
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

The official --=jscam=-- thread

Post 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
Last edited by vexed on 23 Oct 2014, 03:28, edited 2 times in total.
Reason: Add a note where to put the patches
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

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

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

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

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

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

Post 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.
User avatar
ClockWork
Trained
Trained
Posts: 219
Joined: 07 Sep 2008, 03:22
Location: USA

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Post by Goth Zagog-Thou »

Still working on some additions to libcampaign.js today and Mission 3. No timetable for when it'll be ready.
User avatar
vexed
Inactive
Inactive
Posts: 2538
Joined: 27 Jul 2010, 02:07

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

Post 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:
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
Post Reply