Madrilous Posted July 13, 2012 Share Posted July 13, 2012 (edited) I'm currently working on my next mod and as part of it I am using explosions to spawn activators. However these activators need to be deleted via a script once they have served their purpose. I'm using the FindClosestReferenceOfTypeFromRef() Function to detect these spawned Activators. I'm getting a little frustrated as I am very close to releasing the mod but I want it to be as bug free as possible before release, unfortunately I am deleting the spawned Activators using a simple Delete() function but this doesn't seem to work completely. Although the visual marker of the activator is removed, subsequent uses of the FindClosestReferenceOfTypeFromRef() still returns the supposedly deleted Activator. So basically I am just wondering what alternate removal methods are a little more stable than delete() but maintain the same basic premise. Feel free to ask any questions Thanks Edited July 13, 2012 by Madrilous Link to comment Share on other sites More sharing options...
LittleBaron Posted July 17, 2012 Share Posted July 17, 2012 Did you make sure that the object you want to delete doesn't fall into one of the categories listed at the beginning of this wiki page? http://www.creationkit.com/Delete_-_ObjectReference Link to comment Share on other sites More sharing options...
Madrilous Posted July 17, 2012 Author Share Posted July 17, 2012 Did you make sure that the object you want to delete doesn't fall into one of the categories listed at the beginning of this wiki page? http://www.creationkit.com/Delete_-_ObjectReference I did check these out but looking at them again I may not be clearing the variable used to store the reference, which I guess would fall under 'It is no longer in a script property'. Thanks for prompting me to look into this again, Ill give this a try and report how successful it was. Link to comment Share on other sites More sharing options...
Sjogga Posted August 11, 2012 Share Posted August 11, 2012 I'm currently working on my next mod and as part of it I am using explosions to spawn activators. However these activators need to be deleted via a script once they have served their purpose. I'm using the FindClosestReferenceOfTypeFromRef() Function to detect these spawned Activators. I'm getting a little frustrated as I am very close to releasing the mod but I want it to be as bug free as possible before release, unfortunately I am deleting the spawned Activators using a simple Delete() function but this doesn't seem to work completely. Although the visual marker of the activator is removed, subsequent uses of the FindClosestReferenceOfTypeFromRef() still returns the supposedly deleted Activator. So basically I am just wondering what alternate removal methods are a little more stable than delete() but maintain the same basic premise. Feel free to ask any questions Thanks I suggest that you use something like this to delete activators. Attach it to the activator itself. scriptname deleteMe extends ObjectReference event OnInit() utility.wait(10.0) ; change the wait time if you want. self.delete() endEvent Ten seconds after spawning, they are marked for deletion. Link to comment Share on other sites More sharing options...
Recommended Posts