Jump to content

Recommended Posts

Posted

Good afternoon everybody! I had a little question - does anybody know if MarkForDelete works on both xmarkers and their children? I've got a bunch of objects connected to one and I want to disable and delete them once the quest is done, but I've been researching and found nothing about this. Would MarkForDelete remove the parent xmarker and the children as well, or not?

 

Thank you! :dance:

Posted

Would MarkForDelete remove the parent xmarker and the children as well, or not?

I would be very surprised if it does. You will most likely need to delete each child reference, individually.

Posted

Just did a quick test, and MarkForDelete does delete children if their parent is disabled when you call it. It does not delete children if the parent is enabled when you call it. So, this will disable and delete MyREF and all its children:

MyREF.Disable
MyREF.MarkForDelete
Posted

Oh my goodness, that's great news indeed! I had my scripts set precisely like that (first disable, then markfordelete), and I'm so pleased that it works. Thank you so much for testing! You're a life saver :dance:

Posted

I just tried to set MyREF as Enable Parent of the child, I marked for delete, save and reload and the child was still there

Did I misunderstand the kind of relationship you want to give them?

Posted
Correct, MyChildREF had its Enable Parent set to MyREF. What I saw was that it depended on the enable state of MyREF. If I called MyREF.MarkForDelete while MyREF was enabled, MyREF was deleted but MyChildREF was not. If I disabled MyREF first, calling MyREF.MarkForDelete deleted both MyREF and MyChildREF.
Posted

out of curiosity, did you try to PRID the child on console? because I had the opposite behaviour, both the father (<<< obvious) and the children (<<< not so obvious) didn't erase after mark for delete.

One day I'll make some deeper more tries, it could be a useful thing to use

Posted

Yep, that's how I confirmed it was deleted. Used prid from the console with MyChildREF's ID before calling MyREF.MarkForDelete, and it was there. Used it again afterwards and got the "Item not found for object ref id" message. If you're seeing different behavior, then there's something else happening that I don't understand yet. I'll do a little more digging.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...