Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Video question  (Read 3943 times)

0 Members and 1 Guest are viewing this topic.

ChrisWiki

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 20
    • View Profile
Video question
« 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  :)
Logged

DukeS

  • WME User
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 20
  • I'm Guybrush, a mighty pirate!
    • View Profile
Re: Video question
« Reply #1 on: April 02, 2006, 08:05:40 AM »

I think that you can do this in scene script where you set up the scene.
Logged
How to code right if alignment is set left ...

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Video question
« Reply #2 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.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

ChrisWiki

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 20
    • View Profile
Re: Video question
« Reply #3 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 !  ;)
Logged

Nihil

  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re: Video question
« Reply #4 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.

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Video question
« Reply #5 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");
}
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.023 seconds with 24 queries.