Page 1 of 2

Custom In game Movies..how?

Posted: Tue Sep 26, 2006 7:51 pm
by Big_rich
Ive searched throughout the forums here and can't seem to find a guide on how to make and insert your very own custom in game movie. Any one tired it? And if so, how? I have rad tools and can figure out how to convert the avi's but Have no idea on how to get the game to use it.

*edited*

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 2:38 am
by Qdin

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 7:25 am
by Dohnutt
I'm pretty sure he means how to make movies in SWBF2 in general...
If so, then search on Google for GameCam or Fraps. These are both very good screen recording programs.

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 7:33 am
by Big_rich
Great Qdin, thanks! But have you figured out how to put your own custom movies in game yet?

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 4:00 pm
by Qdin
First of all my problem was that I couldn't find any info AT ALL about making my own movies... I have Rad Tools, and when I convert, it don't converst it into the same file as the rest of the shipped ones... :? So maybe that problem should get fixed first? :D I think I'll ask Fred one of these days if he xan help me or not :) He's awesome at explaining :)

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 4:51 pm
by Teancum
Nobody has figured out in-game movies, though we assume it's possible.

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 5:44 pm
by Qdin
Yeah: we AER suppossed to use the Rad tools, and it WAS possible for movies in SWBF1.

the ONLY problem is that I don't know how we should get it into .mvs.... :?

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 6:24 pm
by Big_rich
PlayMovieWithTransition(movieFileName, movieIDName, transitionTime) could it be possible to basically tell it to use a diff ingame.mvs and a diff id?

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 7:03 pm
by Teancum
Theoretically, yes. This came from the Coruscant Campaign lua:

ScriptCB_PlayInGameMovie("ingame.mvs","cormon01")

So you could probably change ingame.mvs to mylevel.mvs or whatever.

Munging the video would probably be easiest using the SWBF1 Tools and Tutorials found here at GT in the SWBF1 modding seciton

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 7:36 pm
by Big_rich
so when you do munge with the BF1 tools, does it create a .mvs file? That's where I am running into trouble, creating the .mvs file through visual munge. Without any templates it's gonna be impossible(i.e. without knowing what munge needs) I've tried adding a mlst and mcfg files to the movies directory in a test map. But it doesn't seem to reconize these files as things needed to create a munge of movies. I also tried editing a munge.bat, but aprently it needs more commands.

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 7:47 pm
by Big_rich

Code: Select all

@REM ===== Handle files in Shell\Movies\
@set SOURCE_SUBDIR=Shell\movies
@set SOURCE_DIR=
@if not %MUNGE_OVERRIDE_DIR%x==x (
	@for %%a in (%MUNGE_OVERRIDE_DIR%) do @set SOURCE_DIR=!SOURCE_DIR! %MUNGE_ROOT_DIR%\%%a\%SOURCE_SUBDIR%
)
@set SOURCE_DIR=%SOURCE_DIR% %MUNGE_ROOT_DIR%\%SOURCE_SUBDIR%

configmunge -inputfile *.mcfg %MUNGE_ARGS% -sourcedir %SOURCE_DIR% -outputdir %MUNGE_DIR% -hashstrings 2>>%MUNGE_LOG%
@move /y configmunge.log configmunge_mcfg.log
for %%A in (%MUNGE_ROOT_DIR%\%SOURCE_SUBDIR%\%MUNGE_PLATFORM%\*.mlst) do moviemunge -input %%A -output %MUNGE_ROOT_DIR%\_LVL_%MUNGE_PLATFORM%\Movies\%%~nA.mvs -checkdate 2>>%MUNGE_LOG%
That's a section of the shell munge.bat in BF2 visual munge. I placed a .mcfg in the old BF1 format as well as a .bik video to the old BF1 specs. It did create a shell in lvl_pc but no mvs file... Idk?

I think I know where I am getting hung on:

Code: Select all

for %%A in (%MUNGE_ROOT_DIR%\%SOURCE_SUBDIR%\%MUNGE_PLATFORM%\*.mlst) do moviemunge -input %%A -output 
that line right there. In the old BF1 docs it says the .mlst file contains the following line:
..\..\_SOURCE_PC\shell\movies\modidfly.bik

Course we have no _Source_PC folder. Any ideas on what folder it will use? If we get this we can munge these movies. Cause the rest looks on in the munge.bat for the shell.

This is the munge log:
Shell\munge PC
Munging Fi1.mcfg
Munging Shell.req
Notice no .mvs output cause I'm figuring that the line I used:

..\..\_LVL_PC\shell\movies\fi1.bik in the .mlst file isn't right.

Nevermind I did get it right. It doesn't save the .mvs file to shell\movies like I thought. It auctually creates a new folder in _lvl_PC called Movies and puts your new .mvs file into their. Now I got the .mvs file created all I have to do it figure out how to get it in game. I will work on it and post back.

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 8:51 pm
by [RDH]Zerted
If you got it munged, they we can add them in. Don't forget about ReadDataFile() before trying to use your new movie.

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 8:52 pm
by Teancum
I'd just munge it with the BF1 tools and then copy the completed .mvs file over to your BF2 project.

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 9:51 pm
by Big_rich
Well, Zerted, I can't figure out how to get it to play.

I put a new directory in addon\modid\_lvl_PC\Movies then put my .mvs file in it. This is what I added to my lua.

function ScriptPostLoad()
ReadDataFile("dc:movies\\film1.mvs")
ScriptCB_PlayInGameMovie("film1.mvs", "fort")

--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}

Any ideas on how to get the script to run it?
Here is the bf2modtools log (fort is the .bik movie)
Message Severity: 2
.\Source\GameMovie.cpp(399)
Unable to find open movie segment fort

I know the stupid thing is being munged because the mvs file is about the same size as the bnk.

RE: In game Movies..how?

Posted: Wed Sep 27, 2006 11:45 pm
by [RDH]Zerted
The error is "Unable to find open movie...". I'm guessing you need to open the movie first. There is a ScriptCB_OpenMovie() function. Try that. I don't have time to look and see how the shell opens movies at the moment. I'll get around to it if OpenMovie() doesn't work.


Some functions of interest:
ReadDataFile()
ReadDataFileInGame()
ScriptCB_AreMoviePropertiesPlaying()
ScriptCB_CloseMovie()
ScriptCB_IsMoviePlaying()
ScriptCB_OpenMovie()
ScriptCB_PlayInGameMovie()
ScriptCB_PlayMovie()
ScriptCB_SetMovieAudioBus()
ScriptCB_StopMovie()

------------------------
Taken from retail scripts:
ScriptCB_OpenMovie("movies\\bonus.mvs", "")
ScriptCB_OpenMovie("movies\\bonuspal.mvs", "")
ScriptCB_OpenMovie("movies\\fly.mvs", "")
ScriptCB_OpenMovie("movies\\his.mvs", "")
ScriptCB_OpenMovie("movies\\hispal.mvs", "")
ScriptCB_OpenMovie("movies\\meta.mvs", "")
ScriptCB_OpenMovie(dcPrefix .. "movies\\" .. movieFile .. pal .. ".mvs", "")
ScriptCB_OpenMovie(gMovieStream, "")
ScriptCB_OpenMovie(gMovieStream, "");
ScriptCB_OpenMovie(mission.intro[1], "") -- was gMovieStream
ScriptCB_OpenMovie(mission.transition[1], "")
ScriptCB_OpenMovie(movieFile, "")
ScriptCB_OpenMovie(movieFile, "");
ScriptCB_OpenMovie(movie_file, "")
ScriptCB_OpenMovie(movie_name, "")

RE: In game Movies..how?

Posted: Thu Sep 28, 2006 12:07 am
by Big_rich
ScriptCB_OpenMovie("dc:movies\\film1.mvs","")


OpenMovie causes the map to crash(with and without dc:) with this error in the BF2modtools log:

Message Severity: 3
.\Memory\RedMemory.cpp(561)
attempted to allocate from invalid heap -1

Message Severity: 3
.\Memory\RedMemory.cpp(538)
Allocating 107 bytes failed - no free blocks left in Heap -1 ()


I even tried to steal artist heap in script int, but movies are loaded in postload so I kinda figured that wouldn't work.

RE: In game Movies..how?

Posted: Thu Sep 28, 2006 12:10 am
by Teancum
Dunno if this will make a difference, but ReadDataFile("dc:movies\\film1.mvs") Should go under function ScriptInit() and not function ScriptPostLoad()

RE: In game Movies..how?

Posted: Thu Sep 28, 2006 12:13 am
by Big_rich
I tried that tean, but still no luck. You have experiance adding movies to BF1, did you have to script them into the old system? Or did it just work? I checked out some of the old scripts and diddn't find any entries on movies, kinda makes me wonder how BF1 use to do it.

RE: In game Movies..how?

Posted: Thu Sep 28, 2006 12:26 am
by Teancum
post your mcfg

Posted: Thu Sep 28, 2006 12:41 am
by Big_rich
shell1.mcfg:

Code: Select all

// transition times used by all movies
MovieProperties()
{
    Name("transition_template");
    FadeInTime(0.0);
    FadeOutTime(0.2);
}

MovieProperties()
{
    Name("screen_template");
    FadeInTime(0.1);
    FadeOutTime(0.5);
}

MovieProperties()
{
    Name("flythrough_template");
    FadeInTime(1.0);
    FadeOutTime(1.0);
}

//-----------------------------------------------------------------------------
//- Shell screen background movies

// Pandemic Logo
//MovieProperties()
//{
//     Name("pandemic_logo");
//     Inherit("transition_template");
//     Movie("shell");
//     SegmentList()
//     {
//        Segment("pandemic_logo", 1.0, 0);
//     }
//}

//MovieProperties()
//{
//     Name("temp_shell");
//     Inherit("screen_template");
//     Movie("shell");
//     SegmentList()
//     {
//        Segment("temp_shell", 1.0, -1);
//     }
//}

//MovieProperties()
//{
//     Name("shell_main");
//     Inherit("screen_template");
//     Movie("shell");
//     SegmentList()
//     {
//        Segment("shell_main1", 1.0, -1);
//        Segment("shell_main2", 1.0, -1);
//     }
//}
//
//MovieProperties()
//{
//     Name("shell_sub_left");
//     Inherit("screen_template");
//     Movie("shell");
//     CyclePlayback(1)
//     SegmentList()
//     {
//        Segment("shell_suball1", 1.0, 0);
//--        Segment("shell_suball2", 1.0, 0);
//        Segment("shell_subcis1", 1.0, 0);
//        Segment("shell_subcis2", 1.0, 0);
//        Segment("shell_subimp1", 1.0, 0);
//        Segment("shell_subimp2", 1.0, 0);
//        Segment("shell_subrep1", 1.0, 0);
//        Segment("shell_subrep2", 1.0, 0);
//     }
//}

// Crawls

MovieProperties()
{
     Name("fort");
     Inherit("screen_template");
     Movie("film1");
     SegmentList()
     {
        Segment("fort", 1.0, 0);
     }
}

Film1.mlst:

Code: Select all

..\..\shell\movies\fort.bik 
bik file is called fort.bik

Shell.req:

Code: Select all

ucft
{
    REQN
    {
        "config"
       "shell1"
    }
}
I get the transition, the black pause once the map is loaded.. it just goes straight to the choose sides phase(skipping the movie). That with just adding the:ScriptCB_PlayInGameMovie("dc:movies\\film1.mvs", "fort") in the.lua