Game Development Community

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

About the author

Recent Threads


#1
11/03/2010 (8:36 am)
1st question, how do you access source code without T3D license?
#2
11/03/2010 (9:03 am)
Oh, I have license, my company bought that.