Mounting Waypoints
by Josh Moore · in Torque Game Engine · 10/11/2004 (11:24 pm) · 6 replies
I'm having the strangest problem that I've ever encountered. I can't mount my waypoint class to anything. I even made a new console method for my waypoints to attach them to a shapeBase object. It calls mount object directly, and I still can't get it to mount. Is there a somekind of hard coded value that only allow certain objects to be mounted? Heres the function I made. Note: MountObject doesn't work either.
ConsoleMethod( WayPoint, attachToObject, bool, 4, 4, "( ShapeBase mount, int slot )"
"Mount ourselves on an object in the specified slot.")
{
ShapeBase *target;
if (Sim::findObject(argv[2],target)) {
S32 node = -1;
dSscanf(argv[3],"%d",&node);
if (node >= 0 && node < ShapeBaseData::NumMountPoints)
{
//object->attachToObject(target,node);
WayPoint *wayPoint = (WayPoint *) object;
target->mountObject(wayPoint, node);
Con::errorf("Mouting Waypoint to Object");// this shows up in the console......
return true;
}
}
return false;
}
#2
10/12/2004 (8:36 am)
The mission marker class is derived from shape base, thats why I don't understand why its not mounting.
#3
How are you determining that a waypoint is not actually mounted, because from your
code you posted above, it seems to be working ...
Realize that WayPoint's do not have any rendering, except for what is inherited from
ShapeBase.
10/12/2004 (8:38 pm)
Have you tried debugging the function mountObject to see what is happening there?How are you determining that a waypoint is not actually mounted, because from your
code you posted above, it seems to be working ...
Realize that WayPoint's do not have any rendering, except for what is inherited from
ShapeBase.
#4
Edit: I tossed a print in the shapeBase, mountObject method and its get called. It should be mounted, but it's definetly not. I have no idea why its not working. Can anyone shed light upon my dilema?
10/12/2004 (8:45 pm)
The Waypoints are rendered in the editor, but hidden in game. I have visual waypoints that are rendered from the waypoint's position, and I can see that they're not mounted in the editor, too. I wrote that function in place of the regular mountObject one, but I get the same results.Edit: I tossed a print in the shapeBase, mountObject method and its get called. It should be mounted, but it's definetly not. I have no idea why its not working. Can anyone shed light upon my dilema?
#5
10/20/2004 (2:21 pm)
Could the waypoints not mounting because they're hidden automaticly?
#6
Sorry to resurrect such an old post, but I am having a very similar problem, and I was wondering if you had ever figured out why this was not working. I am using mounting code with waypoints, and they just do not seem to be responding, even though, as you mention, they are descended from shapebase, so one would think that they would.
09/18/2007 (1:38 pm)
@Josh,Sorry to resurrect such an old post, but I am having a very similar problem, and I was wondering if you had ever figured out why this was not working. I am using mounting code with waypoints, and they just do not seem to be responding, even though, as you mention, they are descended from shapebase, so one would think that they would.
Torque Owner James Laker (BurNinG)
But don't let my stupidity confuse you... ;)