Savegame Script Editor – Console Edition Mod
Fallout 4 uses the same scripting engine as Skyrim (Papyrus). The script data is written into your savegame in a similar fashion.
This tool allows you to review the script data inside the savegame, edit the variable values, remove script instances from the save, terminate stuck threads and more. It’s the successor of my Skyrim tool.
This is a console application, meaning that you have to type all the commands in the cmd window (or you can use the predefined batch files). Actually, the first console version was made 2 weeks after the game release and all that time I was trying to fix and polish the GUI wrapper, but I have hard times with it and I don’t know how soon it will be completed.
WARNING: The console version will NOT make backups for you. It’s your job.
Why do I need this?
– The GECK is still unreleased, but if you are going to build a scripted mod for FO4, you can already examine how the existing game scripts are interconnected and plan your modification ahead.
– You can examine what scripts are running in the background (the threads will be presented at the bottom of the output).
– You can gently terminate the stuck script if it’s entered the neverending loop [Make sure you understand the nature of the problem]. A rare case related to bugs inside the logic. No real incidents so far.
– You can gently change the specific script variable [Make sure you understand the nature of the problem].
Cases when you SHOULD NOT use this application:
– You DO NOT want to use this tool as an attempt to “increase the performance” or any other abstract reason. Any savegame editing without knowing the nature of the problem will go bad for you.
– You DO NOT need this for “cleaning” the FO4 saves in a traditional way, since (1) there are no scripted mods to uninstall so far, (2) I never heard of any serious script-related issues in FO4.
There were a bunch of reports describing that the game couldn’t load a save (like “Broken saves, Fallout 4”), but make no mistake – these issues are NOT related to scripts (I personally checked). I provided the “cleaning” batch file just in case. Most likely, you won’t have any orphans in your save (If you do, please provide the savegame sample to review).
In summary, I hope the tool can be useful for scripters and I don’t think it has any value for a regular user.
How to use?
Copy the Fallout4 savegame (*.fos) to the program folder.
Every editing operation WILL write changes to the savegame you provided. So, make a backup of this savegame.
Open the Command Line (Program folder -> CTRL+ Right click -> Open command window here)
1) How to get the savegame content:
PapyrusDataTransfer.exe -show Save.fos > ScriptRelatedContent.txt
2) How to change the script variable, Example:
PapyrusDataTransfer.exe -setvariable Save.fos 1 -filter “[and], ::MeleeEnabled_var ([variable_name]), ( FireFightStall_MasterScript ( [script_name] ), [and], 198a1a ( [ref_id] ) ”
After you load and save the game, this variable value should persist in all later saves (until changed by the script itself or any other script). You can check the variable value by getting the content using the show command.
Pointer variables are supposed to be linked with another script, they are just integers as well, so you can set them in a similar fashion (copy the ScriptID of the target instance).
3) How to remove a script from the savegame, Example:
PapyrusDataTransfer.exe -remove Save.fos -filter “( FireFightStall_MasterScript ( [script_name] ), [and], 198a1a ( [ref_id] )”
After your load the new save, if the related object (to which script was attached) still exist in the world, the game should recreate the script with default values (same engine behavior as with Skyrim).
4) How to terminate threads (active running functions).
PapyrusDataTransfer.exe -terminate Save.fos -filter “Default2StateActivator ( [script_name] )”
If the function was running at the moment of making a savegame, it’s bytecode is written into the savegame itself (as it was with Skyrim). The tool allows to replace this bytecode with Nop values (NoOperation), therefore it can unstuck neverending loops or calls.
The Fallout4 savegame structure differs from Skyrim (few changes in the overall structure, new tables in the Papyrus section, new object attributes, etc). Also, there are new data types in the language itself. For example, you can now define your own custom structures and create them dynamically.
The tool is backward compatible with the Skyrim savegames.
Huge thanks to AlexanderBlade for the opcode reference for Fallout 4.
If you think you have a script related issue but don’t know how to use the tool, please, provide as much details as possible in the comments section.