TangerineDog Posted January 8, 2018 Share Posted January 8, 2018 How can I update Papyrus script properties in an existing game? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 9, 2018 Share Posted January 9, 2018 Easy answer: You don't Hard answer: Depends on what object has the script attached. If an inventory item, you can discard the old and bring the new. A new instance will use the new values.If on a quest, stop the quest. When restarted it will use the new values.If a spell with a scripted effect, the next cast should use the new values.If a pre-placed reference, wait for the cell to reset (default 30+ days). Harder answer: Pass new values into the old variables. This is easier said than done. Typically, it would be a new script with new properties. The new properties would have the new data assigned. Then either the old script calls upon the new script or the new script has a function or event which calls upon the old script. Either way, the new values get passed into the old properties. And you may get lucky just updating the script properties and using one of those save game cleaners to remove the previous instances of the script. But I cannot speak to the effectiveness of that. I just know of some mods that do that to update mid-game. Lets leave room for error and additional possibilities. After all, it has been a while since I've modded or played Skyrim. Link to comment Share on other sites More sharing options...
TangerineDog Posted January 9, 2018 Author Share Posted January 9, 2018 (edited) Easy answer: You don't Hard answer: Depends on what object has the script attached. If an inventory item, you can discard the old and bring the new. A new instance will use the new values.If on a quest, stop the quest. When restarted it will use the new values.If a spell with a scripted effect, the next cast should use the new values.If a pre-placed reference, wait for the cell to reset (default 30+ days). Harder answer: Pass new values into the old variables. This is easier said than done. Typically, it would be a new script with new properties. The new properties would have the new data assigned. Then either the old script calls upon the new script or the new script has a function or event which calls upon the old script. Either way, the new values get passed into the old properties. And you may get lucky just updating the script properties and using one of those save game cleaners to remove the previous instances of the script. But I cannot speak to the effectiveness of that. I just know of some mods that do that to update mid-game. Lets leave room for error and additional possibilities. After all, it has been a while since I've modded or played Skyrim. I'm after quests, mainly. I'll probably have to do more than just update the properties though, I'm trying to call different object types, so the quests will need to start anew with the edited scripts.Two more questions there: First, stopping a quest, not finishing, but stopping it, how do I do that?And if the quest had Start Game Enabled ticked, does that make any difference? Edit:a) by creating a script with the command QuestID.Stop()b) yes. It means you have to start the quest again - by adding the command QuestID.Start() to the script Edited January 9, 2018 by TangerineDog Link to comment Share on other sites More sharing options...
simtam Posted January 10, 2018 Share Posted January 10, 2018 How can I update Papyrus script properties in an existing game?With Papyrus script, simply. Properties can be accessed and updated from another script - regular variables only from within the script they are declared in (so that complicates the thing) If you change the property value in Creation Kit, it won't get changed so in existing and/or already loaded objects. New objects may get the new value. But sooner or later you will come up with having to update a property value in a live script, and it won't work. Fortunately, newly added properties are initialized to the chosen values, so the most safe way to update a script property is to make a new property and have a script that will copy the new property value to the property you want to change ASAP. (btw you can update Papyrus scripts, including quest fragments scripts - but, of course, what was already executed, such as quest objective displayed, won't change! - and the functions that are currently executing will go on using their old version, until completed... so there's an answer to your other thread...) Link to comment Share on other sites More sharing options...
TangerineDog Posted January 10, 2018 Author Share Posted January 10, 2018 (edited) The good news:I created a simple object that stops and starts a quest. Using it produces the same results as starting a new game.I have even successfully changed the reward for a quest I stopped and restarted in an existing save. The bad news:The affair gets iffy if I want to change which objects you need to collect.Even if I don't mess with the scripts but just change the properties in the CK (same as I did with the reward) and restart the quest, the game just decides to accept neither the old nor the new wanted objects. I can have hundreds of both and the quest still tells me I have 0. Edited January 10, 2018 by TangerineDog Link to comment Share on other sites More sharing options...
Recommended Posts