Author Topic: Imported character (items) losing their variables. Is there a work around?  (Read 532 times)

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0


               

Just spent all morning trying to find out what hidden bug in my scripting would cause items from saved characters to lose the variables in their items…only to find that it’s a friggin’ obnoxious behavior of NW.  Is there a work around for this?



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Imported character (items) losing their variables. Is there a work around?
« Reply #1 on: February 10, 2015, 10:13:09 pm »


               

Not technically a fix, but if you launch modules as if they are a LAN game and only use characters created with your server vault, the variables should carry over to other modules accessed the same way.



               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Imported character (items) losing their variables. Is there a work around?
« Reply #2 on: February 11, 2015, 12:02:24 am »


               

Thanks for the tip.



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Imported character (items) losing their variables. Is there a work around?
« Reply #3 on: February 11, 2015, 12:47:09 am »


               

Bioware specifically set local vault characters not to carry over variables, on items, or themselves to prevent possible exploits on Hosted Local Vault Modules. Unfortunately, DM Vault characters are treated the same as local vault ones too.



               
               

               
            

Legacy_MrZork

  • Hero Member
  • *****
  • Posts: 1643
  • Karma: +0/-0
Imported character (items) losing their variables. Is there a work around?
« Reply #4 on: February 12, 2015, 11:20:00 pm »


               BTW, as far as I know, items in a container in the PC's inventory keep their variables when the character is saved to the local vault. Obviously, it's something of a kludge to try and make sure a PC has an item and keeps it in a container in order to have that item available for storing campaign variables and so on, but it's a quirk that might be exploited.

For example, sometimes one of my toons has a sequencer item with a spell stored on it and I want to import that toon into another module. If I put the sequencer item in a magic bag and then save the character, the stored spell is remembered after I start the new module with that saved toon. If I don't, then the sequencer item shows up without any spells stored on it.

Probably, the more straightforward approach is to store variables that are intended to be persistent across modules in the database. But, that doesn't work well for lots of scripts (including tag-based scripts for custom items) that are scripted to look for local variables on the item or the PC.
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Imported character (items) losing their variables. Is there a work around?
« Reply #5 on: February 13, 2015, 03:33:12 am »


               


BTW, as far as I know, items in a container in the PC's inventory keep their variables when the character is saved to the local vault. Obviously, it's something of a kludge to try and make sure a PC has an item and keeps it in a container in order to have that item available for storing campaign variables and so on, but it's a quirk that might be exploited.


For example, sometimes one of my toons has a sequencer item with a spell stored on it and I want to import that toon into another module. If I put the sequencer item in a magic bag and then save the character, the stored spell is remembered after I start the new module with that saved toon. If I don't, then the sequencer item shows up without any spells stored on it.


Probably, the more straightforward approach is to store variables that are intended to be persistent across modules in the database. But, that doesn't work well for lots of scripts (including tag-based scripts for custom items) that are scripted to look for local variables on the item or the PC.




Is this with a server vault PC that has been saved and used in a local vault game or a local vault PC being saved and used again. Anytime I test variables written to an item, I've had to use my server to test it.


               
               

               
            

Legacy_MrZork

  • Hero Member
  • *****
  • Posts: 1643
  • Karma: +0/-0
Imported character (items) losing their variables. Is there a work around?
« Reply #6 on: February 13, 2015, 05:43:01 am »


               It works with a PC who was saved from a PW to my local vault and when that same toon is saved again from a locally run module to the local vault. Just in case I am not describing this clearly, I just did this for two cases and I describe the process below.

As preamble, for anyone not familiar with with sequencer items, their scripts store the spell IDs of their spells locally on the sequencer item. That's why I was choosing a sequencer item for the test (and I have tested this with other items whose scripts store variables on the item as local variables). Also, there are standard NWN sequencer items (e.g. Isaac's Sequencer Robe, resref x2_sequencer3) that others can easily use to test this without even opening the Toolset.

First case: I have a toon on a server vault PW who has a sequencer item with a spell stored on it. On the PW, I save that character to my local vault, after putting the sequencer item into a magic bag in the toon's inventory. Then I open a module locally with that saved character. His sequencer item still has the spell stored. To be clear, the sequencer would have been blank (giving a "no spell stored" message) had I not put the item in a container before saving.

Second case: I have that same toon (same sequencer item with the same spell on it) in a module running locally and do the same thing - put his sequencer item in a bag in his inventory and save the character to the local vault - the same thing happens when I start a new module with that just-saved character. In other words, whether the character is saved from a server vault module to my local vault or from a local vault module to my local vault, the character's items keep their local variables if the items are put in a container in the PC's inventory before I save the character.