baloney8sammich Posted November 24, 2021 Share Posted November 24, 2021 I'm looking for a way to change the contents of all references of a certain container based on characteristics of the reference. I'm not certain how to get started though. For starters I'm assuming the way to go is a script attached to the base object. But I don't really know which event(s) to use. The container I'm going to start with has thousands of references, so I'd want to avoid save bloat. It's also respawning, so I'd want to make sure the contents get changed when that happens. On the other hand I've poked around enough mods to think that a quest might be the way to go about this. But that's probably beyond my capabilities. Anyway, any input or suggestions would be appreciated. Link to comment Share on other sites More sharing options...
dylbill Posted November 25, 2021 Share Posted November 25, 2021 To help, I'd need more info for what you're trying to do. A simple way I can think to is just have separate containers, and enable / disable different ones that have different items in them based on conditions. Example: Actor Property PlayerRef Auto Event OnLoad() ;event triggered when this reference loads 3D. If PlayerRef.GetLevel() > 20 ;if players level is greater than 20, enable this container, else, disable it. Self.Enable() Else Self.Disable() Endif EndEventAnother way is to just use leveled items in the container, and put the conditions on those in the creation kit, but that might be a lot more work if you've already set up the container. Link to comment Share on other sites More sharing options...
baloney8sammich Posted November 25, 2021 Author Share Posted November 25, 2021 Thanks for the response. Basically, I want to change the contents of the reference if certain conditions are met. For starters, if it has NPC or faction ownership defined. In the interim I wrote an xEdit script that found all the references with ownership, copied them as override, and changed the Base object to a copy of the original with the contents modified. But I'd rather find a method that doesn't involve overrides. And I'm toying around with the idea of a few more advanced conditions that can't be solved like that anyway. Link to comment Share on other sites More sharing options...
dylbill Posted November 26, 2021 Share Posted November 26, 2021 So you're trying to change vanilla container's contents based on conditions? If that's the case, I would recommend using SkyPal: https://www.nexusmods.com/skyrimspecialedition/mods/43925 It's a script resource where you can pass all object references in the game, then filter them by type (28 for containers) and can then filter those with an array of actor owners. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted November 26, 2021 Share Posted November 26, 2021 FYI - @dylbill the link is broken. If one deletes the extra %C2%A0 at the end of the URL, it will work. Link to comment Share on other sites More sharing options...
baloney8sammich Posted November 28, 2021 Author Share Posted November 28, 2021 Thanks. I came to realize that ownership is not really a useful condition, however I think SkyPal will be very useful for the other thing I want to try. Link to comment Share on other sites More sharing options...
Recommended Posts