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.