another video texture problem...

Ok, so I was able to get everything up and running with video textures perfectly, but a problem has come to me :frowning:

A cutscene plays before the ending boss battle… Once you beat the boss, you gbo to another cutscene, unfortunatly, the cutscene doesn’t play… They play seperatly with no problem, but no after each other…

Since I didn’t want to reveal the ending to my game I used different cutscenes :), just press p to play, it’s suppose to change scenes and play the next cutscene but it doesn’t work… Even though it works great seperatly…

Here’s the example:
http://www.mediafire.com/?mmmm50yyydy

NOTE READ AFTER DOWNLOAD: On scene: cinema3, I forgot to change the extention of the video texture to .mp4 so select the plane in cinema3 scene and change the property video from “//cutscene1_final.mov” to “//cutscene1_final.mp4”

press p in the cinema2 scene…

There is probably a better way to do this but I got it to work by separating each scene into its own file, and using the start new game actuator instead of set scene.

I noticed that even if just the current scene is reset the first video does not play.

The thing is, I can’t change blend files, my game is made for scenes. I’ll try to find a better solution… I think if it’s the script runs more than once… I don’t know how that would work though.

Oh, I think I got it :smiley:


# -- Check if the "video" property has been defined on "GameLogic"
if not hasattr(GameLogic, 'video'):

	# -- Get the material that is using our texture
	matID = VideoTexture.materialID(obj, 'MAvideo')

	# -- Create the video texture
	GameLogic.video = VideoTexture.Texture(obj, matID)

	# -- Get the path to the video file
	movie = GameLogic.expandPath(obj['video'])

	# -- Load the file
	GameLogic.video.source = VideoTexture.VideoFFmpeg(movie)

	# -- scale the video
	GameLogic.video.source.scale = True
	GameLogic.video.source.flip = True

	# -- play the video
	GameLogic.video.source.play()

Where it says, if hasattr, it looks for the property ‘video’, since it’s already made the second time in the script it doesn’t go through the init state :wink:

So, all I have to do is when I change scenes I have to delete a certain property or take away the “if” and it should work… Can a someone correct me if I’m wrong?