Author Topic: How to add new movies to a mod!  (Read 6346 times)

Offline SConrad

  • Spellhold Director
  • Planewalker
  • *****
  • Posts: 130
  • Gender: Male
  • WeiDU (ab)user
    • Spellhold Studios
How to add new movies to a mod!
« on: February 26, 2005, 09:02:46 AM »
Introduction
Movies are an important part of the gaming experience, but have so far been rarely used in mods and the process of installing them has been flawed and incomplete. This tutorial is based on my own experimenting with movies and how to flawlessly install them to ensure maximum compatibility. I've simplified the process as much as I can, and am proud to say that I've managed to find a way still moderatly easy for modders to use.

Disclaimer: The .mve format is copyrighted by the no longer existing Interplay. If you are unsure or doubtful as to use the format with regards to the copyright laws in your country, it's better to be safe than sorry and don't use it at all.

Section 1: Programs needed
WeiDU
AVI to Interplay MVE converter
Text editor

Section 2: The movie
The most complicated step is the one I won't cover in this tutorial. Creating a movie is not very easy, and I'm personally not an expert of any kind.

What you need, though, is a movie in the .avi-format, no larger than 640x480 pixels.

Section 3: Converting the movie to .mve format
Here, you will need the .avi to .mve-converter, found here. It's a relatively easy program to use, and it's not more complicated to use this program than it is to traify a .d-file with WeiDU.

Here's what to do:

1. Put the avi2mve.exe in any folder.

2. Take the .avi you wish to convert and put it in the same folder.

3. Open up the windows command-prompt, and enter the directory to where you have the avi2mve.exe. Here's how it works:

Code: [Select]
C:\Directory\avi2mve.exe movie.avi [foo.mve] [additional options]
The things in [brackets] are optional and not needed. Let's break down the line:

Code: [Select]
C:\Directory\
This is the directory where you have the avi2mve.exe

Code: [Select]
avi2mve.exe
This instructs Windows to run this specific program.

Code: [Select]
movie.avi
This tells the program which .avi-movie you want to convert.

Code: [Select]
[foo.mve]
If you want the movie to have another filename instead of the same name as the .avi, this is where you enter the new filename, with the .mve-extension.

Code: [Select]
[additional options]

There is a few very useful optional options, found if you double-click the avi2mve.exe. The most useful in my opinion is [-size megs].

Let's have an example, then:

Code: [Select]
C:\Directory\avi2mve.exe movie.avi SC#mov1.mve -size 5
This will take the movie.avi, convert it into a .mve-file called SC#mov1.mve with the maximum size of 5 megabytes.

4. In the same directory, you will now have your .mve, as well as a .pal. That is a palette-file, and not needed. You can safely delete it or neglect to have it with your .mve when you add it to the mod later on.

Other useful tips: If no size-limit is specified, the .mve will be a few megabytes larger than the .avi. Try to keep the sizes down, out of sympathy for all dial-up players.

Section 4: Using WeiDU to install the movie
We encounter a problem pretty fast when trying to make the movie appear ingame. Normally, you slap the files into the override when you install them, but that's not possible with movies - the game won't read them from anywhere else than a .bif. So, we need to create a .bif.

Normally, .bif-altering mods are practically incompitable with other mods of different kinds, if you've already biffed the files and provide a custom chitin.key. The method for biffing files at install (as used in CtB, for example) was very flawed and made it virtually impossible to uninstall the mod. So, seeing as I both wanted to keep down the size of the mod, as well as making it easy to install and, more importantly, to uninstall, I deviced a new way to biff files.

As you can't biff files with WeiDU from the .tp2, we need to work around this with .bat-files. This works the same way as when you want to decode .ogg-files to .wav-files; you create an install.bat and an uninstall.bat.

Here's how they look, install.bat first:

Code: [Select]
@echo off
@ECHO Installing movies

mkdir Foo\Backup\Chitin-Key-Backup-Do-Not-Delete-For-The-Love-Of-God
copy chitin.key Foo\Backup\Chitin-Key-Backup-Do-Not-Delete-For-The-Love-Of-God
mkdir SC#Movie
copy Foo\Movies\*.mve SC#Movie
copy setup-foo.exe foo.exe
foo --make-biff SC#Movie
del foo.exe
rmdir SC#Movie /S /Q

@ECHO Finished installing movies

Let's break it down, once again:

Code: [Select]
@echo off
@ECHO Installing movies

This echoes the string "Installing movies" in the command-prompt window

Code: [Select]
mkdir Foo\Backup\Chitin-Key-Backup-Do-Not-Delete-For-The-Love-Of-God
Just for the sake of taking precautions, let's make a backup for the chitin.key. We start that off by making a directory inside the Backup-folder of the mod.

Code: [Select]
copy chitin.key Foo\Backup\Chitin-Key-Backup-Do-Not-Delete-For-The-Love-Of-God
Then, we simply copy the chitin.key into that folder.

Code: [Select]
mkdir SC#Movie
Then, to begin installing the movies, we create a new folder in the main BGII-directory. Don't worry, it won't be here for long, it's only temporary.

Code: [Select]
copy Foo\Movies\*.mve SC#Movie
Foo\Movies\ is the directory where you have the mve-file(s) you wish to include in the mod. Here, we copy these files to the SC#Movie-folder.

Code: [Select]
copy setup-foo.exe foo.exe
Next, we make a copy of the Setup-Foo.exe the player just clicked to install the mod called foo.exe.

Code: [Select]
foo --make-biff SC#Movie
As foo.exe is a copy of weidu.exe, we'll use it to biff the folder SC#Movie, using the WeiDU-command --make-biff. We can't use Setup-Foo.exe, since executing this file to do this instead would make the the mod-installation launch again. And we don't want that.

Code: [Select]
del foo.exe
Delete the "extra" copy of WeiDU.

Code: [Select]
rmdir SC#Movie /S /Q
Remove the SC#Movie directory, and all the files in it. /S indicates that it'll delete all files inside the folder, and /Q makes sure it doesn't ask the user that.

Code: [Select]
@ECHO Finished installing movies
Echo the string "Finished installing movies".

Now, let's go over the uninstall.bat:

Code: [Select]
@echo off
@ECHO Uninstalling movies

copy setup-foo.exe foo.exe
foo --remove-biff data\SC#Movie.bif
del foo.exe
del data\SC#Movie.bif /F /Q

@ECHO Finished uninstalling movies

And we'll break this down, as well:

Code: [Select]
@echo off
@ECHO Uninstalling movies

Echoes the string "Uninstalling movies" in the window.

Code: [Select]
copy setup-foo.exe foo.exe
Once again, we make a copy of Setup-Foo.exe, of the same reason as last time.

Code: [Select]
foo --remove-biff data\SC#Movie.bif
And then we have foo.exe use the WeiDU-command --remove-biff for the SC#Movies.bif.

Note that this is one of the many functions Weimer has marked as "Don't use this", but we do it anyway.

Code: [Select]
del foo.exe
Delete the extra WeiDU-file.

Code: [Select]
del data\SC#Movie.bif /F /Q
Remove the .bif from the data-folder. Since it's read-only, we use /F to force it to delete anyway. /Q is quiet-mode, to not have the .bat prompt the user.

Code: [Select]
@ECHO Finished uninstalling movies
Echoes the string "Finished uninstalling movies".

Now, treat these as any other install/uninstall.bat's, by putting them into the main folder of the mod (or even inlining them in the tp2) and adding the following to the .tp2:

Code: [Select]
COPY ~Foo/install.bat~ ~install.bat~
COPY + ~Foo/uninstall.bat~ ~uninstall.bat~

AT_INTERACTIVE_EXIT ~install.bat~
AT_UNINSTALL ~uninstall.bat~

Not that complicated, I hope?

Section 5: Scripting the movie to appear ingame
IESDP: 167 StartMovie(S:ResRef*)

So, the correct script would be:

Code: [Select]
IF
     True()
THEN
     RESPONSE #100
           StartMovie("SC#Movie")
END

Anything else? Don't think so, but never hesitate to ask in the help forums!

© Copyright Sebastian Conrad 2005.
« Last Edit: June 29, 2005, 02:50:01 PM by jcompton »
sconrad.net

jcompton: "When did the switch flip in your brain that made this make sense to you?"

Spellhold Studios - Where the switch flipped in our brains that made things make sense!

Offline al17

  • Planewalker
  • *****
  • Posts: 11
Re: How to add new movies to a mod!
« Reply #1 on: March 12, 2005, 11:16:30 AM »
I just want to add that there is a minimum requirement of frame per second, otherwise your movie will be very fast.

I mean... 10 frames, one every second and you will see a 0.2 second movie :)

unlucky I don't remember the minimum number of frame per second, but I think it's near 10

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: