JS away mission support?

For AI and campaign script related discussions and questions
Post Reply
Originway
Trained
Trained
Posts: 412
Joined: 08 Aug 2012, 06:22

JS away mission support?

Post by Originway »

can we have a way to do away missions?
we want to load all troops into the transports then fly them off to a new map
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: JS away mission support?

Post by aubergine »

loadLevel() but currently it only works in campaign and you have to specify what the away missions are in advance in the .lev file (I think?!)

I actually just opened up the forums to post some ideas on this very subject! Just haven't found topic I was looking for yet but will post link here when I do.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: JS away mission support?

Post by Per »

Added two new functions related to transporter handling in campaign, startTransporterEntry(x, y, player) and setTransporterExit(x,y, player). See b1b60ba7a3781303d349099403c7e48d92c4d121. This should allow missions with transporters entering and exiting possible.
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: JS away mission support?

Post by aubergine »

"The transport needs to be set up with the mission droids, and the first transport found will be used."

Uhm, how do we do that?

Also, how do we know when a transport has left the map? We have eventLaunchTransporter() but we won't know how long between launch and map exit, would be useful if there was an eventTransportExit() that gets called when it leaves the map, and then we could put a loadLevel() (or whatever) in to that event handler.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: JS away mission support?

Post by Per »

You need to create/modify the mission droid file - mdroid.ini.

I've added the following events for control of the mission transporter:
eventTransporterLaunch (was eventLaunchTransporter - old name still supported)
eventTransporterArrived (was eventReinforcementsArrived - old name still supported)
eventTransporterExit - triggered on transporter exiting the map
eventTransporterDone - triggered when no reinforcements left to send
eventTransporterLanded - triggered when transporter actually lands
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: JS away mission support?

Post by Goth Zagog-Thou »

This is very interesting to me, as I have Transporters entering and exiting twice from different directions on M11, and this seems to fix the issues I've run into using 3.1.

Looks like I'll be moving to Master builds sooner than I thought.

Good stuff as always, Per. :)
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: JS away mission support?

Post by aubergine »

These new events are awesome!

Would it be possible to have the transporter droid object passed in as a parameter? (except on eventTransporterDone)

Also, would it be possible to trigger eventTransporterLaunched() and eventTransporterArrived(), in non-campaign games, when a transport transitions from/to DORDER_NONE (idle)?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: JS away mission support?

Post by Goth Zagog-Thou »

I'm having a few issues getting the cam ported to master. Too much different, it seems.

The /campaign folder thing, I understand. No problem there.

It complains about not being able to find the data files, etc.

I'll keep working at it. Please don't stop the improvements to the js API, as it's already solved problems for me on 3.1 and I suspect it'll be the "magic bullet" by the time I am able to start writing the cam scripts in js only. You folks are doing a great job and I'm learning a lot just by watching how you're doing things. :)
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: JS away mission support?

Post by Per »

There might just be a bug somewhere. Feel free to post your issues here, and maybe someone can help :)

I've added the transporter as parameter to each event. No idea why I didn't think of that right away...
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: JS away mission support?

Post by Goth Zagog-Thou »

Well I'm attempting to log onto the IRC channels, but it isn't accepting my password that I registered my nick to.

Figured that would be the best place to discuss the issue at. *shrug*

Gotta make supper anyway :lol2:
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: JS away mission support?

Post by aubergine »

Instead of requiring an mdroid.ini to define the droids that would be on a transport, would it be worth having a new JS API function that's something like addDroidToCargo(transport, template)? That way the definition of what's on the transport is right next to the startTransporterEntry(x, y, player) rather than hidden away in some ini file (that I've still not been able to find)...
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: JS away mission support?

Post by aubergine »

How do we determine which LZ a transport will go to after arriving on the map? In some cam missions, there is more than one LZ.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Originway
Trained
Trained
Posts: 412
Joined: 08 Aug 2012, 06:22

Re: JS away mission support?

Post by Originway »

aubergine wrote:How do we determine which LZ a transport will go to after arriving on the map? In some cam missions, there is more than one LZ.
I wonder this also since we can have multiple LZs for players and multiple LZs for AI like the campaign mission where they get dropped all over the map
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: JS away mission support?

Post by Per »

aubergine wrote:How do we determine which LZ a transport will go to after arriving on the map? In some cam missions, there is more than one LZ.
Each player has max one landing zone, set with setNoGoArea(x1, y1, x2, y2, player);
Post Reply