Problem with inventory script
by Darnell Cromwell · in Torque Game Engine · 11/28/2005 (4:10 am) · 6 replies
Hi everyone this is my first post and I have been using Torque for about two weeks now. I am having a problem with the adding weapons. I get this error message and I was wondering if someone could help me solve the problem. The error message is:
{modname}/server/scripts/inventory.cs (142): Unable to find object: '' attempting to call function 'getName'
I am assuming that the object that is trying to me accessed is cannot be found and if this is the case where do I add the object so that the statement trying to access it can.
Anyway all help would be greatly appreciated. Thank you very much for your time.
{modname}/server/scripts/inventory.cs (142): Unable to find object: '' attempting to call function 'getName'
I am assuming that the object that is trying to me accessed is cannot be found and if this is the case where do I add the object so that the statement trying to access it can.
Anyway all help would be greatly appreciated. Thank you very much for your time.
#2
11/30/2005 (6:29 am)
Might want to make sure the object exists before trying to get it's name.
#3
What do you mean exactly, Dreamer, in regards to making sure that the object exists? I object exists as a model in my "mod" folder and is rendered when the game starts.
11/30/2005 (1:43 pm)
Well I know for a fact that the object has a name (MK23) and I'm trying to mount the object onto the player, which I believe is why I get the message.What do you mean exactly, Dreamer, in regards to making sure that the object exists? I object exists as a model in my "mod" folder and is rendered when the game starts.
#4
11/30/2005 (2:40 pm)
Do you know how getName is being called. It should be a ShapeBase function, this will happen if the ShapeBase ID is incorrect or the look-up name is wrong.
#5
11/30/2005 (3:10 pm)
Look through your console for some kind of error involved with loading the object in question.
#6
11/30/2005 (5:45 pm)
OK thanks guys, I was able to correct the error (not sure if it help the inventory system but at least I don't get the error message anymore). I just changed the classname of my weapon and the error seems to be gone. Not sure why that fixed the problem, but I'm not too worried about it.
Torque Owner Dave