Skip to content

Instantly share code, notes, and snippets.

@matortheeternal
Last active September 28, 2019 22:05
Show Gist options
  • Save matortheeternal/fa13e27351998daae0bfba82584f5786 to your computer and use it in GitHub Desktop.
Save matortheeternal/fa13e27351998daae0bfba82584f5786 to your computer and use it in GitHub Desktop.
registerPatcher({
info: info,
gameModes: [xelib.gmTES5, xelib.gmSSE],
settings: {
label: 'Weightless',
templateUrl: `${patcherUrl}/partials/settings.html`,
defaultSettings: {
weightModArmor: 1.0
}
},
execute: (patchFile, helpers, settings, locals) => ({
process: [{
load: {
signature: "ARMO",
filter: () => settings.weightModArmor !== 1.0
},
patch: rec => {
let originalWeight = xelib.GetValue(rec, 'DATA\\Weight');
let newWeight = parseFloat(originalWeight) * settings.weightModArmor;
xelib.SetValue(rec, 'DATA\\Weight', newWeight.toString());
}
}]
})
});
{
"id": "weightlessPatcher",
"name": "Weightless Patcher",
"author": "Predence00",
"version": "1.0.0",
"released": "0/0/2019",
"updated": "9/28/2019",
"description": "A patcher to change item weights.",
"requires": ["unifiedPatchingFramework"],
"moduleLoader": "UPF",
"canHotLoad": false
}
<h2>Weightless Patcher</h2>
<section>
<label>
<span class="input-label">Armor Weight Mod</span>
<number-input type="decimal" model="settings.weightlessPatcher.weightModArmor"></number-input>
</label>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment