Jump to content

Scripted Item Addition and Save Bloat?


Bozingar

Recommended Posts

Hello all,

 

I'm fairly new to Papyrus and am struggling to find a clear answer to this online: would a script that dynamically adds items to NPC inventories in the vicinity cause noticeable Save Game bloat? And if so, are there reliable methods to clean this data?

 

For example: A cloak or quest alias-based script that has all NPCs in the area equip a Bob Ross wig of a random color (simple AddItem, EquipItem). I have the following questions in this scenario:

 

1. Is this not a big deal? Is the save data insignificant enough that adding wigs to every NPC (leveled and unique) across Skyrim wouldn't be noticeable?

2. Are there reliable methods of "cleaning" this data via script (e.g. removing the wigs once the player is gone)? It seems most script events involving actors being unloaded are flagged as unreliable triggers.

3. If you did remove the wigs via script, would that even remove the bloat? Would Skyrim recognize that the NPC is no longer edited, or just have a "NPCInventoryEdit = []" instead of "NPCInventoryEdit = [bobRossWig]" in the save file? I may have a wildly oversimplified idea of how the save data is stored.

 

Sorry for the barrage of questions. There appear to be numerous mods out there that use this method, so I want to make sure I understand the mechanics of it and any best practices. I'm also aware there are methods of adding items to all NPCs without in-game scripting, but in this instance I'm interested in a mod that requires dynamic scripting (e.g. gives orange wigs when raining).

 

Cheers,

-Boz

 

 

 

Link to comment
Share on other sites

The bloat is not from adding the item but from not making sure that the item is not added again if already present. Imagine an NPC with 100 instances of the same wig in their inventory when there only needs to be the one instance.

 

Basically, make a condition that if the wig is present do not add a new one.

Link to comment
Share on other sites

The bloat is not from adding the item but from not making sure that the item is not added again if already present. Imagine an NPC with 100 instances of the same wig in their inventory when there only needs to be the one instance.

 

Basically, make a condition that if the wig is present do not add a new one.

 

Got it, thanks! I imagine that would also stress papyrus without such a condition.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...