Game Development Community

Using ObjectId

by James Kennedy · in Torque X 2D · 09/17/2007 (3:38 pm) · 4 replies

Note: I don't have pro

I was trying to use ObjectId to store the id, then use it later to compare if an object is the same id, but I am finding that objectId changes as time progresses. Do objects have any other unique name/id that can be consumed in this way?

#1
09/17/2007 (4:03 pm)
Name can be used this way. Name must be unique, though.

That said, ObjectId shouldn't change once the object is registered. It should default to zero and get set to a unique number when the object becomes registered. I'm not seeing anything in the code that would even allow it to be changed.
#2
09/18/2007 (2:18 pm)
Every time I access the objectid on a t2danimatedsprite it goes to the next highest available number
I am not setting objectid anywhere in my code.
#3
09/18/2007 (7:31 pm)
Never mind the problem had nothing to do with objectid, it was just my code
thanks for the help
#4
09/19/2007 (5:50 pm)
No problem.
I'm glad you got it working. :)

Also, in case anyone is wondering, you can't actually modify the ObjectId without changing the source because the set method is internal.

Edit: I don't know why anyone would want to modify an ObjectId, just saying you can't with the binary version.