The official --=jscam=-- thread

For AI and campaign script related discussions and questions

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

Postby Per » 10 Mar 2015, 22:18

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.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3604
Joined: 03 Aug 2006, 19:39

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

Postby Berserk Cyborg » 06 Nov 2016, 23:45

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.
Berserk Cyborg
Code contributor
Code contributor
 
Posts: 235
Joined: 26 Sep 2016, 19:56

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

Postby Per » 07 Nov 2016, 00:19

That sounds great!

Did you try the cameraTrack(droid) function? It is meant to do what you want.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3604
Joined: 03 Aug 2006, 19:39

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

Postby Berserk Cyborg » 07 Nov 2016, 08:17

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.
Berserk Cyborg
Code contributor
Code contributor
 
Posts: 235
Joined: 26 Sep 2016, 19:56

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

Postby NoQ » 07 Nov 2016, 18:04

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

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

Postby cybersphinx » 07 Nov 2016, 18:43

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.
cybersphinx
Inactive
Inactive
 
Posts: 1666
Joined: 01 Sep 2006, 19:17

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

Postby Berserk Cyborg » 07 Nov 2016, 23:07

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
Berserk Cyborg
Code contributor
Code contributor
 
Posts: 235
Joined: 26 Sep 2016, 19:56

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

Postby Per » 08 Nov 2016, 00:50

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
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3604
Joined: 03 Aug 2006, 19:39

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

Postby Berserk Cyborg » 08 Nov 2016, 06:45

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.
Berserk Cyborg
Code contributor
Code contributor
 
Posts: 235
Joined: 26 Sep 2016, 19:56

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

Postby Per » 08 Nov 2016, 10:25

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.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3604
Joined: 03 Aug 2006, 19:39

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

Postby Berserk Cyborg » 09 Nov 2016, 22:14

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

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

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

Postby Berserk Cyborg » 15 Nov 2016, 01:27

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.
Berserk Cyborg
Code contributor
Code contributor
 
Posts: 235
Joined: 26 Sep 2016, 19:56

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

Postby Berserk Cyborg » 28 Nov 2016, 22:39

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.
Berserk Cyborg
Code contributor
Code contributor
 
Posts: 235
Joined: 26 Sep 2016, 19:56

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

Postby Per » 29 Nov 2016, 01:32

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.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
 
Posts: 3604
Joined: 03 Aug 2006, 19:39

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

Postby Berserk Cyborg » 29 Nov 2016, 03:25

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.
Berserk Cyborg
Code contributor
Code contributor
 
Posts: 235
Joined: 26 Sep 2016, 19:56

PreviousNext

Return to Scripting