Game Development Community

Question About MissionCleanup.add(%obj)

by Demolishun · in Torque Game Engine · 10/16/2005 (1:26 pm) · 3 replies

What does MissionCleanup.add(%obj) do for an object?
If I destroy a turret, how do I properly dispose of it if I added it to the group without a delete?

I am trying to "properly" create/destroy turrets in the game. Right now I have a function that will create turrets at every spawn point within a SimGroup. I have another function that will delete every turret. These functions allow me to test script creation of turrets. However, how do I properly use MissionCleanup.add. If I use this function during the creation it will crash the engine when I do a delete.

Thanks,
Frank

About the author

I love programming, I love programming things that go click, whirr, boom. For organized T3D Links visit: http://demolishun.com/?page_id=67


#1
10/16/2005 (5:05 pm)
Okay, forget it. I have been fighting this turret code for too long. I just replaced all the references to AITurretData or AITurret with StaticShapeData and StaticShape and all issues have magically gone away. There is some serious issues with the AITurret or Turret code. I will probably have to create my own implementation to figure out what is going on. Too much code there for me to make heads or tails.

Thanks anyway,
Frank
#2
10/17/2005 (4:55 am)
MissionCleanup is a SimGroup that pretty much any object you create during a mission should be added to. When the mission ends every object in this group will be deleted automatically so you don't end up with objects hanging around from mission to mission.

If you manually delete an object afaik it will get removed from any SimGroup/SimSet that it is a member of automatically.