How can we call a Simobject in script?
by Huaqing Chen · in Torque Game Engine · 11/02/2010 (8:00 pm) · 2 replies
For example, I have a Simobject called "JackSprite" in c++, and later on I want to use this "JackSprite" in Torque Script,
1. Can I call it like $jack = new JackSprite("","jackImageMap"); ? It was working at the begining but it did not work later on.
2. Or can I also create a ConsoleFunction in the C++ class (in the SimObject class) like:
ConsoleFunction(createJackSprite, SimObjectPtr, 2, 2, "create a jack sprite")
{
return new JackSprite();
}
I can call this ConsoleFunction in script in order to get the JackSprite object
I got error on both ways, can anyone tell me what to do?
Cheers
1. Can I call it like $jack = new JackSprite("","jackImageMap"); ? It was working at the begining but it did not work later on.
2. Or can I also create a ConsoleFunction in the C++ class (in the SimObject class) like:
ConsoleFunction(createJackSprite, SimObjectPtr, 2, 2, "create a jack sprite")
{
return new JackSprite();
}
I can call this ConsoleFunction in script in order to get the JackSprite object
I got error on both ways, can anyone tell me what to do?
Cheers
Torque 3D Owner TSI Gamer