TommInfinite Posted November 4, 2021 Share Posted November 4, 2021 Hello!I'm developing a F4SE plugin and wondering whether should I add "ModLocalData" functions - temporary data which is valid only through gamesession and non-save baked. https://geckwiki.com/index.php?title=Mod_Local_Data Is this possible with current papyrus functions? Link to comment Share on other sites More sharing options...
DieFeM Posted November 4, 2021 Share Posted November 4, 2021 It seems a bit useless in a game in which you can save and quit the session almost at any time, I mean, using a type of data that could become unavailable at any given time is not reliable for any task I could imagine.That would be useful the other way around, if it was available not only in the current save but across all saves, so that we could have a container, an inventory or even a whole settlement in sync between saves. Link to comment Share on other sites More sharing options...
RoNin1971 Posted November 4, 2021 Share Posted November 4, 2021 It seems a bit useless in a game in which you can save and quit the session almost at any time, I mean, using a type of data that could become unavailable at any given time is not reliable for any task I could imagine.That would be useful the other way around, if it was available not only in the current save but across all saves, so that we could have a container, an inventory or even a whole settlement in sync between saves.I don't know a thing yet about papyrus, haven't had the time or need, yet (I will at some point) but I do know: IF there is a way to read&write data to somewhere outside the game using papyrus, like a text file or the registry or some other way. Then it should be possible to create such container. Link to comment Share on other sites More sharing options...
niston Posted November 4, 2021 Share Posted November 4, 2021 It's not currently possible to do this with Papyrus. Link to comment Share on other sites More sharing options...
TommInfinite Posted November 5, 2021 Author Share Posted November 5, 2021 It's not currently possible to do this with Papyrus.thanks. It seems a bit useless in a game in which you can save and quit the session almost at any time, I mean, using a type of data that could become unavailable at any given time is not reliable for any task I could imagine.That would be useful the other way around, if it was available not only in the current save but across all saves, so that we could have a container, an inventory or even a whole settlement in sync between saves.This is used to keep track of temporary changes made with F4SE which persist through gamesession and you can't check for anything since all your variables are save-baked. I agree, it's very situational. Link to comment Share on other sites More sharing options...
niston Posted November 5, 2021 Share Posted November 5, 2021 There's also the fact that having too much crap in your save will kill it.Nice things like Buffout 4 make a big difference regarding this: You can have waaaay more crap in your saves before they die.If a solution to store all this crap outside of a save and/or co-save (ie in an external file) existed however, I'm sure some sensible mod authors would choose to benefit from that. Btw: There is still a USD 200 bounty on a native function to cleanly remove strings from the game's string pool (but it MUST be open source and it MUST NOT introduce any adverse side effects). Link to comment Share on other sites More sharing options...
TommInfinite Posted November 5, 2021 Author Share Posted November 5, 2021 Btw: There is still a USD 200 bounty on a native function to cleanly remove strings from the game's string pool (but it MUST be open source and it MUST NOT introduce any adverse side effects).Wait what? Can you please describe this to me? Link to comment Share on other sites More sharing options...
niston Posted November 7, 2021 Share Posted November 7, 2021 When you use a string in a papyrus script, the string may get persisted to the save. The reason being that (dynamically created) strings inside the game are stored in the game's string pool: When the string "Foo-Bar" ends up in the string pool upon first usage/introduction, all subsequent use of this string (and all upper/lowercase variants of it, foO-bAr, FoO-BAR, etc...) will reference the Foo-Bar instance in the string pool. This was a VERY BIG problem for my little Papyrus Terminal project. Essentially, everything you ever PrintLine()d to the Terminal would end up in the save. As a result, at some point, the save would fail to load. So I put a $100 Bounty on a native function that cleanly wipes a string from the game's string pool. Fudgyduff aka RyanM of F4SE and Buffout4 and probably Skyrim also fame then explained that: One does not simply remove a string from the string pool (without causing data corruption). So I raised the bounty to $200, because apparently what I wanted was not going to be easy to achieve. HOWEVER. The fabulous Ian Patterson, also of F4SE fame, came up with a surprisingly simple, working solution to the problem that uses no f4se/plugin magic at all, so the function is no longer required. Link to comment Share on other sites More sharing options...
TommInfinite Posted November 7, 2021 Author Share Posted November 7, 2021 When you use a string in a papyrus script, the string may get persisted to the save. The reason being that (dynamically created) strings inside the game are stored in the game's string pool: When the string "Foo-Bar" ends up in the string pool upon first usage/introduction, all subsequent use of this string (and all upper/lowercase variants of it, foO-bAr, FoO-BAR, etc...) will reference the Foo-Bar instance in the string pool. This was a VERY BIG problem for my little Papyrus Terminal project. Essentially, everything you ever PrintLine()d to the Terminal would end up in the save. As a result, at some point, the save would fail to load. So I put a $100 Bounty on a native function that cleanly wipes a string from the game's string pool. Fudgyduff aka RyanM of F4SE and Buffout4 and probably Skyrim also fame then explained that: One does not simply remove a string from the string pool (without causing data corruption). So I raised the bounty to $200, because apparently what I wanted was not going to be easy to achieve. HOWEVER. The fabulous Ian Patterson, also of F4SE fame, came up with a surprisingly simple, working solution to the problem that uses no f4se/plugin magic at all, so the function is no longer required.Interesting. What was the solution? Link to comment Share on other sites More sharing options...
niston Posted November 7, 2021 Share Posted November 7, 2021 Unload the script with the strings and it's entries in the string pool go poof (unless an entry is referenced by other scripts as well, but that's perfectly fine). Link to comment Share on other sites More sharing options...
Recommended Posts