Unit ID error/bug?
by Matt Huston · in RTS Starter Kit · 06/29/2006 (5:54 pm) · 2 replies
This is the first time I have caught this. I am getting 2 ID's for each of my units. I thought maybe I had done it myself but it happens in stock RTS pack as well. I found this if, I click for the unit to move to a point, and then click again, so a double click move, the console displays the following.
1450 - Arrived!
1586 - Arrived!
I only have 1 unit selected. If I had clicked one it would have only had "1450 - Arrived!". So 1450 should be the units ID right? Well, I attempt to run 1450.setHidden(true); in the console, nothing happens. However, I run 1586.setHidden(true); and the unit I have selected DOES disappear. The problem lies in that, whenever I am passing the player object, the ID is that 1450 ID, not the 1586 ID.
I do need to use a %obj.setHidden(true); and it doesn't do anything because it is telling 1450 to disappear.
So wierd stuff, any ideas?
1450 - Arrived!
1586 - Arrived!
I only have 1 unit selected. If I had clicked one it would have only had "1450 - Arrived!". So 1450 should be the units ID right? Well, I attempt to run 1450.setHidden(true); in the console, nothing happens. However, I run 1586.setHidden(true); and the unit I have selected DOES disappear. The problem lies in that, whenever I am passing the player object, the ID is that 1450 ID, not the 1586 ID.
I do need to use a %obj.setHidden(true); and it doesn't do anything because it is telling 1450 to disappear.
So wierd stuff, any ideas?
About the author
www.atomicbanzai.com
#2
06/29/2006 (6:07 pm)
Hmm, I knew that but for some reason didn't think this was about that. Thanks Stephen. :)
Torque 3D Owner Stephen Zepp
Since you are running in a combined server/client executable mode, both versions of the code get called, one for each side. Since a client only has ghosted objects (and therefore ghost object id's), the objects in fact have different id's.
If you were to run this exact same code in a dedicated client and a dedicated server, you would see one line on each.