Author Topic: Save on rest  (Read 322 times)

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Save on rest
« on: June 14, 2012, 11:53:24 pm »


                Perhaps I don't understand how saving the players info to servervault works. I'm under the assumption that it's automatic, but not on every heartbeat. 

My question is: Can I have the player 'save' to servervault when they rest? Again, I think I'm asking this question without knowing how the save works in the first place. 

Thanks for any clearification.

Buddywarrior
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Save on rest
« Reply #1 on: June 15, 2012, 12:13:53 am »


               Player character is saved automatically into servervault only when: player exit module or player hit the export character button in game options.

Therefore is recommended to save them manually by script.

Function ExportSingleCharacter will do that - simply add this function into OnRest code.

Should consider adding it into Acquire/UnAcquire as well and and to make recursive delayed function in OnLoad that save all characters in game too.

Think I ve made such function in my no-hak PW starter module.
               
               

               


                     Modifié par ShaDoOoW, 14 juin 2012 - 11:14 .
                     
                  


            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Save on rest
« Reply #2 on: June 15, 2012, 12:58:25 am »


               done and done! Thanks ShadoOow!
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Save on rest
« Reply #3 on: June 15, 2012, 01:43:17 am »


               You can also save them on death/raise/entering safe town etc... whenever you think a important event happens.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Save on rest
« Reply #4 on: June 15, 2012, 02:20:41 am »


               That functions saves to the vault the server is using? I did not realize that. *slaps head*

For the server vault, does it create a new version of the character file or overwrite the existing?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Save on rest
« Reply #5 on: June 15, 2012, 02:25:16 am »


               overrride existing

also note: beware ExportAllCharacter function, I did not tested it myself actually but in past I heard rumours it does causes lags. Perhaps not "lagging" but maybe a instant server-side pause to save all characters in one moment. Maybe problem only in big player count, its more safer to use ExportSingleCharacter with some delay for each PC.
               
               

               
            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Save on rest
« Reply #6 on: June 17, 2012, 03:14:38 am »


               is it possible to suppress the "Player was exported successfully" when using the ExportSingleCharacter?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Save on rest
« Reply #7 on: June 17, 2012, 03:22:12 am »


               

Buddywarrior wrote...

is it possible to suppress the "Player was exported successfully" when using the ExportSingleCharacter?

its not a standard behavior at servervault. You get this message only in singeplayer mode where the character is also saved into your localvault (something you should consider not to do otherwise your localvault will blown up)

Or player might see this message when exporting a character from servervault, but in this case its usefull.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Save on rest
« Reply #8 on: June 17, 2012, 03:44:11 am »


               Just another warning of note.  I have heard it reported that exporting a PC who has left the game will cause a server crash.  It has been suggested in the past that the Export always be wraped with a check to make sure that the PC being exported is still valid.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Save on rest
« Reply #9 on: June 30, 2012, 03:41:26 am »


               Is it also necessary to check whether the PC is polymorphed?

This from the Lexicon:
1.61 Bug: Exporting polymorphed characters causes the character to de-polymorph and re-polymorph. For the Hordes of the Underdark Shifter Prestige class, this causes all the equipment bonuses to be lost. (Early versions of Neverwinter Nights would incorrectly write out the data for the polymorphed creature causing character corruption.)