Game Development Community

How to load new level after playing theora video cut scene?

by Path · in Torque Game Builder · 03/07/2009 (2:45 pm) · 1 replies

I've been able to piece together the code needed to play my theora file as a cutscene in between levels.

Now I can't get it to unload, delete, delete scene, and load new level.

I've used code that works in other situations(control functions from the GuiAviBitpamCtrl), but I simply can't find the script that will actually get a hold of the GuiTheoraCtrl(MyVideo) and make it stop, load new level, etc.

Suggestions?

I've combed 8 threads deep into the subject and still can't find what I'm looking for.

#1
03/07/2009 (7:36 pm)
Any suggestions on how to make this code work for closing out my Theora video(plays fine) and going to the next level?

function MyVideoBehavior::onLevelLoaded(%this, %scenegraph)
{
     exec("~/gui/THEORATEST.gui");
     
        if ($playingVideo != 1)

   {
canvas.getContent().add(MyVideo);
      
Canvas.hideCursor();

      MyVideo.setFile("./game/data/images/TEST3.ogm");
   }
   else
   {
      Canvas.showCursor();
      MyVideo.stop();
      canvas.getContent().remove(MyVideo);    	
      sceneWindow2D.schedule(0, endLevel);
	   sceneWindow2D.schedule(1, loadLevel, expandFileName ("~/data/levels/level1.t2d"));
   }
}