Properties and saves

Post » Tue Jun 19, 2012 6:14 am

it seem that script properties are saved in the save game...
It's really bother me because if I need to change a property later, the savegame still using the old property !

Is that possible to "reset" properties or set it like it can't be saved ?
User avatar
FirDaus LOVe farhana
 
Posts: 3369
Joined: Thu Sep 13, 2007 3:42 am

Post » Mon Jun 18, 2012 2:08 pm

I'm having the same problem. This makes publishing any updates to mods that affect properties almost impossible

I want to change the script that is run on certain objects but if I do this - new versions of the objects work fine but the old objects still execute the old script.
There must be a way around this issue...
User avatar
Josh Sabatini
 
Posts: 3445
Joined: Wed Nov 14, 2007 9:47 pm

Post » Tue Jun 19, 2012 5:31 am

Have you tried creating a NEW save game and not saving over your current game?

Creating a new save file may fix the problem, also make sure that the old property exists when a cell is refreshed.

:cool:
User avatar
Marcin Tomkow
 
Posts: 3399
Joined: Sun Aug 05, 2007 12:31 pm

Post » Tue Jun 19, 2012 5:44 am

Yes. I did the following:
  • Start the game with all mods disabled.
  • Load savegame 371
  • save as savegame 378
  • quit game
  • start game with all mods still disabled
  • load game 378
  • click on the container - version 1 of the script runs.
  • move to another location in the game
  • save as game 379
  • quit
  • start game with a new mod (containing version 2 of my script) enabled
  • load game 379
  • go back into house (which is where the container is). Click on container - version 1 of the script runs.
  • load game 305 (from before version 1 of the mod ran)
  • click on the container - version 2 of the script runs.
  • tear hair out...
Any ideas (other than telling all of my subscribers that they'll have to revert to a saved game when from before version 1 ran)?
Surely this can't be compatible with a subscription model?
User avatar
Nadia Nad
 
Posts: 3391
Joined: Thu Aug 31, 2006 3:17 pm

Post » Tue Jun 19, 2012 3:31 am

i think you only need to load the previous save once, and then the cache stores the values persistently. back out to the main menu (don't close to desktop or else the cache will clear) and load your new save, then resave. that should offset the new properties back to normal.

i think this is the same glitch that lets you exploit merchant inventories and get unlimited gold by reselling the same thing over and over again by reloading saves.
User avatar
bonita mathews
 
Posts: 3405
Joined: Sun Aug 06, 2006 5:04 am

Post » Tue Jun 19, 2012 12:49 am

So you are saying I should do the following:
  • Disable mods
  • Load game 305
  • quit to main menu
  • load game 371
  • save game 371
  • quit
  • enable mod version 2
  • load game 371
This is what I'm going to try - I'll repost with the results...
User avatar
Horror- Puppe
 
Posts: 3376
Joined: Fri Apr 13, 2007 11:09 am

Post » Mon Jun 18, 2012 1:59 pm

There is no way to do it without disable the mod, load, save and reenable ??
The only thing i need is to set properties to not be saved in the savegame file.
I saw that using autoreadonly instead of auto will do it. But so far I didn't find a way to use it with form properties...
I hope it's possible, without that, mod update will be a nightmare !
User avatar
NEGRO
 
Posts: 3398
Joined: Sat Sep 01, 2007 12:14 am

Post » Mon Jun 18, 2012 10:51 pm

Ok... I messed around a bit (the above didn't work btw) but I have managed to get some strange results
So I did the following:
  • loaded game 305 with the latest version of my mod enabled
  • left the house (Breezehome)
  • re-entered the house
  • clicked on the container
  • script 2 ran
  • saved game 381
  • quit to main menu
  • loaded game 371
  • left and reentered breezehome
  • clicked on the container
  • script 1 ran but with what seem like the properties of script 2 present.
the plot thickens...
User avatar
Rachael
 
Posts: 3412
Joined: Sat Feb 17, 2007 2:10 pm

Post » Tue Jun 19, 2012 5:14 am

So, there is no way to set properties as constant ? Like global ?

It's a shame, my mod create new books and I have attached a script to all of them. The script check if the player have the correct skill and perk before doing an action.
So, if I made a change in the future, for exemple change the perk needed for one item, the only way to update this will be to unload and reload the mod, with the side effect to lost all the new books in the inventory... Great...

I recently see that autoreadonly are not saved, but, for some weird reason, it seem impossible to set it with form properties :

Scriptname HBESchematics extends ObjectReferenceint property SkillRequired=0 Autoreadonly ; <-- this one workPerk Property PerkRequired=none Autoreadonly ; <-- this one doesn't work !!GlobalVariable Property AbilityGiven  AutoHBEFunctions Property HBECore Autoevent onRead()Utility.WaitMenuMode(1)HBECore.SchematicsLearning(SkillRequired,PerkRequired,AbilityGiven)endEvent
User avatar
Nims
 
Posts: 3352
Joined: Thu Jun 07, 2007 3:29 pm

Post » Tue Jun 19, 2012 4:37 am

Tried to use Autoreadonly for an int, but it didn't really work also... Keep searching...
User avatar
Ella Loapaga
 
Posts: 3376
Joined: Fri Mar 09, 2007 2:45 pm

Post » Mon Jun 18, 2012 8:16 pm

This page on the wiki is very relevant to this thread - http://www.creationkit.com/Save_File_Notes_(Papyrus)

Cipscis
User avatar
Melissa De Thomasis
 
Posts: 3412
Joined: Tue Feb 27, 2007 6:52 pm

Post » Mon Jun 18, 2012 6:47 pm

I already read this wiki, but I'm not really sure it's working like it's described.

For exemple, this statement is not true :
Removing
If you remove a function that was in the middle of running when a save was made, the old function will be loaded from the save and allowed to finish. A warning will be printed to the script log, and further calls to the removed function (usually because some other changed or removed function is calling it) will fail.

To check it, I added a function to a script attached on a book. And added a debug.notification on the "onread" event and in the function.
If I uncheck the esp, and open the book, the two notification are always here.
All scripts seem to saved definitly in the savegame. I let you imagine the mess it can cause...

I already replied to this post for the same things : http://www.gamesas.com/topic/1348833-old-versions-of-mods-conflicting-with-newer-ones/page__gopid__20336233#entry20336233
User avatar
Hannah Barnard
 
Posts: 3421
Joined: Fri Feb 09, 2007 9:42 am

Post » Mon Jun 18, 2012 3:08 pm

You haven't removed the function though, unless you've altered the compiled script. The scripts stay attached in the save, but if your function is removed the old version will no longer be called.

I just tested this to confirm.

Cipscis
User avatar
Kayla Keizer
 
Posts: 3357
Joined: Tue Dec 12, 2006 4:31 pm

Post » Mon Jun 18, 2012 6:55 pm

Yeah, Cipsicis is right. Remember unlike previous Bethesda games Papyrus scripts are completely independent of the plugin files.

So while in Oblivion if you modified a script, the source and compiled script would be saved as a record in the ESP file. In Skyrim, it is not. Scripts and their compiled versions are saved in /Scripts and /Scripts/Source respectively, they have nothing to do with actual plugin files anymore. In your example, you just removed the ESP file. The compiled script is still there in the folder, it's untouched and therefore is still running.
User avatar
Chantel Hopkin
 
Posts: 3533
Joined: Sun Dec 03, 2006 9:41 am

Post » Mon Jun 18, 2012 9:46 pm

Just removed .pex file and the script doesn't update if i load the save game. Great ! Thank for the info. I thought removing esp will break link between esp and pex, but not.

So the only thing keep bother me is the saved properties value.
I saw that from the wiki :

Adding
  • Variable with a default value: The variable will have it's default value when the save is loaded. (This is the "int myVar = 5" syntax)
  • Variable with no default value: The variable will have no value when the save is loaded (0, empty string, None, or false)
  • Auto Property: The property will receive the value it was given in the master file, if any. (These are properties that end with the "auto" keyword, like so: "ObjectReference Property MyObject Auto"
  • Non-auto Property: The property will not receive the value it was given in the master file, if any. It will be blank.
Note: For obvious reasons, if the object's OnInit event has already run when the save was made, it will not be run again. Therefore, if you set up a new variable in the OnInit event, you cannot be guaranteed that that variable will have the proper value unless you are sure that object never existed in the save game before.

i think "master file" is the esp that old the script properties ? right ?
So, I tried to add a new int property on the script attached to my object, and set it to 50. Reloaded an old save, the new property is set to 0... Not good.
I don't really understand why, I think it's because the "onInit" has already run on the object, but i'm not sure this is applied for auto value also, because we can't add them in oninit block.

Some advice will be great. I really want to avoid delete script attached items, because it will lead to lost them in inventory.
User avatar
Miguel
 
Posts: 3364
Joined: Sat Jul 14, 2007 9:32 am

Post » Mon Jun 18, 2012 2:56 pm

...
I don't really understand why, I think it's because the "onInit" has already run on the object, but i'm not sure this is applied for auto value also, because we can't add them in oninit block.

Some advice will be great. I really want to avoid delete script attached items, because it will lead to lost them in inventory.
Yup...OnInit () only runs once.

Here was my suggestion for initGameLoaded (): http://www.gamesas.com/topic/1349590-init-at-game-load-and-init-at-game-restart/
User avatar
Josh Dagreat
 
Posts: 3438
Joined: Fri Oct 19, 2007 3:07 am

Post » Tue Jun 19, 2012 4:38 am

http://www.creationkit.com/OnInit, like all events, is basically exactly the same as the function. Being a native event, the game calls it at certain points in time, but it's not actually related to initialising properties.

OnInit is run once when an object is set up with a script, and then again whenever the object is reset.

Cipscis
User avatar
Spooky Angel
 
Posts: 3500
Joined: Thu Aug 10, 2006 5:41 pm


Return to V - Skyrim