Skip to content

Suggestion - persistent local PC/item variables in localvault

Taro94Taro94 Member Posts: 125
edited December 2017 in General Discussions NWN:EE
So, for those who don't know - as of now, any local variables saved on the PC object or one of their items are deleted upon exporting the character, unless they are server vault characters.

I understand the intention behind this design: it is assumed that the PC won't need its variables from any previous module they played in when migrating to a new one and such previously stored variables can even potentially cause some unintended behavior (for example by replaying a module with the same character and having variables from a previous playthrough stored).

At the same time, I feel it could be handled in a much better way, for example by adding a ClearAllVariables function that builders could decide to use to avoid scenarios such as the one above. This would also give them control over what variables they'd like to clear - for example, they're likely to store variables on the PC object only and thus not need to clear any item variables. Not clearing item variables would make sequencer items (which function based on variables) work after exporting a character and starting a new module.

Alternatively, even a global switch on a module that would allow builders to have all variables on the PC and their items clean on entry or not would be a very welcome feature. This solution would make it easy to have pre-EE modules clear variables by default.

Remember that variable clear on character export is not always desired in local vault. Aside from the aforementioned sequencer clear, a builder may want their PCs to be able to "drop-in and drop-out" - that is, exporting their character, then starting a new game with it (for example to switch from an SP session to multiplayer) and continuing their progress in some way. This would work very well in less story-focused modules such as Good VS Evil III or Infinite Dungeons.

I'll admit that my own module, which is original in that it's an SP/LAN persistent world project, would also benefit from persistent local variables in localvault greatly. At the moment the only reliable workaround is a database, which is VERY inconvenient when switching between singleplayer and multiplayer sessions (send your database to the host, play on multiplayer, then have the host send the updated database back to you, etc). Not to mention potential problems related with deleting the character, but not its database, or playing with an earlier exported character version but with newer data from database, etc.

So, please, consider allowing local variables on exported character to persist :smile: They don't need to persist by default, but any way of allowing module builders to permit it would be extremely valuable.

Comments

  • ShadowMShadowM Member Posts: 573
    edited December 2017
    If you save the data to an Item is in a bag on the pc it will save the data on export and you can refer to that item for data retrieval and lock the item to the pc. Hope that helps.
  • RifkinRifkin Member Posts: 143
    Yes, this is actually something that old PW's used to use before the induction of NWNX... That good old "DB" item, that you were never supposed to lose.
  • Taro94Taro94 Member Posts: 125
    edited December 2017
    I know this solution, but it's very "dirty". I'd much rather have true persistent variables than worry that my player would misplace the DB item and lose all their data.

    A solution I'd prefer would be storing all the data as a big string saved on the PC skin's unidentified description (or identified, or both). It works rather well, but the description is, unfortunately, very limited and I can't store much this way.
  • FreshLemonBunFreshLemonBun Member Posts: 909
    I agree although setting the plot/stolen/curse flag should prevent loss it's not the ideal solution. You would rather just have variables saved to that PC's bic file if anything so it could be auto-loaded and called without care of persistence code either with an item or NWNX.
  • Taro94Taro94 Member Posts: 125

    I agree although setting the plot/stolen/curse flag should prevent loss it's not the ideal solution. You would rather just have variables saved to that PC's bic file if anything so it could be auto-loaded and called without care of persistence code either with an item or NWNX.

    Right. And in the case of the workaround proposed above, it's not enough not to lose an item - even if someone accidentally puts it out of a container and exports their character, the item's variables will be cleared, making it a very poor method of storing any persistent data.
  • ZoltanTheRedZoltanTheRed Member Posts: 11
    Echoing the above comment. Because of that it’d be nice if variables stored on items were a bit more resilient to being wiped.
Sign In or Register to comment.