Game Development Community

Animated DTS viewer problem

by Stefan Beffy Moises · in Torque Game Engine · 02/29/2004 (12:22 pm) · 22 replies

Hey there,
I am using the Animated DTS viewer and having problems with mounting shapes to the main model...
I am mounting 4 wheels to car shapes, and when I open the gui all 4 wheels are rendered as they should... but when I switch through the cars, weird things happen... sometimes it would work for like 2 or three cars, but then, wheels start to disappear, the positions get screwed up, etc. ... the next time, it works, then another wheel is missing, etc. etc. its totally weird and totally random... but the rendering code for the mounted shapes seems to be called everytime and I really cant find any error there... any idea what might be the problem? maybe some shape caching deep down in the engine?
Here are some pics to illustrate the problem...
tork.beffy.de/uploads/pics/car01.jpg
tork.beffy.de/uploads/pics/car02.jpg
tork.beffy.de/uploads/pics/car03.jpg
Page «Previous 1 2
#1
02/29/2004 (12:46 pm)
And yes, this is the same car, the same gui, I've only switched through the cars two or three times... ;)
#2
02/29/2004 (1:21 pm)
Weird. Are you making sure that you're unmounting and remounting them every time you choose a new model?
#3
02/29/2004 (10:47 pm)
Yeah, tried everything, currently when I step through the cars, I unmount the wheels,
change the car, and remount the wheels... but no matter what I do, they always disappear randomly.... :(
function unMountWheels()
{
   for(%i=0;%i<4;%i++)
   {
      view.unmountObject("", "hub"@%i);
   }
}

function mountWheels()
{
   %currWheel = $wheelshape[$currCar];
   for(%i=0;%i<4;%i++)
   {
      view.mountObject("tire0"@%i, %currWheel, "", "hub"@%i, 0);
   }
}

function nextCar()
{
   unMountWheels();
   $currCar++;
   if($currCar >= $numCars)
      $currCar = 0;
   echo("Next car:" SPC $car[$currCar] SPC $currCar);
   view.setObject("car", $carshape[$currCar], "", 0);
   mountWheels();
}
function previousCar()
{
   unMountWheels();
   $currCar--;
   if($currCar < 0)
      $currCar = $numCars-1;
   echo("Next car:" SPC $car[$currCar] SPC $currCar);
   view.setObject("car", $carshape[$currCar], "", 0);
   mountWheels();
}
#4
02/29/2004 (11:59 pm)
Are you reusing the same wheel object for all 4 mountings?
#5
03/01/2004 (8:23 am)
Yeah, I am using 1 wheel shape per car...
...

$car[$numCars] = "racebug2";
$carshape[$numCars] = "race/data/shapes/vehicles/racebug2/buggy2.dts";
$wheelshape[$numCars] = "race/data/shapes/vehicles/racebug2/wheel.dts";
$numCars++;

$car[$numCars] = "DefaultCar";
$carshape[$numCars] = "race/data/shapes/buggy/buggy.dts";
$wheelshape[$numCars] = "race/data/shapes/buggy/wheel.dts";
$numCars++;
#6
03/01/2004 (8:30 am)
Did you check that your wheel datablocks have different names ?
Also, there use to be a similar problem between BT's jet bike and the car pack, where depending on what order you put them in the script file, the car wouldn't have any wheels.
I don't remember the exact cause, but wouldn't be surprised that Joe or Clark does :)
HTH,
Keep on Torkin' (note the K, special for you ;))
#7
05/03/2004 (11:53 am)
Did you ever get this fixed? I just made a vehicle selection GUI and ran into exactly the same problem.
Anther problem I'm having with this is that the wheels are facing the wrong direction when mounted on the car, like the car would drive sideways, pretty funny sight. Is there a way to fix this? or does this need to be fixed in the model?
If I don't get it to work soon I'll have to switch to using bitmaps (this project has a pretty short deadline, its a school project you see). But I would really prefer to just get this one fixed.
Also, using the standard animated DTS view I have no control over the camera, and the view is not exactly what i want it to be. Are there other/better object viewers out there?
#8
05/06/2004 (10:34 am)
Hmmz.... anyone??
#9
05/06/2004 (11:22 am)
Have you made sure everything that we've mentioned as possible problems are addressed and that no errors are coming up in the console log?
#10
05/06/2004 (11:39 am)
No this problem was never fixed. We ran into it ourselves and never fixed it either. Its some very weird bug that to my knowledge no one has managed to track down.
#11
05/06/2004 (3:32 pm)
Try calling
view.setEmpty()
to clear the object before loading a new object
#12
05/06/2004 (3:51 pm)
In my code its done like that... doesn't fix the problem. This bug is really random, so its not a script problem. It's defenetly a problem with this dts viewer, or some other engine problem.
Sometimes I have to click 20 times on my "next car" or "previous car" buttons before the first wheel dissapears/moves out of position. Sometimes 5 times. It never happens the first time I launch the GUI, but if I play the game and go back to the selection GUI its almost always screwed immidiately (so without me having to press the next or previous button).
One of the ideas we had was to let the user pick different types of wheels, but becuase of this bug I think we'll have to forget about that.
#13
05/06/2004 (4:33 pm)
Very Odd When we designed this gui we made it so you could unmount object based on a naming scheme it looks like you name the wheels when you mount "tire0"@%i
try unmounting using the name instead of the node like this
function unMountWheels(){
   for(%i=0;%i<4;%i++)   {
      view.unMountObject("tire0"@%i, "");
   }
}
function mountWheels(){
   %currWheel = $wheelshape[$currCar];
   for(%i=0;%i<4;%i++)   { 
     view.mountObject("tire0"@%i, %currWheel, "", "hub"@%i, 0);   
   }
}


one final note

you might not be unmounting at all the call would be
view.unMountObject()
note the capitol M
// Script function handling for "unMountObject"
ConsoleMethod( GuiObjectView, unMountObject, void, 4, 4, "ObjectView.unMountObject(name, node)" ) {
	argc;
	GuiObjectView* view = static_cast<GuiObjectView*>( object );
	view->unLoadObject(argv[2], argv[3]);
}

edit scratch the model name idea ,after reviewing more code =)
#14
05/06/2004 (5:08 pm)
One last thing it looks like an onSleep was never made try emulating the deconstructor and see if it helps

GuiObjectView::~GuiObjectView()
{
	mMeshObjects.Clear();
}
#15
05/06/2004 (5:11 pm)
Anthony TorqueScript is not case sensitive.

This is a problem in the transforms getting all whacky. I debugged it at one time but was never able to find the cause of the whackiness.

Let me see if I can find the thread.
#17
09/12/2004 (9:40 am)
Did anyone ever fix this problem. Its quit some time ago now, and in the new project I'm working on I'd like to have this fixed. I still have no idea what's cuasing this.
#18
11/30/2004 (11:50 am)
I never had any problems with this, save the wheels being sideways like in Ward de Langhe's case. I just used
view.unMountObject("tire"@%i, "");
instead. I did howerver have problems when I did
view.unMountObject("", "hub"@%i);
.
#19
11/03/2005 (8:12 am)
OK did anyone find a solution for this here?
#20
12/13/2005 (9:15 am)
I am back asking again if anyone figured out how to fix this since I have been trying for a while now and have struck out time and time again.
Page «Previous 1 2