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: Can't control video in an entity container  (Read 2798 times)

0 Members and 1 Guest are viewing this topic.

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Can't control video in an entity container
« on: March 06, 2010, 12:58:03 PM »

Hi all

In a window there is an entity and in the entity a video runs using PlayTheora(). But most other instructions in the script seem to be ignored and so I can't control the video.

What am I doing wrong? Here's the code from the entity script.

Cheers

Code: [Select]
this.Interactive = true; // Redundant, as Entity already has Active=TRUE
this.SetCursor("sprites\system\ArberthCursors\Action2.sprite"); // NOT executed
//
while(PDA.GoVideo != true) // wait until you're told to play
  {
  Game.Msg("Waiting to start video"); // Works
  Sleep(20);
  }
var a = PDA.Call;  // which video to play?
if(PDA.Call != null)
  {
  if(a =="Tony01")
    {
this.PlayTheora("interface\PDA\Oggs\Tony1.ogg"); // Works
}
  while(this.IsTheoraPlaying())
    {
    Game.Msg("Entity waiting for the video to end"); // TEST - works
    Sleep(20);
    }
  }
PDA.GoVideo = null; // hand control back to the window - works
//
// EVENTS, all ignored
on "LeftClick"
  {
  Game.Msg("LeftClick detected"); // NOT executed
  }
on "MouseEntry"
  {
  this.PauseTheora(); // NOT executed
  }
on "MouseLeave"
  {
  this.ResumeTheora(); // NOT executed
  }
 
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com

Kaz

  • Arberth Studios
  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 228
  • The story is the game
    • View Profile
    • Info on 'Rhiannon' & 'Coven'
Re: Can't control video in an entity container
« Reply #1 on: March 07, 2010, 11:55:38 AM »

Hi all

Stumbled upon a post by Metamorphium that said it can't be done, that Theoras can't be made interactive. The answer is to superimpose an interactive region above the entity displaying the ogg. His example, using a scene, refers the the dynamic creation of an entity. I'm using a window, so I added a button and that works as well.

Code: [Select]
on "Button"
  {
  // var Video = this.GetControl("Video");  // for completeness only - actually happens elsewhere in script
  if(Video != null)
    {
    var v = Video.GetEntity();
    if(v.IsTheoraPlaying())
      {
      v.StopTheora();
      PDA.GoVideo = null;  // just my control variable
      }
    }
  }
Logged
\"Fans of popular horror adventures like Scratches and Barrow Hill should start bracing themselves for another haunting experience, as independent developer Arberth Studios has announced production on its debut title Rhiannon - Curse of the Four Branches.\" - AdventureGamers.com
 

Page created in 0.021 seconds with 20 queries.