testiger2 Posted May 14, 2021 Share Posted May 14, 2021 Hi people,i have a quick question about scripts in regard to the string count in the save game. Now as far as i know functions and properties (apart form AutoReadOnly) will bake into the savegame and increase the stringcount.What about the scripts themselves?If i say add an empty dummy script to an object will that bake and increase the count? Link to comment Share on other sites More sharing options...
maxarturo Posted May 15, 2021 Share Posted May 15, 2021 I have the same query as you... Link to comment Share on other sites More sharing options...
ReDragon2013 Posted May 15, 2021 Share Posted May 15, 2021 (edited) For Skyrim (32-bit) exists a tool called "TESVESSE.exe" TESV Savegame Editor made by fubrus. https://www.nexusmods.com/skyrim/mods/27119/You are able to open a savegame ".ess file" and look what is happen inside.Under Global data table 3 > 2 Papyrus > Strings (string count)you'll see what kind of strings are stored in the savegame.Every loaded script name, as well as properties and variables inside, is baken. At the end of the stored strings you can find the strings of active scripts like temp0, temp1, GotoState etc.That means: "What about the scripts themselves?"Yes, depends on this object is loaded in Skyrim, the name of an attached script is baken to savegame. Edited May 15, 2021 by ReDragon2013 Link to comment Share on other sites More sharing options...
NexusComa2 Posted May 15, 2021 Share Posted May 15, 2021 The saves should just hold script variables and a reference to where the script is. Not the script itself. Link to comment Share on other sites More sharing options...
NexusComa2 Posted May 15, 2021 Share Posted May 15, 2021 I'd assume a bugged script may eat up string space as it will bloat saves. Link to comment Share on other sites More sharing options...
testiger2 Posted May 17, 2021 Author Share Posted May 17, 2021 (edited) So i looked into it a bit and id like to conclude a little summary in the way i understand it.--Inside the save's papyrus sections we have to sections that are of importance:- The saved/baked strings, called stringList from here on- The saved/baked script instances, called instanceList from here onFor the sake of this writeup i will from here on refer to the count of stringList as stringcount and to the count of instanceList as instancecount.We(i) already know that stringList is limitied to a reach of an uInt16 which stops at 2^16-1 meaning ~65k entriesSo we could assume that instanceList is also limited to about ~65k entries.Question: Yes/No ?Question2: Does breaking the limit of instanceList also break saves or is this exlusive to breaking stringList's count?Lets first examine stringList-----------------------------One thing i immediately noticed is that stringList does not contain any duplicates.Meaning vars/props get stored in stringList as a per string and not per script basis.So if 2 or more scripts contain a variable like int iVarSomethingSomething = 1then the name of "iVarSomethingSomething" will only be added once no matter how many scripts use the same variable name.The same rule applies if the same script is instanced to multiple objects.And the same rules also apply to the script names themselves.So to answer OP's (my) initial question: when using a dummyscript like ScriptName SomethingScript extends Form you increase the stringcount by exactly 1. Doesn't matter where or how often it is attached or instanced.Another important info i gathered is that literals can also bake.In my testing i found several string literals (and even some integer literals)A little string array init like Pages = new string[3] Pages[0] = "$General" Pages[1] = "$Favorite Groups" Pages[2] = "$Advanced" can increase the stringcount up to 4.The array itself uses 1 entry but initialising every entry can quickly rile up stringcount. I guess this is what @ReDragon2013 refered to in an earlier post when he mentioned active scriptsQuestion: Is this behaviour limited only to active scripts ?Question2: Do editor filled arrays behave the same? Time to test...laterNow lets look into instanceList-------------------------------As the name instanceList suggest this list stores the script instances in the save.This goes per scriptExample: If you create 2 ObjectReferences that contain the same script you will increase the instancecount by 2.If you create 2 ObjectReferences and add 2 scripts each you increase the count by 4 etc.Going by this extending ObjectReference and Actor (both which are Instances of base forms by design) should be used with care.Baseforms should increase the instancecount on a per Formid/EditorId basis.Example if you add a script that extends a baseform class you increase the count by 1 no matter how many instances of it you create.Question: Does the same script that is attached to objs with different Formids increase count further? Time to test...later--The above summary just mirrors my findings from playing around with save editors a bit and may not be accurate.If you have more in-depth info on this topic please chime in and correct me where my observations are wrong or add into it. Edited May 17, 2021 by testiger2 Link to comment Share on other sites More sharing options...
NexusComa2 Posted May 19, 2021 Share Posted May 19, 2021 (edited) " i will from here on refer to the count of stringList as stringcount and to the count of instanceList as instancecount."They are variables, be it whatever type ... You could bloat a save with many long strings in variables and even multi-arrays filled with very long strings.It's like I said .. "The saves should just hold script variables and a reference to where the script is. Not the script itself."and "I'd assume a bugged script may eat up string space as it will bloat saves." ... This isn't unique to Skyrim. It's how compliers set things up.Actually the mod holds the "reference to where the script is" Until it is loaded in memory ... then it's reference links to that location. Edit: Some of the strings saved as variables are actual script snips themselves and are used for interrupts. Edited May 19, 2021 by NexusComa2 Link to comment Share on other sites More sharing options...
testiger2 Posted May 21, 2021 Author Share Posted May 21, 2021 Well maybe i could have worded my initial question a bit better.Of course the savegame will not contain the actual scripts.The question could have been better worded this way:If you have an emtpy dummy script(meaning no vars/props whatsoever) will the script's reference still be baked into the save?If we we assume an unbugged script. Link to comment Share on other sites More sharing options...
NexusComa2 Posted May 21, 2021 Share Posted May 21, 2021 If it is being use in some way ... yes. The reference will be. And it will look something like this: 3A. As it's just and index reference number. Link to comment Share on other sites More sharing options...
Recommended Posts