Creating new instance of AiPlayer through console doesn't work
by Rob Segal · in Torque Game Engine · 01/21/2006 (4:16 pm) · 5 replies
Maybe it's not supposed to work but I tried creating an instance of AiPlayer in the console and get the following error...
"Register object failed for object (null) of class AiPlayer"
Yet if I make a function in script then run that function through the console it works. The main difference I can see is that in the function declared in script the datablock to be used is specified whereas the console method I tried doesn not specify that info. Would be this be expeced behaviour though?
"Register object failed for object (null) of class AiPlayer"
Yet if I make a function in script then run that function through the console it works. The main difference I can see is that in the function declared in script the datablock to be used is specified whereas the console method I tried doesn not specify that info. Would be this be expeced behaviour though?
#2
new AiPlayer()
and
new AiPlayer(MyNewAiPlayer)
But I don't think giving it a name makes any difference. Neither seemed to work. Thanks for the explanation Stephen.
01/22/2006 (8:12 pm)
Yeh it was with the new operator. I typed...new AiPlayer()
and
new AiPlayer(MyNewAiPlayer)
But I don't think giving it a name makes any difference. Neither seemed to work. Thanks for the explanation Stephen.
#3
--all on one line. And then set his shapename, transform, etc. just like the rest of what AIPlayer::spawn() does.
01/22/2006 (8:39 pm)
You would need to type something like:$myNewAIGuy = new AiPlayer() { datablock = DemoPlayer; path = ""; };--all on one line. And then set his shapename, transform, etc. just like the rest of what AIPlayer::spawn() does.
#4
01/23/2006 (2:18 pm)
Yeh I believe I tried that as well. Could be I missed a character somewhere and I don't think I tried checking the syntax I typed with. It didn't work for me so I figured it didn't work at all.
#5
01/24/2006 (11:54 pm)
Well i discovered that I can't instanciate AIPlayer in the console unless the datablock is loaded into memory containing the shape you wish to use be it PlayerBody or DemoBody.
Torque 3D Owner Stephen Zepp
What specific ConsoleMethod did you attempt? The only way to create new objects is with the new operator (in script).