Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Starman01 on May 06, 2006, 09:05:09 am

Title: Campaign-Endmovie
Post by: Starman01 on May 06, 2006, 09:05:09 am
Hey there,

I'm posting this here, since my question is related to the campaign file.

How can I make my outro-movie play after the final misson has ended (so no debriefing will be displayed).

We are using 3.6.7, is it hardcoded to "endgame.avi" or something similar and will be played when the campaignfile has the "end-campaign" trigger, or must we even play around with the "start supernova" thing to make it play (I remember it being that way the past).

Thanks in advance.

Starman
Title: Re: Campaign-Endmovie
Post by: Shade on May 06, 2006, 09:14:31 am
One way to sorta get what you want is to set the mission to have no debriefing, then add an extra mission to play the movie, set that mission to have neither briefing or debriefing and only a single event that executes immediately to end the mission and the campaign. Or maybe roll credits using training messages for a bit to pimp yourself ;)

As for whether it's hardcoded, I don't know but I'll take a look if noone else answers this one within a reasonable time.
Title: Re: Campaign-Endmovie
Post by: karajorma on May 06, 2006, 09:21:40 am
It's hardcoded and the campaign has to be called Freespace2.fc2 for it to work.
Title: Re: Campaign-Endmovie
Post by: Shade on May 06, 2006, 09:40:47 am
Yup, just checked. Hardcoded to endpart1.mve plus endprt2a/b.mve (depending on ending). Looks trivial to get rid of the campaign name requirement, but that would have bad results for campaigns not including their own movies. When I get time I think I'll look into some way of letting campaigns play a movie of their own at the end without making existing campaigns play the fs2 movies, as would happen if I just commented out the name check.

It doesn't look hard, it's just that right now I'm trying to fix a bug that is being excruciatingly annoying to pin down, and that has priority over a new feature.
Title: Re: Campaign-Endmovie
Post by: Starman01 on May 06, 2006, 01:08:06 pm
So, renaming the campaign file would be a solution (however then we would maybe have to select a campaign called FS-Maincampaign in the selection). What worries me really is the filename. Is it necessary to be a .mve to work ? Our Movie is an avi (I'm not good enough in these things to know if it can be converted though).
Title: Re: Campaign-Endmovie
Post by: Shade on May 06, 2006, 02:07:36 pm
In fs_open, it can be avi. In fact, using an .mve would not always work as that is only supported on the Linux version for the time being. Retail only has support for .mve though. Anyway, I'll take a look at the movie thing after I get this bug fixed since it could be of use to lots of campaigns, so you may not need to worry if you're still a while from release.
Title: Re: Campaign-Endmovie
Post by: karajorma on May 06, 2006, 02:16:09 pm
Personally I think adding a final credits mission or a "WCP will return in release 2" mission is a much better idea than renaming the campaign file.
Title: Re: Campaign-Endmovie
Post by: Starman01 on May 07, 2006, 05:16:33 am
Could you specify that please ? What exactly do you have in mind ?
Title: Re: Campaign-Endmovie
Post by: Shade on May 07, 2006, 05:57:09 am
I'm thinking a good way to do it would be to get rid of the campaign filename check in freespace.cpp allowing it to post GS_EVENT_END_CAMPAIGN for any campaign, and then instead have the only filename check in mission_campaign_end_do to make sure the fs2 movies are played only for the fs2 campaign, and for any other campaign look for a movie called <campaign filename>_end.avi and play that. Then if the movie does not exist, post GS_STATE_DEBRIEF to allow a debriefing to commence (actually might be better to have that check in freespace.cpp for less work in case of no movie).

Sorry if that sounds a bit technical :) In english, it would mean that for a campaign called wcsmain.fc2, it would look for and if it exists play a movie called wcsmain_end.avi. Assuming I can make it work of course, but as I said earlier it does not look too hard.
Title: Re: Campaign-Endmovie
Post by: Starman01 on May 07, 2006, 06:15:39 am
Thanks. That would be non-plus-ultra (as we say in german :D) though I didn't want to ask for another codechange (or goober will mostly rip my skin off :D )

However, we will need another solution for the upcoming release 1, so what do you have in mind kara with that credit-mission ?
Title: Re: Campaign-Endmovie
Post by: Shade on May 07, 2006, 06:31:58 am
The credit mission is simple enough in concept. In the campaign editor, you have the option to add a cinematic before a mission briefing. So you add an extra mission and have that mission play your end movie as the pre-briefing movie, then just terminate the mission at once (or, as suggested, use it to roll credits using training messages).

That would also allow different movies for different endings (which I assume is why you'd need a different solution to the codechange one), as you can simply link to different missions based on the events that occurred in the campaign.
Title: Re: Campaign-Endmovie
Post by: karajorma on May 07, 2006, 07:24:04 am
Yep. Raider Wars for TBP is a good example of how to do one. They simply had a shot of B5 with a shuttle flying towards it and a standard message saying what would be the name of their next campaign.

Then you simply add some credits to appear as messages in the mission (models by x, FREDding by y etc).

The cutscene you want to play is then basically treated in exactly the same way as any other cutscene in the campaign.


@Shade : While you're poking around in the cutscene code how hard would it be to make the standard ending cutscenes play regardless of whether the name is endpart2a or endprt2a? Cause there are a lot of people out there with the wrong filename since the downloaded cutscenes were incorrectly named when uploaded (not certain if I named them incorrectly of if I got them from TurboNed that way).
Title: Re: Campaign-Endmovie
Post by: Shade on May 07, 2006, 07:28:03 am
30 second fix, if that.
Title: Re: Campaign-Endmovie
Post by: karajorma on May 07, 2006, 07:30:39 am
Figured as much :)
Title: Re: Campaign-Endmovie
Post by: Shade on May 07, 2006, 07:45:26 am
More like 27 seconds, not counting the time spent getting the syntax right because I was being dumb :p And no testing done yet (as I'm watching an F1 grand prix at the moment), so as yet it only works in theory. In mission_campaign_end_do, change the movie playing code to this:

if(Supernova_status == SUPERNOVA_HIT)
{
   // no soup for you!
   if (!movie_play_two("endpart1.mve", "endprt2b.mve"))
      movie_play("endpart2b.mve");         // good ending
   
} else {
   // no soup for you!
   if (!movie_play_two("endpart1.mve", "endprt2a.mve"))
      movie_play("endpart2a.mve");         // good ending
}

Result should be that if the first attempt at playing the movies returns false (ie. if one of the files wasn't found), it tries the alternative for the second movie. Oh, and it saying good ending twice in the original comments might warrant a change too...
Title: Re: Campaign-Endmovie
Post by: Starman01 on May 07, 2006, 12:45:12 pm
What about the supernova-thing ? Is it still necessary (in the current version) to activate that in the mission so the endmovie will be played ?
Title: Re: Campaign-Endmovie
Post by: Shade on May 13, 2006, 11:11:00 am
Supernova is required at the moment, but soon that won't matter :D Regarding my idea for letting campaigns play a set end movie, I scrapped it. Instead, I'm working on something Rather Bettertm. Basically, I'm making it so you can use mission events to set a movie or movies to be played between mission end and the debriefing. So you will be able to play specific movies based on specific events that occur during a mission if you so desire, or even just play some generic "carrier landing" movie for missions that end that way.

I have about half of the code done at the moment, well, in fact all of the actual movie playing code is pretty much done, I "just" need to add the proper SEXPs (something like add_movie and clear_movies would do I think) and then make sure it doesn't break anything or do something stupid like play even in the event of death or forfeit.

Anyways, no ETA on it, mainly since I'm unsure about what it might break and I want to be damn sure it's safe before it gets anywhere near CVS, but it'll get done eventually. Just wanted to let you know :)
Title: Re: Campaign-Endmovie
Post by: Starman01 on May 13, 2006, 12:57:23 pm
I'm really glad you are working on that (certainly all will benefit from that). However, there is no need to hurry, since our prologue isn't compatible with the new exe's (yet) and I wont change it if it isn't absolutly necessary (like when the fiction viewer will be done, this would currently be the only vital change which would make me do all the work for making it compatible again :) ) Until then, we stay with the original 3.6.7 which works good.
Title: Re: Campaign-Endmovie
Post by: Shade on May 13, 2006, 01:03:48 pm
No problem, never did understand why you had to be limited to playing movies between missions. Besides, it's not that much new code, it's just calling the existing movie code in new and interesting ways and finding the right place to do it in :p

[edit] If there's something else you'd like to be able to do with movies (though I think this should cover all the bases, got pre-debrief with my additions and post-debrief already available from the campaign editor), this would probably be the time to say so while I'm still finishing this up.
Title: Re: Campaign-Endmovie
Post by: Starman01 on May 13, 2006, 02:38:00 pm
Well, to get back to my earlier question, how can I get the outro to run then in the old build ? I tried making a mini-campaign with just the last mission. In the campaign-file it has a "end campaign" flag/sexp.

At the end in the mission, in the same SEXP that has the "end mission" operator I start the supernova with a timer of 100 (though the player will not even notice that, since the mission ends in the same second (maybe that's a problem ? )

The outro file is called "endpart1.avi", and the campaign file is called "freespace2.fc2".

What am I missing ?
Title: Re: Campaign-Endmovie
Post by: karajorma on May 14, 2006, 05:54:34 am
No idea. The code to start the movie playing is a hack. I did manage to get it to work once for RT but I can't remember what I did.

Attempting to hack in end movies in this way is a bad idea anyway. Still reckon you're wasting your time not making a credits mission instead.
Title: Re: Campaign-Endmovie
Post by: Starman01 on May 14, 2006, 12:12:36 pm
Somehow I'm not really a friend of that credit-mission idea. I would rather like to have the movie been played after the last mission and then throw the player back to the mainhall. If the cutscene SEXP would work properly it would be worth thinking about such a mission, but they don't and here is my problem.

I'd rather try the hack, I just need to know the synthax. @ Shade ? Can you tell me that ?
Title: Re: Campaign-Endmovie
Post by: Shade on May 14, 2006, 12:56:18 pm
It's the whole end movie code that's a hack, which is the problem. It's just... not pretty. I have one idea what it might be though, so give me a few and I'll do a test build for you to try. No guarentees though, it's too messy for me to really do anything but guess without further investigation.

[Edit] Try this: http://www.fileh.com/dkshade/movietest.zip - I'd give it a 25% chance of solving the problem, 25% risk of breaking the FS2 main campaign ending, and a 50% chance of doing nothing at all... that's how predictable this part of the code is to me at the moment :(
Title: Re: Campaign-Endmovie
Post by: Starman01 on May 14, 2006, 02:02:43 pm
I try it, but you misunderstood me I guess. I just want to know the synthax how it works currently (the necessary movie-name and the necessary trigger for it). We can't run our beta with up to date exe-files, there have been to many changes and now the stuff isn't compatible anymore, so it is a waste of time making the movie code change for our upcoming release. :(
Title: Re: Campaign-Endmovie
Post by: Shade on May 14, 2006, 03:39:15 pm
I see. Well, not much wasted time in this case, so no worries. The problem with what you want however is that as far as I can tell, what you did already (with the campaign name = freespace2 and supernova active) *should* work, so I'm afraid I can't help you unless I stumble upon something I've so far overlooked :blah:
Title: Re: Campaign-Endmovie
Post by: Starman01 on May 14, 2006, 03:59:01 pm
Not so bad, I'll find a way of doing it. To be honest, I also made some tries with that mission thing and the cutscene SEXP already in 3.6.7 and I just get an Idea of what I think would be cool :), so maybe it will be really a solution.

Damn shame those Cutrscene-SEXP are not fully functional, there are a lot of hard movements and the camera is hard to control (and mostly the subtitle SEXP doesn't offer much textspace and seems to missing some strings).

Just keep working on the endmovie things shade, I think it would be very good when a working code will find it's way into CVS.