Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: karajorma on February 05, 2010, 04:53:46 am
-
After talking to The_E it occurs to me that I never actually posted openly the details on how to use the new cutscene code I added a while back. In fact unless you've stumbled across it elsewhere the only clue to its existence is a comment in my changelog (http://www.hard-light.net/forums/index.php?topic=64685.0)
So anyway, here's how things work.
There's no GUI for this so all work will have to be done in notepad for the moment. The FRED build however should be able to load and save everything correctly, it just doesn't have a clue how to edit it.
Syntax is as follows. (placed just before the #Command Briefing or Fiction Viewer stuff)
#Cutscenes
$Cutscene Type: Cutscene File Name
+formula (Since the editor doesn't work you'll have to make a formula somewhere it does work and paste it in here. MissionBrief or Goals Editor for instance)
#end
Valid types are
$Fiction Viewer Cutscene:
$Command Brief Cutscene:
$Briefing Cutscene:
$Pre-game Cutscene:
$Debriefing Cutscene:
All of these are played before the rest of the stage they mention.
The game will work it's way through the list of cutscenes looking for any who have the correct type for the stage of the game it is at. If it finds one it will then test to see if the formula (i.e the SEXP) is true. If so it will play the movie. It will then continue down the list. If multiple cutscenes are valid they will be played in the order they were parsed in from the mission.
So for instance this code
$AI Profile: FS2 RETAIL
#Cutscenes
$Fiction Viewer Cutscene: intro.ogg
+formula: ( true )
$Briefing Cutscene: endpart1.ogg
+formula: ( true )
$Briefing Cutscene: bastion.ogg
+formula: ( false )
$Briefing Cutscene: mono2.ogg
+formula: ( true )
#end
#Command Briefing
Will play the intro if the mission has fiction (followed by showing the fiction viewer) then it will play endpart1, skip bastion, play mono2 and then show the briefing (Due to the way the code works it would show those whether or not you've turned briefings on or off actually but that's kinda useful so I'm not going to tinker with it).
The cutscene info is stored dynamically so the only limit on the number of them is memory. Theoretically you could use this feature to completely replace briefings and debriefings but I dread to think what filesizes would end up like if we did that. :)
-
Will a commandbriefing cutscene be played even if there is no command briefing stage? I mean it would be a little useless if one would have to have an empty command briefing to be able to use the cutscene that's supposed to replace it.
I didn't really get how that is supposed to work.
-
It's set up right now in such a way that the engine checks whether a cutscene is defined for a stage before actually entering that stage; if yes, it will play that cutscene.
If you define a pre-command briefing cutscene in a mission without a command briefing, the game will simply ignore the pre-command briefing cutscene.
-
Will a commandbriefing cutscene be played even if there is no command briefing stage?
IIRC, no. Since no command briefing is specified in the mission file the code never enters the section to play a command briefing cutscene.
I mean it would be a little useless if one would have to have an empty command briefing to be able to use the cutscene that's supposed to replace it.
But why would you ever do that when you could just as easily play it as one of the pre-briefing cutcenes? :p
All you have to do is make sure it's the first one on the list of cutscenes.
And it should play pre-briefing and pre-debriefing cutscenes even if the briefing/debriefing is tuned off.
-
ok
-
The rule of thumb I use is to always stick the cutscene in front of the last thing I can. So if I was playing fiction but planned to have cutscenes instead of my command briefing and mission briefing I'd simply stick them all as pre-game cutscenes and make sure the name of the movie file made it clear if they are mission or command briefings.
The name of the cutscene type was only meant to denote where you can expect it to be played, not the contents of the cutscene itself. :D
-
I tried using this system but I am having some problems. After the .ogg is played the game freezes on the last frame of the cutscene. Here is the begining of the mission file. I am running in debug and I am not getting any errors.
#Mission Info
$Version: 0.10
$Name: XSTR("Gateway System, 06:00 hours, 26", -1)
$Author: dan
$Created: 07/13/08 at 12:36:36
$Modified: 07/16/10 at 11:04:03
$Notes:
This is a FRED2_OPEN created mission.
$End Notes:
$Mission Desc:
XSTR("Put mission description here
", -1)
$end_multi_text
+Game Type Flags: 1
+Flags: 4194312
+Disallow Support: 0
+Hull Repair Ceiling: 0.000000
+Subsystem Repair Ceiling: 100.000000
+Viewer pos: -48542.078125, 921.952942, 67150.718750
+Viewer orient:
0.999996, 0.000000, -0.002893,
0.002887, 0.064830, 0.997892,
0.000188, -0.997896, 0.064830
$Skybox Model: sky1.pof
$AI Profile: xc
#Sexp_variables
$Variables:
(
0 "AutoNavTime" "0" "number"
1 "FlyByActive" "0" "number"
)
#Cutscenes
$Briefing Cutscene: nowwhat.ogg
+formula: ( true )
#end
#Command Briefing
#Briefing
$start_briefing
$num_stages: 2
$start_stage
$multi_text
Code tags FTW --The E
-
Could we get the full debug log?
-
Here is the log file.
[attachment deleted by ninja]
-
Okay.
First of all, you need to learn a bit about FS2 mod installing.
The mediavps belong into a folder called (surprisingly enough) mediavps. Oh, and MV_Complete should not be used, because it's unsupported. Go to the mvp release thread to get the latest working ones.
Second, this command line: -mod wc,wc, Mediavps
is so wrong, I lack words to describe it. "wc" should not be there twice and the space in front of the mediavps shouldn't be there.
Third, please set the display colour depth to 32 bits.
Make the required changes, and try again.
-
I have made the changes except for the double 'wc' which I have no idea why it is showing up twice. Do you have any ideas why that would happen? I have checked the launcher and the cmd lines and can find no where that there is an instance of 'wc' showing up twice. This is another opportunity for you to treat me like a worthless piece of crap for not knowing enough and having to asking questions - enjoy...
-
Don't mind The_E, he's just a grump.
-
What is this whole "wc" business anyways? It doesn't seem to serve any purpose, as far as I can see.
I have made the changes except for the double 'wc' which I have no idea why it is showing up twice. Do you have any ideas why that would happen?
Since you seem to be using \wc\ as a mod folder, check if it contains a file called mod.ini. If yes, open it and see what is written on the line that begins with the word "secondarylist". Or "secondrylist" if it still contains that ancient and unneeded "fix".
-
I copied my mod data folder and ini over to a new mod folder named 'bob' and now the log read out is not doubled - kinda wierd. I will try to run the cutscene tonight - I need to get some work done before I get fired here...
-
Karajorma; any reason this can't be used in multi?
*not suggesting xfer for the cutscene though..
-
Well, i'm lost(er). Now that I have changed the mod folder to 'bob' I am getting a double 'bob' in the log file and the game continues to freeze at the end of the cutscene.
[attachment deleted by ninja]
-
What does the mod.ini in the "bob" folder look like? Post it here, please.
Also, please create a new, empty file in your data directory named debug_filter.cfg. Then run the debug build again. Note that the resultant log will be quite huge, and the engine much slower to react.
-
Here are the files, I changed the extensions to .txt to upload them. The debug filter is not a large file though...
[attachment deleted by ninja]
-
*palmface*
Please upload the fs2_open.log.
Also, check the custom flags field in the Launcher for any -mod arguments, and remove them if any are present.
Should that not fix the "multiple mod folders" issue, please delete the cmdline_fso.cfg in your data folder.
-
Well I did have the mod in the launcher which I am assuming was a rather egregious error... and now there is no double bob. Of course the game still freezes after the cutscene. I have the ogg video in the movies folder and is not referenced anywhere else except in the mission.
[attachment deleted by ninja]
-
Okay. Now that we have that sorted, are you absolutely sure that the video in question is encoded with Theora for video, and Vorbis for audio.
I'll check the code in the meantime.
-
The problem is the encoding of the video. I downloaded a ogg from the net and using it the mission ran properly. Thanks for helping me to clean up all of the other screw ups on my set up. It is asham that freespace uses ogg, I have been trying to find a decent converter for quite awhile, I thought I had one that gave semi good results but obviously not.
-
Karajorma; any reason this can't be used in multi?
*not suggesting xfer for the cutscene though..
The big problem is that there is no easy way to set up the briefing room unless all the players are in it. So if one player stays behind to watch a cutscene they'll probably time out and be disconnected. The only real solution would be to force all the players to watch a cutscene until they all decide to skip.
That makes the code significantly more complicated to implement.
-
Can't we just use a state change packet? similar to the way all clients wait at the end of load or weapons loadout on commit?
-
The problem is the encoding of the video. I downloaded a ogg from the net and using it the mission ran properly. Thanks for helping me to clean up all of the other screw ups on my set up. It is asham that freespace uses ogg, I have been trying to find a decent converter for quite awhile, I thought I had one that gave semi good results but obviously not.
Well, if you can find us a movie codec we can use without licensing issues, go ahead.
Also, Theora is one of the standard codecs, and there are more than enough converters that can produce valid ogg files. VLC, for example. Or avidemux. Or Handbrake.
-
I found a very good converter (not a whole lot of options) called Hyper Video Converter that is free and works really well with my setup.
One question though - is there a way to control the video size in the game or does it always default to full screen?
-
Can't we just use a state change packet? similar to the way all clients wait at the end of load or weapons loadout on commit?
The problem is that the movie code doesn't send out the "I'm still alive" packets that other parts of the code do. So there is no way to tell if the other player is still there watching a movie or has crashed out. I assume that it would be possible make it do so but it's quite a lot of work for something that I suspect most players on multi are just simply going to skip. For the most part people barely bother with the briefings after reading them once.
-
Heh, I suppose you're right, unless it's voice acted, I rarely even bother paying attention to the briefings in the first place ;\
I just figured it might have been a nice idea for how to fix command briefs (by making them videos) / adding cutscenes into the multi campaign conversion but eh