The official --=jscam=-- thread

For AI and campaign script related discussions and questions
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

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

Post by Per »

vexed wrote:Do you mean, replace some entries in the wrf file just to load the needed scripts, or do you mean something different?
I meant basically moving most of mission.cpp and levels.cpp into qtscript functions, allowing scripts to control almost everything to do with mission changes, in detail.
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

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

Post by Berserk Cyborg »

I could try converting sub1-5 and sub1-5s.

Normally this would not be an issue, but how would I set the camera to follow the transporter for this mission? I have a working bare setup right now, but at the moment the view position starts off at the LZ.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

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

Post by Per »

That sounds great!

Did you try the cameraTrack(droid) function? It is meant to do what you want.
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

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

Post by Berserk Cyborg »

I just used cameraTrack() and it works great!
About 90% done right now and sub1-5 works for the most part. Just need to iron out a few minor bugs.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

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

Post by NoQ »

Sounds great! I'm still pinned down irl, but i'd try at least to review the patches once in a while.

You can proudly add yourself to http://developer.wz2100.net/wiki/jscam#LevelStatus (:
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

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

Post by cybersphinx »

NoQ wrote:Because it's hard to find/run the original game nowadays (legally)
COPYING.README wrote:5) Permission is granted to copy and distribute unaltered copies and/or images of the original game discs in any medium, provided that they are distributed free of charge and retain their original copyright and trademark notices.
We want information... information... information.
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

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

Post by Berserk Cyborg »

I am not done yet, but I am having a problem with the win conditions. It brings up the return to LZ message after all artifacts are collected and the mission never ends unless I destroy all enemy objects/units. Did I forget to add something?

progress here
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

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

Post by Per »

I'm not up to date on how the campaign scripts work these days, but the interface to the C++ code is through the loadLevel(level name) function. Just specify the named level (they are defined in the gamedesc.lev file). I see it used in camNextLevel(level name) in libcampaign.js
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

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

Post by Berserk Cyborg »

I fixed the LZ win condition bug since my last post (pos1 coordinates must be lower in value than those in pos2 apparently). I think everything is done and my Git branch is here

I can create a patch if everything looks ok.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

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

Post by Per »

Cool!

Actually, for complex stuff like this, it is actually better to just create a ticket, and add a link in it to your git branch.
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

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

Post by Berserk Cyborg »

See http://developer.wz2100.net/ticket/4524

I will try starting on sub1A-C.
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

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

Post by Berserk Cyborg »

How do I add a labels file for cam1A-C? Each level has a folder in the wrf/cam1 directory, but not this one. I can't make any progress on this level since all my positions and areas will be undefined.

Edit: Nevermind, I see cam1A-C and cam1CA are shared.

Anyway here are some updates:
1. Fixed a typo in libcampaign.js that would otherwise render CAM_ORDER_PATROL broken.
2. Completed cam1A-C. I will upload it to my git branch later.

So I claim sub1-7 and sub1-7s next.
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

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

Post by Berserk Cyborg »

Is there a way to add another label position or modify the pos coordinates of an existing one? Right now the artifact is placed back on its starting position when the artifact group takes it and are destroyed. edit: remove old link.
Last edited by Berserk Cyborg on 29 Nov 2016, 08:10, edited 1 time in total.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

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

Post by Per »

You mean like addLabel(object, label)? It currently takes area, radius, droid, structure, and feature labels, but explicitly refuses to take position labels (I don't remember why, probably did not see a use for it).

If you tell me what you want to do, I'll look at the code and tell if you it can be done.
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

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

Post by Berserk Cyborg »

I was passing a position label... Anyway I have the artifact drop working now. Just need to complete a few more things for cam1-7.
Post Reply