Guerlot Posted July 19, 2017 Share Posted July 19, 2017 Hi there,I have a question regarding a potential mod update I am planning that would clean some of the scripts currently used.I'm working on my first quest mod ever, already published. And of course, I made some rookie mistakes which was creating my own scripts. I'm talking about simple scripts like onRead ones or ContainerChange ones.I didn't know there were default scripts in CK which are doing the exact same thing.So, my current plan is to replace those "custom" scripts with the default ones in order to clean my mod as much as possible.My questions are:- Once the cleaning is done and the old custom scripts are no longer needed and deleted from my own PC, will the update remove the old scripts from the player's machine? What of .ba2 files (for my XB1 version)? What of Loose Files (for my Nexus version?- Should I simply ask the current users to be safe and delete the old one and install the new one, forcing them to lose any progress (which is not that big honestly, maybe an hour or two max)?Thanks in advance! Cheers Link to comment Share on other sites More sharing options...
JackRob Posted July 22, 2017 Share Posted July 22, 2017 New .ba2 will overwrite the old one for XB1 users updating, therefore removing the old, now unused scripts. For PC users using NMM, the old scripts should be removed when they uninstall the old version of the mod, and replaced with your new set of scripts when they install your new version, so no unused loose files should remain unless the user manually installed your mod. Just in case, it wouldn't hurt to inform your users which scripts in their Data/Scripts folder they should remove in case it still remained, though the only harm they're doing is taking up hard drive room. Protip: You should test if updating your mod in the middle of your quest will mess the quest up, and if it does, the user should be informed that they should update before or after the quest has started/finished. Link to comment Share on other sites More sharing options...
JonathanOstrus Posted July 22, 2017 Share Posted July 22, 2017 Oh man what a potential nightmare you are preparing for. There's no inherent problem with leaving your own custom scripts there unless you did something wrong in them that is causing a problem, in which cause I'd suggest just fixing the problem instead of changing to another script. Switching to generic ones that Bethesda made could just make things break. The *only* drawback I see in leaving yours in place is that your scripts will take a little more disk space to store the pex files. It seems like you may already understand this but I'm going to state it just in case. Changing scripts mid play on objects can be have repercussions ranging from things that just stop working to outright corrupting a save making it unloadable. A prime example is that any object that is already spawned that has scripts changed on the base object won't get updated and just stops working. Example: You have some chest that is spawned when a quest stage is triggered. It has a script that handles some on container change or whatever. If you delete the original script and add another (an included default one as you suggested), neither script will fire on that object because you just broke it. The original won't fire because you've removed it (there will be an error in the papyrus log file stating such). The new one won't fire because the script wasn't attached on the base object upon instantiation of the reference. That is a best case scenario. Things just stop working. Worst case is it could cause corruption of a save. Depending what the scripts were attached to and how they operate and whether something was in the middle of execution when a save was created. It's pretty unlikely that this scenario would happen, but it *is* possible. Note: DO NOT tell your users to uninstall the mod and do a so called "clean save" by loading and re-saving without your mod and then reinstalling your mod is dangerous. This *IS* not and never has been safe to do. This will cause orphaned references and script instances which will never get cleaned up. This could also cause a save corruption. Best case scenario it just bloats the save. Worst case it corrupts it. Link to comment Share on other sites More sharing options...
kitcat81 Posted July 22, 2017 Share Posted July 22, 2017 (edited) BigAndFlabby is right about replacing the script on the run. It`s not a good idea. However, uninstalling the mod that contains scripts is usually fine if you mod does not contain loose files(In this case loose files = pex files in the Script folder). So packing your files into BA2 makes the mod safer to use. Though you still should test it yoursef to check that it won`t cause any problems. The first load after uninstalling will cause log errors of the same type . Something like :[07/22/2017 - 10:38:56AM] warning: Unable to get type YourScriptName referenced by the save game. Objects of this type will not be loaded. Saving and reloading again makes your game clean of these remnants and log errors. If your scripts are not packed into BA2, then manually removing them from the Script folder should do the same thing. This works , asuming thar your mod attaches custom scripts to custom objects(=custom ID). These objects should all disappear after uninstalling. It might lead to another results with default vanilla scripts or objects. Have not tested it. In general I agree with the previous post. There is no point to go through all this just to replace a couple of small scripts. This won`t make any significant difference and does not worth it. Furthermore, if you decide to add some more functionality to the script, you`ll have to go back to custom scripts. Forgot to say one important thing. This all works with total uninstalling. To avoid errors in case of reinstalling you`d probably have to change all custom objects ID`s and script names ( = creating copies of your custom scripted objects including quests , changing properties and totally removing previous files from the esp) . Otherwise you would get back some log errors but of another type (mostly missing property). Tough not all errors are dangerous, but still better to avoid. Edited July 22, 2017 by kitcat81 Link to comment Share on other sites More sharing options...
Guerlot Posted July 23, 2017 Author Share Posted July 23, 2017 Thank you guys for the detailed answers, I really appreciate it. I will totally leave these scripts alone. They are small and w t hurt anything for sure. Cheers! Link to comment Share on other sites More sharing options...
Recommended Posts