Why is this t2dStaticSpriteDatablock giving me an error?
by John Klimek · in Torque Game Builder · 03/15/2006 (12:44 pm) · 9 replies
Datablocks.cs:
configBlocks.cs: (the error is here)
When I create the sprite like this:
I get this error: (displayed twice... and the y's have dots above them (spanish symbol? aka garbage characters)
t2dStaticSprite::setImageMap() - t2dImageMapDataBlock Datablock is invalid! (yyj)
However, if remove the imageMap line from the config datablock and then do this it works fine....
What am I doing wrong?
datablock t2dImageMapDataBlock(tankImageMap)
{
imageName = "~/data/images/custom/tank3";
imageMode = FULL;
filterPad = false;
filterMode = NONE;
};configBlocks.cs: (the error is here)
datablock t2dStaticSpriteDatablock(TankConfig) {
imageMap = tankImageMap;
size = "35 25";
collisionActiveReceive = true;
collisionCallback = false;
};When I create the sprite like this:
%this.capital = new t2dStaticSprite() { scenegraph = t2dScene; config = TankConfig; };I get this error: (displayed twice... and the y's have dots above them (spanish symbol? aka garbage characters)
t2dStaticSprite::setImageMap() - t2dImageMapDataBlock Datablock is invalid! (yyj)
However, if remove the imageMap line from the config datablock and then do this it works fine....
%this.capital = new t2dStaticSprite() { scenegraph = t2dScene; config = TankConfig; };
%this.capital.setImageMap(tankImageMap);What am I doing wrong?
About the author
Recent Threads
#2
I would bet on that too. Be sure that you don't use the name tankImageMap before the actual datablock is created.
03/15/2006 (1:17 pm)
Quote:
Longshot here, but what order are your datablocks generated in?
I would bet on that too. Be sure that you don't use the name tankImageMap before the actual datablock is created.
#3
03/15/2006 (1:26 pm)
Hmmm... I'm execing datablocks.cs first (from initializet2d.cs) and THEN configblocks.cs, so the tankImageMap should definitely be created first...
#4
03/15/2006 (1:31 pm)
And if you try to write "tankImageMap" instead of tankImageMap in the config datablock?
#5
If I try to write "tankImageMap" instead of tankImageMap in the config datablock it does the same exact thing.
I also have other datablocks that are functioning the exact same way... (eg. giving errors)
03/15/2006 (4:49 pm)
If I type TankConfig.dump() in the console it lists the imagemap correctly... (imageMap = "tankImageMap)If I try to write "tankImageMap" instead of tankImageMap in the config datablock it does the same exact thing.
I also have other datablocks that are functioning the exact same way... (eg. giving errors)
#6
03/15/2006 (4:52 pm)
Ok, even if I move my tankImageMap to the SAME FILE (configBlocks.cs) and ABOVE my config datablock, I still get the same exact error.....
#7
03/16/2006 (1:32 am)
I had this problem too. But I really can't remember what the cause has been. :/
#8
What if you tankImageMap.dump() in the script just before creating the static sprite, is everything correct there? I assume there are no errors in the log around the time the imageMap datablock is generated? Are you blowing out your DSO files each time to force them to regenerate?
Sorry for the shotgun of suggestions, but nothing immediately jumps out as the likely culprit here to me; if it were happening to me I'd take a working case of the same type of configuration and start backing in my own values one at a time until it broke and then see what's different.
FYI the text in parenthesis is supposed to be the imageMapName according to the source, so something's getting butchered or not set initially. I'd suggest running a debug version and stepping through the source with a breakpoint on the static sprite datablock init if you can. Might reveal where the issue is.
03/16/2006 (10:28 am)
Odd, I don't know what else to suggest might be wrong. You say you've got other datablocks giving the same error. Are they ALL that way?What if you tankImageMap.dump() in the script just before creating the static sprite, is everything correct there? I assume there are no errors in the log around the time the imageMap datablock is generated? Are you blowing out your DSO files each time to force them to regenerate?
Sorry for the shotgun of suggestions, but nothing immediately jumps out as the likely culprit here to me; if it were happening to me I'd take a working case of the same type of configuration and start backing in my own values one at a time until it broke and then see what's different.
FYI the text in parenthesis is supposed to be the imageMapName according to the source, so something's getting butchered or not set initially. I'd suggest running a debug version and stepping through the source with a breakpoint on the static sprite datablock init if you can. Might reveal where the issue is.
#9
03/19/2006 (8:24 pm)
I seem to remember getting this error when I referred to an imageMap datablock that was itself not pointing to an existing file. Because the datablock was broken, other references to it threw errors. Could your tankImageMap datablock be screwy?
Torque 3D Owner Luke D
Default Studio Name
Try fetching the imageMap value from the datablock in the console after it's all loaded, is it set to the tankImageMap properly?