Are simObjects ALWAYS loaded in the order listed in *.mis?
by Steven Peterson · in Torque Game Engine · 04/21/2006 (8:52 am) · 3 replies
I need to know if the onAdd() functions for simObjects are GUARENTEED to be called in the order their listed in the *.mis file.
What I want to do is add a "CloudManager.registerMe(this)" call in the onAdd() function of a new fxCloudLayer class, which will place (handles to) them in a vector somewhere. That way I can reliably grab the layer I want (0, 1, 2, 3...) and manage them individually.
If the onAdd() calls MAY be called out of order though than the whole idea is S.O.L... I need to know that CloudManager.CloudLayers[1] is in fact the first layer - and not maybe the "0" layer one day and the "4" layer the next.
Anyone know for sure?
thanks!
What I want to do is add a "CloudManager.registerMe(this)" call in the onAdd() function of a new fxCloudLayer class, which will place (handles to) them in a vector somewhere. That way I can reliably grab the layer I want (0, 1, 2, 3...) and manage them individually.
If the onAdd() calls MAY be called out of order though than the whole idea is S.O.L... I need to know that CloudManager.CloudLayers[1] is in fact the first layer - and not maybe the "0" layer one day and the "4" layer the next.
Anyone know for sure?
thanks!
#2
I believe that on the client they are loaded in-order, but on the server they are loaded in reverse order... last to first. I may be wrong, but I remember there being some code in the shape replicators that hinted at this.
Hope that helps!
Stephane
04/21/2006 (10:08 am)
Hey Steven,I believe that on the client they are loaded in-order, but on the server they are loaded in reverse order... last to first. I may be wrong, but I remember there being some code in the shape replicators that hinted at this.
Hope that helps!
Stephane
#3
[edit] Thanks Stephane, thats a good thing to know. [/edit]
04/21/2006 (10:10 am)
Thats a good idea - adding the extra field. Think i'll give it a try.[edit] Thanks Stephane, thats a good thing to know. [/edit]
Associate Orion Elenzil
Real Life Plus
but if you want to make it robust tho,
you could add a field to the layer object saying which layer it is.
hmm - and you know,
the objects *might* get out of mission-file order during network transmission to the client.