silhouett Posted August 30, 2016 Share Posted August 30, 2016 I have a form list with both actors and Objects in it.so from an object reference point how would I disable every thing in that list ? I start with While (index < COB_Removals.GetSize()) need some code here ? index = index + 1EndWhile Thank You in Advance for any help Link to comment Share on other sites More sharing options...
StuykGaming Posted August 30, 2016 Share Posted August 30, 2016 Hi, I've been doing something similar but with Arrays but I still think I can help you with this. Source: Int index = 0 While (index < COB_Removals.GetSize()) ObjectReference MyObjReference = COB_Removals.GetAt(index) as ObjectReference MyObjReference.Disable() Debug.Trace("Successfully Removed") index += 1 EndWhile Code Breakdown: #1: Int index = 0Sets your integer to zero before you run it through the loop and add to it. #2 While (index < COB_Removals.GetSize())Starts the loop. It will run until 'index' is larger than the Formlist size for COB_Removals. #3 ObjectReference MyObjReference = COB_Removals.GetAt(index) as ObjectReferenceSets anything in the FormList to an ObjectReference. Uses the index as a number to pull the object from. Because we're using GetSize index is going to start at 0 then go to 1, 2, 3, 4, etc. #4 Debug.Trace("Successfully Removed")Because why not add a trace in your loop to make sure it's working right? #5 index +=1For every time index is not larger than COB_Removals we're going to add 1 to it until it is. After it adds one the entire loop starts over. #6 EndWhileLeaves the loop when index is higher than COB_Removals Link to comment Share on other sites More sharing options...
silhouett Posted August 30, 2016 Author Share Posted August 30, 2016 This works for most of them fine but on a few I get "[08/29/2016 - 09:48:04PM] error: (0011E79D): cannot disable an object with an enable state parent" with different id's for the objects. Link to comment Share on other sites More sharing options...
StuykGaming Posted August 30, 2016 Share Posted August 30, 2016 (edited) This works for most of them fine but on a few I get "[08/29/2016 - 09:48:04PM] error: (0011E79D): cannot disable an object with an enable state parent" with different id's for the objects. Someone else might have an answer for this part. What exactly is being stored in this Formlist? Also are these objects already enabled somewhere? Edited August 30, 2016 by StuykGaming Link to comment Share on other sites More sharing options...
silhouett Posted August 30, 2016 Author Share Posted August 30, 2016 well the disable line says [ (000BDDFA)].ObjectReference.Disable() - "<native>" Line ? I am storing some objects and actors from the prewar sanctuary. I was trying to make the original sanctuary empty of cars and life but still have the buildings etc. Thought this would be a good way to do that. Link to comment Share on other sites More sharing options...
StuykGaming Posted August 30, 2016 Share Posted August 30, 2016 You may have to use .Delete() Link to comment Share on other sites More sharing options...
Reneer Posted August 30, 2016 Share Posted August 30, 2016 (edited) well the disable line says [ (000BDDFA)].ObjectReference.Disable() - "<native>" Line ? I am storing some objects and actors from the prewar sanctuary. I was trying to make the original sanctuary empty of cars and life but still have the buildings etc. Thought this would be a good way to do that. The problem is that some of the objects in your list have an "enable state parent" which is basically another object linked to the one in your Formlist via the CK itself. Essentially the object in your formlist gets its "enabled state" from the "parent" object and thus you would need to disable the "parent" object in order to disable the "child" (your object) as well. This would be simple if you could actually get the "parent state" object that is connected to your formlist object but unfortunately you can't do that via Papyrus. You may have to use .Delete()This would not work. Delete() only works on objects that were dynamically created in the game (using functions like PlaceAtMe). It will not work on objects that were placed / created within the CK. Edited August 30, 2016 by Reneer Link to comment Share on other sites More sharing options...
TummaSuklaa Posted August 30, 2016 Share Posted August 30, 2016 I believe you can use http://www.creationkit.com/fallout4/index.php?title=SetCriticalStage_-_Actor as a makeshift delete for objects not dynamically placed. Although this is something I would use in like an uninstall script or something. Disable is fine on its own otherwise, since it blocks rendering obviously. Link to comment Share on other sites More sharing options...
Reneer Posted August 30, 2016 Share Posted August 30, 2016 (edited) I believe you can use http://www.creationkit.com/fallout4/index.php?title=SetCriticalStage_-_Actor as a makeshift delete for objects not dynamically placed. Although this is something I would use in like an uninstall script or something. Disable is fine on its own otherwise, since it blocks rendering obviously.That function works on actors, not objects, so, no, it would not function as a "makeshift delete". Edited August 30, 2016 by Reneer Link to comment Share on other sites More sharing options...
TummaSuklaa Posted August 30, 2016 Share Posted August 30, 2016 (edited) Yeah I just read that again and you beat me to my edit. :tongue: Although your tone comes off a bit.. insulting but I get it that no one likes misinformation, but I always behind myself. However that almost makes me want to find a way to delete objects from the world. Edited August 30, 2016 by TummaSuklaa Link to comment Share on other sites More sharing options...
Recommended Posts