PlayThread call not working
by Faraz Ahmed · in Torque Game Engine · 01/11/2006 (9:21 am) · 1 replies
Newbie alert! I have spent way too much time trying to debug why my playthread call to animate an object in my mission is not working. It animates correctly in the ShowTool. I'll detail out my setup here and it would be great if someone experienced can offer new clues as to where i might be going wrong:
1) i have placed two test animatable objects of the same type into my mission, the datablock for this object type was declared as:
[in the file server/scripts/batsmanexporttest.cs]
2) the two instances have been created in the mission file like this:
[in the file data/missions/crprototype.mis]
3) the data\shapes\directory has the following folder & files in it
4) the code inside batsmanexportest.cs is
5) i load the mission, open the console and enter the following commands & get the following responses:
(I basically get no error code or response and i also dont see the the onguy animation on my screen)
6) oh yes and game.cs in the server directory was modified to include the call to exec("./batsmanexporttest.cs");
I'm really new to torque so must be missing something fundamental here. In the show tool i first load the DTS batsmanexporttest.dts and then the dsq wide.dsq. When i load the dsq, it finds a sequence called sequence01 and plays it fine. Help much appreciated!
Faraz
1) i have placed two test animatable objects of the same type into my mission, the datablock for this object type was declared as:
[in the file server/scripts/batsmanexporttest.cs]
datablock StaticShapeData(MyGuy)
{
category = "Misc";
shapeFile = "~/data/shapes/batsmanexporttest/batsmanexporttest.dts";
};
function StaticShapeData::create(%block)
{
%obj = new StaticShape()
{
dataBlock = %block;
};
return(%obj);
}2) the two instances have been created in the mission file like this:
[in the file data/missions/crprototype.mis]
new StaticShape(offguy) {
position = "64.272 -218.387 100.87";
rotation = "1 0 0 0";
scale = "0.02 0.02 0.02";
dataBlock = "MyGuy";
};
new StaticShape(onguy) {
position = "73.8132 -213.248 100.87";
rotation = "1 0 0 0";
scale = "0.02 0.02 0.02";
dataBlock = "MyGuy";
};3) the data\shapes\directory has the following folder & files in it
batsmanexporttest\batsmanexporttest.dts batsmanexporttest\batsmanexporttest.cs batsmanexporttest\wide.dsq
4) the code inside batsmanexportest.cs is
datablock TSShapeConstructor(MyGuy)
{
baseShape = "~/data/shapes/batsmanexporttest/batsmanexporttest.dts";
sequence0 = "~/data/shapes/batsmanexporttest/wide.dsq wide";
};5) i load the mission, open the console and enter the following commands & get the following responses:
command: echo(onguy.position); response: 73.8132 -213.248 100.87 command: onguy.playThread(0, "wide"); response:
(I basically get no error code or response and i also dont see the the onguy animation on my screen)
6) oh yes and game.cs in the server directory was modified to include the call to exec("./batsmanexporttest.cs");
I'm really new to torque so must be missing something fundamental here. In the show tool i first load the DTS batsmanexporttest.dts and then the dsq wide.dsq. When i load the dsq, it finds a sequence called sequence01 and plays it fine. Help much appreciated!
Faraz
Torque Owner Bruno Grieco