Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: ChrisWiki on April 01, 2006, 08:48:46 PM

Title: Video question
Post by: ChrisWiki on April 01, 2006, 08:48:46 PM
Hi everybody !

I'm a newbie in Wme and perhaps this question has been solved, but i would know how to insert a video file in the wme 3d Demo so that when a 3D actor enters in an area, the video plays.?

Thanks to everybody !  :)

Regards  :)
Title: Re: Video question
Post by: DukeS on April 02, 2006, 08:05:40 AM
I think that you can do this in scene script where you set up the scene.
Title: Re: Video question
Post by: Mnemonic on April 02, 2006, 12:31:42 PM
Exactly. Edit the scene_init.script of the scene and add something like

Game.PlayVideo("some_file.avi");
 or
Game.PlayTheora("some_file.ogg");

somewhere to the beginning of that script. That way the video will be played when entering the scene.
Title: Re: Video question
Post by: ChrisWiki on April 09, 2006, 10:30:21 AM
Thank a lot for your very quick replies Dukes and Mnemonic  :)

Just two questions, with the wme 3D demo. Is it possible to play the video files only once, so that when the 3D actor enters in a scene the video file doesn't play, if this video file has been played before ? At least I would know how to implement a script so that when the actor enters in a region, a video file plays .

Best regards !  ;)
Title: Re: Video question
Post by: Nihil on April 09, 2006, 08:54:09 PM
Just use a global variable for that, meta wrote a very good tutorial for things like that in the Wiki.
Title: Re: Video question
Post by: Mnemonic on April 10, 2006, 11:16:41 AM
Just two questions, with the wme 3D demo. Is it possible to play the video files only once, so that when the 3D actor enters in a scene the video file doesn't play, if this video file has been played before ?
As nihil said, use a global variable. Set it to true when the video is playing for the first time, and check if the variable is true before playing. Something like:

Code: [Select]
global SomeVideoPlayed;
if(SomeVideoPlayed != true)
{
  SomeVideoPlayed = true;
  Game.PlayVideo("some_video.avi");
}




At least I would know how to implement a script so that when the actor enters in a region, a video file plays .
Regions receive an "ActorEntry" event when the actor enters them. So, attach a script to the region (simply select the region in SceneEdit and click "Scripts..." and "Add script") and add the following piece of code to the script:

Code: [Select]
on "ActorEntry"
{
  Game.PlayVideo("some_video.avi");
}