Playing FMV (video file) at start/end of scenario

Modding, Map Editor, IES Scripting and Other Questions
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: Playing FMV (video file) at start/end of scenario

Post by Dr.MonaLisa »

Maybe that's what functions "PrintSubtitle()", "PrintFormattedSubtitle()" are for :)
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains

Sat42
Posts: 129
Joined: 03 Dec 2018, 18:01
Has thanked: 6 times
Been thanked: 1 time

Re: Playing FMV (video file) at start/end of scenario

Post by Sat42 »

Dr.MonaLisa wrote: 12 Nov 2020, 01:25 Maybe that's what functions "PrintSubtitle()", "PrintFormattedSubtitle()" are for :)
Aha! Yes might be worth experimenting with those - thanks for bringing them to light! :P It would make for an interesting exercise actually, since every "print" would have to be accompanied by a strict timing function (timing determined when editing actual video beforehand of course) before firing the next print or simply a "clear" function of some sort... hmm, will need to make tests with a dummy video for sure!

I actually found the dbtext_subtitles.utf8 in db[zip folder] -> db -> Text and that is likely where my subtitles would have to go if I go down this route.

FYI: after much internal deliberation, I started working on a single (history-based) scenario for EEII (not expansion) that a priori doesn't require lots of modding (certainly none that would affect things outside of my scenario) in the hopes that it could eventually be released officially on Normal patch 1.5 for a greater audience to enjoy. This scenario requires only IES scripts, two new BIK files for the movies folder, and the ability to add new territory names to dbtext_territory_names.utf8 (for example under // CUSTOM SCENARIO TERRITORY NAMES) and new city names for city centres pre-positioned on the map (I don't know where I can add new city centre names so that EEII recognises the line "tx_ms_cityname_YourCityName" as a valid label, but I'll open another topic for that). I will create a topic for this scenario when it is more advanced.
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: Playing FMV (video file) at start/end of scenario

Post by Dr.MonaLisa »

Sat42 wrote: 12 Nov 2020, 12:01have to be accompanied by a strict timing function (timing determined when editing actual video beforehand of course) before firing the next print or simply a "clear" function of some sort... hmm, will need to make tests with a dummy video for sure!
I think you should read the scripting document again. They provided an example on how to do it. All that is needed is "DoDelay()" after the .bik file starts playing. Shouldn't be that hard :)
I actually found the dbtext_subtitles.utf8 in db[zip folder] -> db -> Text and that is likely where my subtitles would have to go if I go down this route.
You need to stop guessing and start reading:
To add an entry to the text db, you need to download and use an editing program like BabelPad™ and make sure you save the file with the prefix "usertext" as in usertext_myscenario.utf8. Next, make a folder called "db" in your "EE2\Run" directory and drop the .utf8 file in a "Text" folder within the "db" folder. Next, start making up strings:

usertext_myscenario_beginning,"""In the beginning…"""
usertext_myscenario_cornchips,"""there were plenty of corn chips…"""
etc…

Make sure you end the file with a hard return, or else you'll likely get some kind of error.

Then, in your script, anytime you want to show some text, you call a the appropriate string:
So it can be any new .utf8 file, no need to edit existing ones.
FYI: after much internal deliberation, I started working on a single (history-based) scenario for EEII (not expansion) that a priori doesn't require lots of modding (certainly none that would affect things outside of my scenario) in the hopes that it could eventually be released officially on Normal patch 1.5 for a greater audience to enjoy. This scenario requires only IES scripts, two new BIK files for the movies folder, and the ability to add new territory names to dbtext_territory_names.utf8 (for example under // CUSTOM SCENARIO TERRITORY NAMES) and new city names for city centres pre-positioned on the map (I don't know where I can add new city centre names so that EEII recognises the line "tx_ms_cityname_YourCityName" as a valid label, but I'll open another topic for that). I will create a topic for this scenario when it is more advanced.
In this case, you can use file: zips\dbtext_cheats.utf8 (EDITED IN: Unofficial Patch Files\EXEGeneratorData\TextsSource.txt ). Once you finish editing, then delete zips\dbtext_cheats.utf8 so it gets re-generated. There are free entries:
tx_futuretext24,""""""
tx_futuretext25,""""""
tx_futuretext26,""""""
tx_futuretext27,""""""
tx_futuretext28,""""""
tx_futuretext29,""""""
tx_futuretext30,""""""
tx_futuretext31,""""""
tx_futuretext32,""""""
Which can be used by other scenarios which are included to UP1.5.

However, .bik files won't be included in the patch installer. There is no way to waste the space like this. I had to refuse such propositions many times, even from Loew who put a lot of time in moding EE2. So it can either be a separate scenario-mod downloaded from the forum post (I recommend this), or have very limited features to not ruin UP1.5 backward compatibility (no new files allowed) and not use disk space senseslessly.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Sat42
Posts: 129
Joined: 03 Dec 2018, 18:01
Has thanked: 6 times
Been thanked: 1 time

Re: Playing FMV (video file) at start/end of scenario

Post by Sat42 »

Hehe I thought there might be an issue with including the .bik files in the patch installer! I understand - yes the best is to make a separate scenario-mod in its own thread (a kind of "director's cut") for the videos, and a "map-only" version can be worked on for inclusion in the patch installer.

All good! Exciting stuff, thanks again for the guidance here :)
Sat42
Posts: 129
Joined: 03 Dec 2018, 18:01
Has thanked: 6 times
Been thanked: 1 time

Play a .bik movie at the beginning or end of scenario

Post by Sat42 »

Greetings!

So in my spare time I have managed to create a .ies file for a test scenario that can already do a lot of the things I need to implement for my scenario ideas...

One of my ambitions is to create an honest to goodness pair of .bik movies for the intro and outro (in that documentary style like the official scenarios).

I came across this for the .ies implementation:

Code: Select all

INITIALIZATION 

// Lots of other things...

//If you're all fancy, you can play a .bik movie at the beginning of your scenario. 
// Just drop it in the "Movies" folder and then call it...

StartPlayingCinematic("kor_1_intro");			// find out how to reference a cinematic!!

// ResetFogOfWar(HUMAN_PLAYER);		               // only once you figure out how to properly ref a cinematic so that it plays

// StopAllScriptSounds();															// see above
// ClearSubtitle();																	// see above
// ToggleStreamingMusic(false);														// see above

// initial camera, after cinematic
SetCameraDistanceFraction(1, false);
SetCameraHeading(90, false);
SetCameraLookAtArea("areaCameraStart", false);
SetCameraLookAtArea("areaCameraStart", true);

END_INITIALIZATION
The above doesn't work. The FMV movie doesn't play, even though it is in the "Movies" folder and is in fact called "kor_1_intro".

Can someone help me understand how to call, or rather how to properly reference a cinematic with the StartPlayingCinematic call?

Thanks a bunch!

Added after 7 minutes 36 seconds:
(Apologies for creating a new thread when there's already an old thread: viewtopic.php?f=54&t=5402

You may merge this with the old thread!)
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: Playing FMV (video file) at start/end of scenario

Post by Dr.MonaLisa »

Hi.

Maybe it should be named "kor_1_intro.bik" instead? I think Loew was doing something similar so I'll forward the link to him.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Sat42
Posts: 129
Joined: 03 Dec 2018, 18:01
Has thanked: 6 times
Been thanked: 1 time

Re: Playing FMV (video file) at start/end of scenario

Post by Sat42 »

Hey Mona :)

So I just tested again to check: whether it's "kor_1_intro.bik" or simply "kor_1_intro" (of course, each time I made the change to the .ies file I reloaded it inside the editor for the test map and saved), the game says there is a script error:
In INITIALIZATION section: StartPlayingCinematic:
Can't find cinematic 'kor_1_intro.bik'. (nor 'kor_1_intro')

The rest of the script works no prob.

Thanks for forwarding this to Loew! :)
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: Playing FMV (video file) at start/end of scenario

Post by Dr.MonaLisa »

Generally, cinematics are recorded using Tools -> Cinematic Splines.

Maybe it's an error in the scripting document?

I found this: viewtopic.php?p=23675#p23675

There's an interesting function "Playbink()". Could you please check if it works?
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Sat42
Posts: 129
Joined: 03 Dec 2018, 18:01
Has thanked: 6 times
Been thanked: 1 time

Re: Playing FMV (video file) at start/end of scenario

Post by Sat42 »

Yo thanks Mona! this could be the key...

OK made a test:
- if in your initialization section, you have:

Code: Select all

PlayBink(kor_1_intro.bik);
then in editor, upon loading the script and accepting it in mission properties, you get a pop-up "unexpected char: 'b'" at column 22 (so where the term 'bik' starts)
- if in your initialization section, you have:

Code: Select all

PlayBink(kor_1_intro);
then in editor, upon loading the script and accepting it in mission properties, you get a pop-up "variable 'kor_1_intro' not found" again flagged at the right position

As a result, adding PlayBink(kor_1_intro.bik) or PlayBink(kor_1_intro) makes the editor freak out and the game won't load the script so the scenario retains the last "functioning" script I had loaded, something I verified when testing the scenario and getting the error about StartPlayingCinematic despite having commented out StartPlayingCinematic in the updated script (and even for the sake of the comments, I changed it to " StartPlayingCinematic("In_game_engine_cutscene") ")

So yeah it definitely detects PlayBink but for some reason we don't yet have the right convention for calling the FMV movie.

Added after

I am a fool - PROBLEM SOLVED

- in your initialization section, use::

Code: Select all

PlayBink("kor_1_intro.bik");
then your script is accepted (successfully loaded, no error message) and the .bik movie will play when starting the scenario!!

Added after 4 minutes 15 seconds:
So the following is the right convention:
- in the INITIALIZATION section of the .ies script:

Code: Select all

PlayBink("your_movie.bik");
Just remember to place "your_movie.bik" in the "movies" folder!

Added after 35 seconds:
Thank you again Mona :D

Added after 4 minutes 49 seconds:
Naturally, there's no reason you shouldn't be able to call the PlayBink function for when the player wins, you'll just have to call it in the Rule and Action for the victory condition.
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: Playing FMV (video file) at start/end of scenario

Post by Dr.MonaLisa »

Glad that you solved it.

Yes, the file extension (e.g. ".bik") is usually needed for filenames.

Code: Select all

PlayBink(kor_1_intro);
Was incorrect, because kor_1_intro is understood as a variable here. So the correct syntax would be:

Code: Select all

string kor_1_intro = "kor_1_intro.bik";
PlayBink(kor_1_intro);
Or as you simply noticed:

Code: Select all

PlayBink("kor_1_intro.bik");
Please be aware that cinematics / .bik movies will often cause Out of Sync problems if you're developing Multiplayer scenarios. It's because they'll have different time synchronization depending on machine :( But for SinglePlayer it should be all fine.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
These users thanked the author Dr.MonaLisa for the post:
Sat42
Post Reply

Return to “Questions”