Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Syncing or changing BuildingGameObj 'IsDetroyed' state for clients
Re: Syncing or changing BuildingGameObj 'IsDetroyed' state for clients [message #487614 is a reply to message #487613] Fri, 16 May 2014 06:56 Go to previous messageGo to previous message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma:
General (5 Stars)
Jerad Gray wrote on Fri, 16 May 2014 14:53

danpaul88 wrote on Sun, 04 May 2014 10:02


All GameObjects have a guarunteed lifecycle whereby they transition from Created -> Destroyed, usually via Killed unless removed from the level by a script or other event. Scripts attached to that object are free to make the assumption that they can clean up resources once Killed or Destroyed are called. Subsequently causing that GameObject to be alive again and triggering Damaged events or another Killed / Destroyed event in this case would cause that script to be in an invalid state and could result in a crash.


I don't think this statement is quite right, unless the lifecycle does not have to wait for all scripts with a Created function to complete; because, I have encountered plenty of times (both in 3.4.4 and 4.1) that Created fired after Destroyed, I've got a few tricks that prevent destroyed from continuing if created of a script hasn't been completed yet as I've had crashing issues in the past due to uninitialized objects and variables Sad



I don't see how that could happen unless you're destroying objects in the initial Created cycle for all game objects, which is inadvisable and rather inefficient (why create objects if you're just going to destroy them instantly on game start?). If you can provide a reproduction case for that we will look into adding a fix in the code to ensure Created is always called before Destroyed (even if we end up doing something like if (!created) {Created();} Destroyed();)


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Fri, 16 May 2014 06:57]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Trouble downloading scripts
Next Topic: Can't see player names anymore?
Goto Forum:
  


Current Time: Tue Nov 26 23:53:50 MST 2024

Total time taken to generate the page: 0.02619 seconds