Magnusen2 Posted June 20, 2021 Share Posted June 20, 2021 I'm trying to delete actors that were added to a formlist when they died. I use it (at least that how it was in NV) to keep track of dead bodies: While (xxxEndlessWarfareMCM_CorpseList.GetSize() > xxxEndlessWarfareMCM_MaxDeadBodies.GetValue()) Form ToDelete = xxxEndlessWarfareMCM_CorpseList.GetAt(0) string name = ToDelete.GetName() name = ToDelete.GetName() fDebugTrace("Removed Actor " + name + " from dead body list.") xxxEndlessWarfareMCM_CorpseList.RemoveAddedForm(ToDelete) ToDelete.Disable() ToDelete.Delete() EndWhilebut all i get is "Disable is not a function or does not exist" in the CK. Any help? Link to comment Share on other sites More sharing options...
pepperman35 Posted June 20, 2021 Share Posted June 20, 2021 https://www.creationkit.com/index.php?title=FormList_Script Link to comment Share on other sites More sharing options...
Magnusen2 Posted June 20, 2021 Author Share Posted June 20, 2021 (edited) https://www.creationkit.com/index.php?title=FormList_ScriptOh sorry about that. In deleting i meant deleting the actual actor from the map using Disable() and Delete(). I already know how to remove the actor from the formlist.Edit: Using "GetAt(0) as Actor" (learned it from your other answer) fixed it. Thanks again! Edited June 20, 2021 by Magnusen2 Link to comment Share on other sites More sharing options...
SKKmods Posted June 20, 2021 Share Posted June 20, 2021 The issue is that you are pulling an object as a generic form from the form list and never telling the system what type of obejct the form is, so it doesn't have a script context. If you are going to use formlists for managing ObjectReferences, which are less elegant than the purposely designed ReferenceCollectionAliases, then; ObjectReference ToDelete = xxxEndlessWarfareMCM_CorpseList.GetAt(0) as ObjectReference or (ToDelete as ObjectRefernce).Disable() (ToDelete as ObjectRefernce).Delete() Link to comment Share on other sites More sharing options...
Magnusen2 Posted June 20, 2021 Author Share Posted June 20, 2021 The issue is that you are pulling an object as a generic form from the form list and never telling the system what type of obejct the form is, so it doesn't have a script context. If you are going to use formlists for managing ObjectReferences, which are less elegant than the purposely designed ReferenceCollectionAliases, then; ObjectReference ToDelete = xxxEndlessWarfareMCM_CorpseList.GetAt(0) as ObjectReference or (ToDelete as ObjectRefernce).Disable() (ToDelete as ObjectRefernce).Delete() Pardon me but is there any resource where i can learn more about "ReferenceCollectionAliases"? I can't find info on google. Link to comment Share on other sites More sharing options...
Recommended Posts