Jump to content
  • 0

Question

Posted (edited)

There are mods that just slap "Initially Disabled" as a record flag when they want to disable certain objects (clutter, flora), and call it a day - which is not a good practice. PlayerRef is missing, with "set enable state to opposite of parent", as well as Z axis at -30000. AFAIK, this is a proper practice when you want to correctly disable an object.

Instead of going through every single object that has this shortcoming, and correcting (patching) it manually, is there a chance of a xEdit script that could automate this process? As in, click on a plugin, apply the script, and it assigns the missing values to initially disabled objects that don't have them. It would save hours of work.

Edited by Katarsi

12 answers to this question

Recommended Posts

  • 0
Posted

Slightly better and safer version which skips Initially Disabled references if they already have an Enable Parent:

image.pngimage.png

As discussed above, the script doesn't check if the reference might be used any other way by the plugin, which would require cross-referencing the reference in the plugin. I'm not willing to spend more than 10 minutes on this, so this is the best you'll get.

  • 0
Posted
  On 8/26/2023 at 8:07 AM, Katarsi said:

AFAIK, this is a proper practice when you want to correctly disable an object.

Expand  

This is true when the goal is to permanently disable an object not used by the mod in order to completely remove it from the world. There are other cases where a mod may initially disable an object, which may later be re-enabled:

  • By a Papyrus script.
  • By an Enable Parent.

In these cases, setting Enable Parent opposite of Player and Z to -30000 would break the mod.

So an automated procedure is not possible without analyzing how each initially disabled object might be used, or not, by the mod.

In the worst case, an initially disabled object might be enabled by a Papyrus script but its usage be "hidden" from the mod plugin, because the script hardcodes the RefID of the object instead of passing it as a script property. This is a very bad practice, which fortunately is uncommon nowadays, but it exists, particularly in old mods. This case cannot be determined without reading the Papyrus script source code.

So if you've determined and are absolutely sure that the mod doesn't use the object at all and it doesn't re-enable it by any means - which is by itself a time-consuming process - you can flag it in xEdit as Deleted in its record header. Once you're done with all the Initially Disabled objects, you can just run the plugin through xEdit QuickAutoClean which will automatically change Deleted objects into Initially Disabled + Enable Parent opposite Player + Z = 30000.

  • 0
Posted
  On 8/26/2023 at 2:39 PM, Mousetick said:

So if you've determined and are absolutely sure that the mod doesn't use the object at all and it doesn't re-enable it by any means - which is by itself a time-consuming process - you can flag it in xEdit as Deleted in its record header. Once you're done with all the Initially Disabled objects, you can just run the plugin through xEdit QuickAutoClean which will automatically change Deleted objects into Initially Disabled + Enable Parent opposite Player + Z = 30000.

Expand  

I know what you're talking about, I know the difference and I'm 100% sure that the placed objects I want to remove will not be used by a script later. Namely, I'm talking about trees. Not even tree objects that have activators on them (such as logs with mora tapinella and aspen stumps with scaly pholiota), but just plain ol' trees.

And flagging them with Delete means that I have to go through every record either way, which doesn't mean much in the sense of time and effort invested in the whole thing.

It would have been nice to have a script that could be applied to a single plugin and just add these records to Placed Objects which only have Initially Disabled on them. "Use at your own risk", type of script for xEdit. I would immensely appreciate it, if someone knew how to make it, and it would save me So. Much. Time.

  • 0
Posted

The context wasn't clear in your OP. You may know exactly what you're doing but random readers may not and could get the wrong idea.

  On 8/26/2023 at 3:09 PM, Katarsi said:

It would have been nice to have a script that could be applied to a single plugin and just add these records to Placed Objects which only have Initially Disabled on them. "Use at your own risk", type of script for xEdit. I would immensely appreciate it, if someone knew how to make it, and it would save me So. Much. Time.

Expand  

You can do it yourself, it's not very complicated.

  • Copy the existing Undelete and Disable References.pas to Permanently Disable Initially Disabled References.pas.
  • Edit Permanently Disable Initially Disabled References.pas as follows (left side is original script, right side is edited version):

image.pngimage.png

Only the differences are shown above, everything else remains the same.

  • Load the plugin in xEdit.
  • Right-click on the plugin, select 'Apply Script', choose 'Permanently Disable Initially Disabled References', click OK.
  • Done. Save plugin.

The messages window will display the list of modified references, for example:

  Reveal hidden contents

The xEdit script seems to work fine for me but YMMV. USE AT YOUR OWN RISK.

  • 0
Posted
  On 8/26/2023 at 3:55 PM, Mousetick said:

The xEdit script seems to work fine for me but YMMV. USE AT YOUR OWN RISK.

Expand  

:thumbsup:

Is this good? I'm shite at scripting, so please check:

  Reveal hidden contents

 

  On 8/26/2023 at 4:40 PM, Mousetick said:

Slightly better and safer version which skips Initially Disabled references if they already have an Enable Parent:

image.png

As discussed above, the script doesn't check if the reference might be used any other way by the plugin, which would require cross-referencing the reference in the plugin. I'm not willing to spend more than 10 minutes on this, so this is the best you'll get.

Expand  

Oh wait, I have to do it all over again, hold on

  • 0
Posted
  On 8/26/2023 at 4:40 PM, Mousetick said:

Slightly better and safer version which skips Initially Disabled references if they already have an Enable Parent:

image.png

As discussed above, the script doesn't check if the reference might be used any other way by the plugin, which would require cross-referencing the reference in the plugin. I'm not willing to spend more than 10 minutes on this, so this is the best you'll get.

Expand  

Is this good?

  Reveal hidden contents

 

  • 0
Posted (edited)

You don't need to be good at scripting, simply edit with a text editor to match the right side of the comparison. Looks like you missed some pieces or put them in the wrong place, though.

Edited by Mousetick
Removed downloadable attachment
  • Thanks 1
  • 0
Posted

@Mousetick Me again... I have another query, if you can help.

So this whole process - can it be done in reverse? In other words, a script that finds Initially Disabled and removes that flag, as well as XESP (if there is one), and also returns Z axis to the master value (if it's set to -30000). There are some placed objects (trees) that I don't want to disable, but I want to keep their modified Scale (XSCL).

  • 0
Posted
  On 8/27/2023 at 9:00 AM, Katarsi said:

So this whole process - can it be done in reverse? In other words, a script that finds Initially Disabled and removes that flag, as well as XESP (if there is one), and also returns Z axis to the master value (if it's set to -30000).

Expand  

Now you want to undo the whole thing? That doesn't make much sense.

  On 8/27/2023 at 9:00 AM, Katarsi said:

There are some placed objects (trees) that I don't want to disable, but I want to keep their modified Scale (XSCL).

Expand  

Restore the original plugin from backup. Manually remove the 'Initially Disabled' flag from the trees you want to keep first. Then run the script you originally asked for to permanently disable everything else that is Initially Disabled and doesn't have an Enable Parent.

  • 0
Posted
  On 8/27/2023 at 9:24 AM, Mousetick said:

Now you want to undo the whole thing? That doesn't make much sense.

Expand  

It's not for the same mod. And this one has a lot of Initially Disabled that I want to actually enable.

Thank you for all your help.

  • 0
Posted
  On 8/27/2023 at 12:31 PM, Katarsi said:

It's not for the same mod. And this one has a lot of Initially Disabled that I want to actually enable.

Expand  

This couldn't be automated/scripted. The script wouldn't know which ones you want to keep/enable based on your personal taste. It's all or nothing based on objective criteria.

I'd tackle this manually like this:

  • Create an empty plugin. This is going to be a patch for the mod.
  • Sort the patch after the mod.
  • Load both the mod plugin and the patch in xEdit.
  • For each disabled tree that you want to keep:
    • Copy as Override... from Skyrim.esm (NOT from the mod plugin), or whichever is the last vanilla plugin, into the patch.
    • Drag the scale and any other change you like from the mod plugin to the patch.

This should be faster than un-disabling the trees one by one. Also it's better to put manual edits into a separate patch than editing the mod plugin directly. In case the mod is updated or reinstalled, nothing is lost.

* The Copy as Override can be done in small batches, rather than one by one, by selecting multiple records first (shift-click or ctrl-click).

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.