Click to See Complete Forum and Search --> : Movies


Chris P
August 24th, 2001, 08:54 AM
I have programmed a game so that when the player wins they see a video. But i don't want them to be able to go into the game folder and watch the video until they win. The video is 98 MB so resource files are kinda of out of the question (unless someone knows how to use one with that big of a file) I want to play the video with windows media player. How can I make it so they can't see the video until they win?

ketchikan2
August 29th, 2001, 01:15 AM
I may be totally wrong as I am a total newbie to programming but couldnt you setup a password to protect activation and then call that password from within your code ? just a thought. Bryan

HEEELLLP !!! I am Brand new to programming and desperately need someone to take my hand (no not literally LOL) I have sooo many questions and no answers. can ya please help me ?

Cakkie
August 29th, 2001, 01:56 AM
You might 'disable' the movies. Most movies don't play when the header is messed up, so mess it up. Say like adding a few character to the beginning of the file. Then, when you are about to play the movie, remove the chars. After playing, add them again.

private Sub EnableMovie(strFilename as string, strFileNameOut as string)

Dim FFileIn as Integer
Dim FFileOut as Integer

FFileIn = Freefile
Open strFileName for binary Access Read as #FfileIn

FFileOut = Freefile
Open strFileNameOut for Output as #FfileOut

print #FFileOut, input(FileLen(strFileName)-1,#FfileIn);

Close #FfileIn
Close #FFileOut

End Sub



This code opens a file, removes the first character, and writes the rest to another file. You could use this to enabled a movie, write it to nother file, and open that file. The only thing you need to do is to disable your movies by adding 1 character at the beginning, and remove the outfile after use.

EnableFile App.Path & "\level2.dat", App.Path & "\movie.avi"
SomeSubThatPlaysTheMovie
Kill App.Path & "\movie.avi"



This way, you can also give your movies another name (like .dat) which also doesn't draw very much attention.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook