AmbrosiaPW wrote...
Hello,
I know now that if I set a variable on an NPC in game and reboot the server the variable doesn't get saved.
Variable on NPC do not get saved because you are not saving the game then starting the game by loading the saved game. You are booting back to a new game. This is really what you want to happen in a PW, cutting out the needless overhead and memory leaks.
While looking through this module I am modifying I noticed the creator does save variables on the PC. It looks like he uses ExportSingleCharacter(oPC); at the end. I'm assuming this saves the new variable on the PC so if the server reboots it will have the new variable?
This assumption is incorrect. Local Vars that are on the PC never get saved. This again is a good thing. Since very few scripters take the time to delete the local vars that they place on a PC. There would be so many vars stored on the PC that it would start to lag the game.
There is a ray of hope here though. even though the vars on the PC do not get saved, the vars placed on items in the PC's inventory do get saved. Most people who do not want to use the boiware DB, or other external DB to store there presistant data. Use an undroppable item in the PC's inventory to store there data on. Either creating the item or useing one that is already there, Like the DMFI dice bag.
As far as the Exporting the character, That is normally done, by some, when updating critical data on the item, to prevent exploits. Even though the number of exploits have already been cut down sice the PC is carrying his own DB with him. Still exporting the character protects the data encase of a server crash.