Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started 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 :)
-
I think that you can do this in scene script where you set up the scene.
-
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.
-
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 ! ;)
-
Just use a global variable for that, meta wrote a very good tutorial for things like that in the Wiki.
-
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:
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:
on "ActorEntry"
{
Game.PlayVideo("some_video.avi");
}