makePath(dAtof(argv[2]),dAtof(argv[3]),dAtof(argv[4])); } "> Getting C++ Pointer from Console Object ID? | Torque Game Engine | Forums | Community | GarageGames.com

Game Development Community

Getting C++ Pointer from Console Object ID?

by Sim9 · in Torque Game Engine · 04/02/2005 (2:49 pm) · 2 replies

Hi! I'm trying to get a C++ Pointer from an Object ID (from console).

For example:

ConsoleMethod(WaypointMgr,makePath,void,5, 5,"Computes path from START to END on AIBOT")
{
   object->makePath(dAtof(argv[2]),dAtof(argv[3]),dAtof(argv[4]));
}

So now in function makePath I have Object ID numbers, but I need to actually get at those objects to do anything worthwhile. Hopefully there's a function somewhere to get a pointer to that object, but I have not found it yet. (What I've been doing is looping through the simgroup to manually find the ID, but this is inefficent).

Thanks for any help you can lend, it would be greatly appreciated!

#1
04/02/2005 (11:51 pm)
Grep for calls to Sim::findObject.
#2
04/03/2005 (12:00 pm)
Excellent, this is exactly what I was looking for! Thanks so much! :)