Zorkaz Posted March 27, 2022 Share Posted March 27, 2022 I have a script that goes like this ObjectReference1.disable() ObjectReference2.disable() ObjectReference3.disable() ObjectReference4.disable() ObjectReference5.disable() ObjectReference6.disable() ObjectReference7.disable() ObjectReference8.disable() ... ObjectReference22.disable() is there a way to group all of them together? Link to comment Share on other sites More sharing options...
SKKmods Posted March 27, 2022 Share Posted March 27, 2022 If they are your objects or you are happy to hack base game content the best way is to connect them to an EnableStateParent object and just switch the parent state in script. This does not make them persistent. If the objects are not your objects to hack, or persistence is not an issue (you have not planned to clear their script property handles) then drag them into a formlist and loop; Formlist Property ListOfObjectsToDisable Auto Const Mandatory Function DisableTheObjects() Int iIndex = 0 While (iIndex < ListOfObjectsToDisable.GetSize()) ObjectReference ThisObject = ListOfObjectsToDisable.GetAt(iIndex) as ObjectReference ThisObject.Disable() iIndex +=1 EndWhile EndFunction My non invasive realtime world conversion solutions do a crap-tonne of this on several thousand objects as the only real alternative to static xEdit hacks. Pro Tip: It is impossible to detect if an object has an EnableStateParent in script (grrrrr) so any script that does try to switch a child object state directly will just fail. The only workaround is to seeif the object is still enabled and then move it to a hidden holding cell (double grrr). Link to comment Share on other sites More sharing options...
Zorkaz Posted March 27, 2022 Author Share Posted March 27, 2022 Thanks SKK. Link to comment Share on other sites More sharing options...
Recommended Posts