Game Development Community

Item problem

by Sean H. · in Torque Game Engine · 12/31/2005 (6:04 pm) · 3 replies

I'm have a small problem with instantiating items in the game. the item uses a datablock which references the shapefile of the default character. in the script, the first instance of this item works fine, but for some reason, the second instance of this object fails to recognize the datablock. keep in mind that this only happens if the item datablock references the shapefile of the default character, i have no problem with instantiating multiple versions of items using other datablocks. anyone know why this would happen?

#1
02/15/2006 (9:57 am)
When you say "fails to recognize the datablock", what are you seeing? Do you get any errors in the console?

How does the code compare between the first and second instantiations?
#2
02/15/2006 (10:30 am)
Thanks for the response Rubes. I still haven't figured this out. I assumed it was some quirk in the engine. I can't run it right now and see what the log file says, but when I get home I'll do that and let you know.

basically I'm getting the classic: "blah" is not a member of the "blah" class error message. the funny thing about it is that Im using identical code for instantiating both objects. the first one always works fine, but the second gives an error. when I remove either one of the two, it works fine. it's like it just doesn't like reusing that particular datablock for another item object.

but like I said I'll take a closer look when I get home.
#3
02/15/2006 (10:38 am)
Curious. It would be good to see the error and the code for each item when you get the chance.