Page 1 of 1

JS away mission support?

Posted: 22 Jan 2013, 08:28
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

Re: JS away mission support?

Posted: 22 Jan 2013, 08:44
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.

Re: JS away mission support?

Posted: 25 Jan 2013, 21:52
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.

Re: JS away mission support?

Posted: 25 Jan 2013, 23:19
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.

Re: JS away mission support?

Posted: 27 Jan 2013, 14:26
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

Re: JS away mission support?

Posted: 28 Jan 2013, 00:47
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. :)

Re: JS away mission support?

Posted: 29 Jan 2013, 00:10
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)?

Re: JS away mission support?

Posted: 29 Jan 2013, 00:18
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. :)

Re: JS away mission support?

Posted: 29 Jan 2013, 00:41
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...

Re: JS away mission support?

Posted: 29 Jan 2013, 00:51
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:

Re: JS away mission support?

Posted: 29 Jan 2013, 01:32
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)...

Re: JS away mission support?

Posted: 29 Jan 2013, 07:10
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.

Re: JS away mission support?

Posted: 29 Jan 2013, 23:13
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

Re: JS away mission support?

Posted: 29 Jan 2013, 23:25
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);