FxVideoRenderObject driving me bald
by Mike Rowley · in Torque Game Engine · 02/10/2007 (3:20 pm) · 5 replies
Would someone [u]Please[/u] explain how this is supposed to work? I'm about to go bald attempting to get this to work. I know it has to be something I'm doing wrong in the script, but I have no clue what.
I followed the instructions exactly. (I know, becouse I have double checked so many times I've lost count)
Here's what I have done:
Placed fxVideoRenderObject.h and .cc in "engine/game/fx" and added to solution.
Clean and build. Sucessful. 0 errors, 0 warnings.
in creator/editor/ObjectBuilderGui.gui [around line 458] (directions said it was in common, but the editor folder in 1.5 is in creator folder)
in creator/editor/EditorGui.cs in [function Creator::init( %this )]
Created "theoraTexture.cs" placed and exec'd it in server/scripts, and added the following code: (note the commented out part was a different approach that gave me the same errors)
Ok, all set. Now, I made a trigger instead of a keypress to activate this control.
Heres the error in the console log:
Does anyone know what I'm doing wrong? I have rebuilt this exe several times now, and nothing changes.
This is the very last thing I need to get working to get this world out the door. Help??
Please??
I followed the instructions exactly. (I know, becouse I have double checked so many times I've lost count)
Here's what I have done:
Placed fxVideoRenderObject.h and .cc in "engine/game/fx" and added to solution.
Clean and build. Sucessful. 0 errors, 0 warnings.
in creator/editor/ObjectBuilderGui.gui [around line 458] (directions said it was in common, but the editor folder in 1.5 is in creator folder)
function ObjectBuilderGui::buildfxVideoRenderObject(%this)
{
%this.className = "fxVideoRenderObject";
%this.process();
}in creator/editor/EditorGui.cs in [function Creator::init( %this )]
%Environment_Item[16] = "fxVideoRenderObject";
Created "theoraTexture.cs" placed and exec'd it in server/scripts, and added the following code: (note the commented out part was a different approach that gave me the same errors)
function serverCmdPlayVideoFile()
{
%filename = "~/data/vid/911tribute.ogg";
$VideoCon.setFile(%filename);
//$VideoCon.playFile(%filename);
echo("Entered Video Area");
}
function serverCmdStopVideoFile()
{
$VideoCon.stop();
echo("Left Video Area");
}Ok, all set. Now, I made a trigger instead of a keypress to activate this control.
//videoTrigger.cs
datablock TriggerData(VideoTrigger)
{
// The period is value is used to control how often the console
// onTriggerTick callback is called while there are any objects
// in the trigger. The default value is 100 MS.
tickPeriodMS = 100;
};
//-----------------------------------------------------------------------------
function VideoTrigger::onEnterTrigger(%this,%trigger,%obj)
{
Parent::onEnterTrigger(%this,%trigger,%obj);
//commandToServer('PlayVideoFile');
serverCmdPlayVideoFile();
}
function VideoTrigger::onLeaveTrigger(%this,%trigger,%obj)
{
Parent::onLeaveTrigger(%this,%trigger,%obj);
//commandToServer('StopVideoFile');
serverCmdStopVideoFile()
}Heres the error in the console log:
wtc/data/missions/WorldTradeCenter.mis (0): Unable to instantiate non-conobject class fxVideoRenderObject. wtc/server/scripts/theoraTexture.cs (8): Unable to find object: '' attempting to call function 'playFile' Entered Video Area wtc/server/scripts/theoraTexture.cs (8): Unable to find object: '' attempting to call function 'playFile'
Does anyone know what I'm doing wrong? I have rebuilt this exe several times now, and nothing changes.
This is the very last thing I need to get working to get this world out the door. Help??
Please??
#2
I'm using This resource and attempting to convert it for use with 1.5 (it was written for 1.3)
The ObjectBuilderGui::buildfxVideoRenderObject(%this) is part of the functions that add this to the editor.
I don't know. The instructions don't say I need to, but I'm asking anyway becouse I'm trying to understand this beast.
I'm trying to learn how all this stuff works.
02/11/2007 (7:09 am)
Hi Frank.I'm using This resource and attempting to convert it for use with 1.5 (it was written for 1.3)
The ObjectBuilderGui::buildfxVideoRenderObject(%this) is part of the functions that add this to the editor.
Quote:Do you need to provide a datablock and instatiate the object by creating a onCreate function?
I don't know. The instructions don't say I need to, but I'm asking anyway becouse I'm trying to understand this beast.
Quote:What is $VideoCon and where is it defined?I believe its a global handle for the video?? I don't know.
I'm trying to learn how all this stuff works.
#3
In the scripts refer to it as
No need for the $ as it is the name of the object (the script examples in the resource dont have a $)
As for the first error - did you rebuild release and debug? It doesnt look as though the engine has found the Implement part on line 50 in fxVideoRenderObject.cc
02/11/2007 (12:53 pm)
Looking through what I wrote (its a while since) - add a videorenderobject to your mission (as in the example in the resource) and give it the name Videocon (as it shows in the resource mission code)In the scripts refer to it as
VideoCon.setFile(%filename);
No need for the $ as it is the name of the object (the script examples in the resource dont have a $)
As for the first error - did you rebuild release and debug? It doesnt look as though the engine has found the Implement part on line 50 in fxVideoRenderObject.cc
#4
Thanks for answering. I did rebuild both debug and release. I added the code for the mission as it was stated in the instructions, but tge was giving me an error that it didn't know what VideoCon was. (hence the global) I didn't name it tho, so that may have been the problem there.
For information, I get the above errors using the release version of the exe. With the debug exe I get a huge screen in the window where there shouldn't be one. :D no movie playing tho. If I can get my pc back up and running again, I'll try naming the mission block and try it again.
Thanks for responding. :)
02/11/2007 (1:02 pm)
Hi David,Thanks for answering. I did rebuild both debug and release. I added the code for the mission as it was stated in the instructions, but tge was giving me an error that it didn't know what VideoCon was. (hence the global) I didn't name it tho, so that may have been the problem there.
For information, I get the above errors using the release version of the exe. With the debug exe I get a huge screen in the window where there shouldn't be one. :D no movie playing tho. If I can get my pc back up and running again, I'll try naming the mission block and try it again.
Thanks for responding. :)
#5
Here's what I have:
I removed the globals ($) above from VideoCon, and made sure that the datablock was in the .mis file. It was.
In release, I get the above error. Using the debug exe, it crashes as soon as I enter the trigger area, and there is a HUGE screen behind everything. I dunno.
Edit I have switched gears and decided to do this: www.garagegames.com/mg/forums/result.thread.php?qt=57993 instead.
02/14/2007 (6:17 pm)
Revisiting now that I have my pc back. Here's what I have:
[b]mis datablock[/b]
new fxVideoRenderObject(VideoCon) {
position = "184.852 161.321 205.319";
rotation = "0.133388 0.133388 -0.982046 91.0378";
scale = "1 1 1";
QuadSize = "5";
ScreenWidth = "240";
ScreenHeight = "130";
QuadRotateSpeed = "0";
Texture = "~/data/interiors/911Texture.png"; //change this to a valid name and path to texture
done = "0";
stopOnSleep = "0";
backgroundColor = "0 0 0 255";
};
[b]Error message[/b]
wtc/data/missions/WorldTradeCenter.mis (0): Unable to instantiate non-conobject class fxVideoRenderObject.
wtc/server/scripts/theoraTexture.cs (7): Unable to find object: 'VideoCon' attempting to call function 'setFile'
Entered Video Area
wtc/server/scripts/theoraTexture.cs (7): Unable to find object: 'VideoCon' attempting to call function 'setFile'I removed the globals ($) above from VideoCon, and made sure that the datablock was in the .mis file. It was.
In release, I get the above error. Using the debug exe, it crashes as soon as I enter the trigger area, and there is a HUGE screen behind everything. I dunno.
Edit I have switched gears and decided to do this: www.garagegames.com/mg/forums/result.thread.php?qt=57993 instead.
Torque Owner Demolishun
DemolishunConsulting Rocks!
ObjectBuilderGui::buildfxVideoRenderObject(%this)
What is this represent?
Is this an object, if this is an object what type?
Do you need to provide a datablock and instatiate the object by creating a onCreate function?
What is $VideoCon and where is it defined?
Maybe I am just not familiar with how the video stuff works.