Scripts can be used with the Control Save Editor to perform functionality that is not available via the save editor UI.

How to use scripts:

  • Back up your savegame.
  • Load your persistent savegame into the Control Save Editor. Check that the "Save Changes" button is greyed out, indicating no changes have been made yet.
  • Press Control+Shift+J (for Chrome) to open the JavaScript console. For other browsers, use their respective browser consoles.
  • Copy and paste the script into the console and press Enter.
  • Choose "Save Changes" to download the modified savegame.


Add Collectibles to Inventory

Steps:
1. Locate the collectible that you want to add in the String Table.
2. Locate the collectible's global ID (GID) in the collectibles GID list.
3. Modify the first line of the script below to include the collectible's GID and include a trailing "n" suffix after the ID, as shown in the example below.

Script:
Spoiler:  
Show
let IDS_TO_ADD = new BigUint64Array([0x0000000000000000n])
let obj = saveData.data.playerPropertiesChunk.ktValue.data.foundNarrativeObjects
let getAddr = ([ktParent, name, prop]) => ktParent._debug[name].ioOffset + ktParent._debug[name][prop]
let [lenStart, arrEnd] = [[obj, 'numItems', 'start'], [obj, 'gid', 'end']].map(getAddr)
new DataView(saveData.getBuffer()).setUint32(lenStart, obj.numItems + IDS_TO_ADD.length, true)
saveData.regionManager.addRegion(arrEnd, new Uint8Array(IDS_TO_ADD.buffer))


Unequip all equipment from player

This will unequip all currently equipped weapons and personal mods, returning them to your inventory.

Script:
Spoiler:  
Show
// Unequips all items equipped on the player.
let equipped = saveData.data.inventoryActiveItems
for (let i = equipped.length - 1; i >= 0; i--) {
if (equipped.data[i].parentIndex.value == -2)
equipped.remove(i)
}

Article information

Added on

Edited on

Written by

registrator2000

0 comments