Unknown command getDataBlock
by arda · in Torque Game Engine · 03/18/2005 (1:21 pm) · 6 replies
I'm trying door resource but I'm getting error below.
baron/server/scripts/interact.cs (27): Unknown command getDataBlock.
Object (1380) TSStatic -> SceneObject -> NetObject -> SimObject
baron/server/scripts/interact.cs (27): Unable to find object: '' attempting to call function 'Interact'
- There is
serverCmdInteract() function
in interact.cs under /server/scripts folder.
- Also
moveMap.bindCmd(keyboard, "t", "commandToServer('Interact');", "");
is in default.bind.cs
-and
exec("./interact.cs");
called in game.cs
Do you have any suggestion for that
Thanks
baron/server/scripts/interact.cs (27): Unknown command getDataBlock.
Object (1380) TSStatic -> SceneObject -> NetObject -> SimObject
baron/server/scripts/interact.cs (27): Unable to find object: '' attempting to call function 'Interact'
- There is
serverCmdInteract() function
in interact.cs under /server/scripts folder.
- Also
moveMap.bindCmd(keyboard, "t", "commandToServer('Interact');", "");
is in default.bind.cs
-and
exec("./interact.cs");
called in game.cs
Do you have any suggestion for that
Thanks
About the author
#2
if(%scanTarg)
{
%targetDataBlock = %scanTarg.getDataBlock();
Echo("targetDataBlock = " @ %targetDataBlock);
Echo("scanTarg = " @ %scanTarg);
%targetDataBlock.Interact(%scanTarg,%client);
}
else
messageClient(%client, 'MsgTutorial', 'No object in range');
- Prints
targetDataBlock =
scanTarg = 1380 -10.5135 24.0161 1.79465 0 -1 0
baron/server/scripts/interact.cs (31): Unable to find object: '' attempting to call function 'Interact'
baron/server/scripts/interact.cs (28): Unknown command getDataBlock.
Object (1380) TSStatic -> SceneObject -> NetObject -> SimObject
- It's able to find the object, 1380, but it cant call Interact method on it?
- 1380 is defined as
//This is the datablock for the door itself
datablock StaticShapeData(Door)
- in door.cs
-and has
function Door::Interact(%this, %obj, %client)
defined in door.cs
- I cant see any reason not to call it?
Thanks Stephan for quick answer.
03/18/2005 (1:56 pm)
// call the interact function on the object's datablockif(%scanTarg)
{
%targetDataBlock = %scanTarg.getDataBlock();
Echo("targetDataBlock = " @ %targetDataBlock);
Echo("scanTarg = " @ %scanTarg);
%targetDataBlock.Interact(%scanTarg,%client);
}
else
messageClient(%client, 'MsgTutorial', 'No object in range');
- Prints
targetDataBlock =
scanTarg = 1380 -10.5135 24.0161 1.79465 0 -1 0
baron/server/scripts/interact.cs (31): Unable to find object: '' attempting to call function 'Interact'
baron/server/scripts/interact.cs (28): Unknown command getDataBlock.
Object (1380) TSStatic -> SceneObject -> NetObject -> SimObject
- It's able to find the object, 1380, but it cant call Interact method on it?
- 1380 is defined as
//This is the datablock for the door itself
datablock StaticShapeData(Door)
- in door.cs
-and has
function Door::Interact(%this, %obj, %client)
defined in door.cs
- I cant see any reason not to call it?
Thanks Stephan for quick answer.
#3
03/18/2005 (2:12 pm)
Add %obj.dump() and verify that the object you are getting is indeed the object you think it is.
#4
That's just an educated guess by looking at your output. Try finding out why you have both an object ID and a transform inside the %scanTarg variable.
Other parts of your output "smell" suspicious as well, but I can't put my finger on it yet.
03/18/2005 (2:21 pm)
If you look at the output of your "scanTarg =" echo line, it looks like you have both the object's datablock, as well as a transform for the object in the variable %scanTarg. Therefore, when you try to call %scanTarg.getDataBlock(), it's trying to find an object who's id is >1380 -10.5135 24.0161 1.79465 0 -1 0< and that object doesn't exist.That's just an educated guess by looking at your output. Try finding out why you have both an object ID and a transform inside the %scanTarg variable.
Other parts of your output "smell" suspicious as well, but I can't put my finger on it yet.
#5
I cant believe myself.
Head on laptop LCD :)
Head on laptop LCD :)
Head on laptop LCD :)
In mission editor, I did F11, F4 and find the door under static shapes, instead of shapes.
It took my whole friday evening :) Guess I'm not too late yet ...
Cheers
03/18/2005 (2:42 pm)
HAHAHAHAHAI cant believe myself.
Head on laptop LCD :)
Head on laptop LCD :)
Head on laptop LCD :)
In mission editor, I did F11, F4 and find the door under static shapes, instead of shapes.
It took my whole friday evening :) Guess I'm not too late yet ...
Cheers
#6
03/18/2005 (2:46 pm)
TSStatics don't have datablocks. Only things derived from GameBase have datablocks.
Torque 3D Owner Stephen Zepp
This is probably your key output line here: note there is not anything between the two single hash marks (no, that isn't a quote, it's two single hash marks)...the object you are checking on doesn't exist at that scope.