Question about C++ side of engine.
by Vince Gee · in Torque 3D Professional · 04/21/2011 (11:36 am) · 4 replies
If I pass the handle to the player object (i.e. some integer) to a c++ function and I want to find that object at a later time, i.e. 60 seconds later find the player and executef that object, what do I use?
U32 soid = atoi(Torque_object_id);
SimObject* ObjToAlert;
ObjToAlert = Sim::findObject(soid);
I tried something like that... but it's wrong what should it be?
U32 soid = atoi(Torque_object_id);
SimObject* ObjToAlert;
ObjToAlert = Sim::findObject(soid);
I tried something like that... but it's wrong what should it be?
About the author
www.winterleafentertainment.com
#2
04/21/2011 (2:38 pm)
No from inside the C++, if I have the Object ID of the player object how do I get the actual object so I can throw an event on it?
#3
04/21/2011 (2:40 pm)
Is it in the string table? I have no clue.... anyone?
#4
04/22/2011 (7:40 am)
Why not make the function you want to create a method of the Player class, so that you just call %player.doWhatever() ? Unless there's a specific reason not to, that's what I would do.
Torque Owner Ivan Mandzhukov
Liman3D
The player is a control object and you could use the game connection to gain access to it whenever you want.