How to load new level after playing theora video cut scene?
by Path · in Torque Game Builder · 03/07/2009 (2:46 pm) · 10 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.
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.
About the author
Recent Threads
#2
03/09/2009 (4:15 pm)
bump
#4
That won't work since the sceneWindow2d object gets Deleted when you call the endlevel. Taking the scheduled event with it.
You need to call the version of schedule that is Not tied to an instanced object.
Off the top of my head try:
It's a bit confusing at first but there's 2 different schedule commands. One is a method called by an object and the other (is just a scheduled call to a function, which is what you're needing.
03/10/2009 (2:50 pm)
It looks like you're calling the schedule in reference to the sceneWindow2d. That won't work since the sceneWindow2d object gets Deleted when you call the endlevel. Taking the scheduled event with it.
You need to call the version of schedule that is Not tied to an instanced object.
Off the top of my head try:
Schedule(10, 0, loadLevel, expandFilename("~/data/levels/level1.t2d"));
sceneWindow2d.endlevel();for the last 2 line lines inside the Else.It's a bit confusing at first but there's 2 different schedule commands. One is a method called by an object and the other (is just a scheduled call to a function, which is what you're needing.
#5
Here's now both the .gui and the above script with your 2 lines included. Is there something that needs to be added to the .gui?
==============GUI=====================
=============onLevelLoaded function====================
=================================
03/10/2009 (6:41 pm)
No success with the last 2 lines, but also no errors to give me an indication of what needs to be fixed.Here's now both the .gui and the above script with your 2 lines included. Is there something that needs to be added to the .gui?
==============GUI=====================
new GuiTheoraCtrl(MyVideo) {
profile = "GuiDefaultProfile";
horizSizing = "relative";
vertSizing = "relative";
position = "0 0";
extent = "720 486";
minExtent = "8 2";
visible = "1";
done = "0";
stopOnSleep = "1";
backgroundColor = "0 0 0 255";
}; =============onLevelLoaded function====================
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);
Schedule(10, 0, loadLevel, expandFilename("~/data/levels/level1.t2d"));
sceneWindow2d.endlevel();
}
} =================================
#6
there you go path i posted a resource detailing how to do it :) ull probably smack your self once you see how i did it.
03/12/2009 (10:17 pm)
www.garagegames.com/community/resources/view/16617there you go path i posted a resource detailing how to do it :) ull probably smack your self once you see how i did it.
#7
I've collected 95% percent of the code you have on your resource, but the odds of me figuring the proper order & syntax of it on my own was slim to none.
The resource is well laid out and I look forward to putting it into use.
Fantastic job!
If you're interested in growing your status as "Michaelus, the saviour of the forum" [Gladiator reference], there's a company called OSAKit that's designed a web plugin that works with TGB, TGE, & TGEA.
It's available for FREE in it's most basic form and then goes up from $39 depending on the additional features.
The problem is, it only seems to work with TGB games when they're played on cpu's, but not laptops(not sure if this also happens with TGE & TGEA).
It looks like it's a TGB issue. I've seen other threads about problems in general with TGB on the laptop. OSAkit is currently trying to resolve the TGB-laptop conflict, if think you could help here's the guys email and site:
osakit@osakit.com
osakit.com
Obviously having a web plugin available for TGB would be HUGE, especially when used as a stepping stone to gaining the experience, popularity, and funding to create a game for WiiWare & XBoxLive.
03/13/2009 (7:49 am)
Michael-It's actually a partial smack.I've collected 95% percent of the code you have on your resource, but the odds of me figuring the proper order & syntax of it on my own was slim to none.
The resource is well laid out and I look forward to putting it into use.
Fantastic job!
If you're interested in growing your status as "Michaelus, the saviour of the forum" [Gladiator reference], there's a company called OSAKit that's designed a web plugin that works with TGB, TGE, & TGEA.
It's available for FREE in it's most basic form and then goes up from $39 depending on the additional features.
The problem is, it only seems to work with TGB games when they're played on cpu's, but not laptops(not sure if this also happens with TGE & TGEA).
It looks like it's a TGB issue. I've seen other threads about problems in general with TGB on the laptop. OSAkit is currently trying to resolve the TGB-laptop conflict, if think you could help here's the guys email and site:
osakit@osakit.com
osakit.com
Obviously having a web plugin available for TGB would be HUGE, especially when used as a stepping stone to gaining the experience, popularity, and funding to create a game for WiiWare & XBoxLive.
#8
03/13/2009 (10:34 am)
id be more then happy to work with you on this. i dont see a reason why it wouldnt work with laptops. not really any difference in what its using. unless the problem is with vista . i run a macbook pro 17" deul boot xp sp3 osx. the only problem is im in the middle of switching hosts and getting a new domain for my game. so i have no web server at the moment. but their demos work fine on my xp sp3 macbook .
#9
Yeah, I didn't have any problems playing the games on OSAkit's site either, but I think that's because they weren't made with TGB.
How bout this, I can post a link to a simple TGB Tic Tac Toe tutorial game I did and see if it's something you can play easily on your laptop on both IE and FF. That's probably the best place to begin.
As far as switching hosts, I've had a few myself and I'm currently using Ubiquity. It's a good price, and 99.9% up times compared to other low cost servers.
They either own or are apart of the largest Voice Over Internet Protocal company that's used for player headset communications in MMO's and Massive FPS online. Point is they're supposed to be geared for gaming.
03/13/2009 (12:01 pm)
Uggg... I haven't thought about it working with Vista, too.Yeah, I didn't have any problems playing the games on OSAkit's site either, but I think that's because they weren't made with TGB.
How bout this, I can post a link to a simple TGB Tic Tac Toe tutorial game I did and see if it's something you can play easily on your laptop on both IE and FF. That's probably the best place to begin.
As far as switching hosts, I've had a few myself and I'm currently using Ubiquity. It's a good price, and 99.9% up times compared to other low cost servers.
They either own or are apart of the largest Voice Over Internet Protocal company that's used for player headset communications in MMO's and Massive FPS online. Point is they're supposed to be geared for gaming.
#10
TGB may FINALLY have an online plugin!
03/16/2009 (8:52 am)
I just heard back from OSAkit, they say the've fixed the problem, which I'll find out when I get and chance and report.TGB may FINALLY have an online plugin!
Torque Owner Path
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")); } }