Skip to content

Instantly share code, notes, and snippets.

@BinToss
Created October 20, 2023 06:52
Show Gist options
  • Save BinToss/5b37219765a8fa21184a69d3afead9f6 to your computer and use it in GitHub Desktop.
Save BinToss/5b37219765a8fa21184a69d3afead9f6 to your computer and use it in GitHub Desktop.
BetterInventory.patch for Fallout 76 Update October 10, 2023 (2023-10-10)

After setting up the BetterInventory auto-patcher as per the instructions in its README.txt...

  1. Compare old patch file to latest pipboy_invpage.class.asasm
  2. Manually apply patches in a copy named Pipboy_InvPage.class.asasm2. Search for unique keywords and phrases until you find the best match. There may be multiple fuzzy matches, so be careful of where you insert the patch!
  3. Run the following commands in Windows Command Prompt. The working directory must be the root of BetterInventory auto patcher e.g. Better Inventory Auto-Patcher 1.4-32-1-4-1663604449/
set TARGET_NAME=pipboy_invpage
set PATCH_TARGET=%TARGET_NAME%.swf
set PATCH_FILE=BetterInventory.patch
rmdir /S /Q "%TARGET_NAME%_patched-0" > NUL 2>&1
copy /b /y "%TARGET_NAME%.swf" "%TARGET_NAME%_patched.swf"
"rabcdasm/abcexport" %TARGET_NAME%_patched.swf
"rabcdasm/rabcdasm" %TARGET_NAME%_patched-0.abc
pushd "%TARGET_NAME%_patched-0"
git diff --patch --histogram --unified=10 --output=../BetterInventory.patch --no-index -- Pipboy_InvPage.class.asasm Pipboy_InvPage.class.asasm2
pushd ..
  1. Afterward, edit the new patch file to replace asasm2 with asasm.
  2. Now you can run autopatch.cmd to patch your pipboy_invpage.swf.

Done patching. What's next?

  1. Backup or delete pipboy_invpage.swf from the auto-patcher's directory.
  2. Rename pipboy_invpage_patched.swf to pipboy_invpage.swfand copy it to a new folder named interface
  3. Make a copy of your BetterInventory.ba2 and move the copy into a new folder.
  4. Open the copy with Archive2. Quick Configuration comes with a copy of Archive2 (although it's probably not allowed to).
  5. Click Archive > Add Folder...
  6. Select the interface folder from step 2
  7. Ctrl+S

If you're using Vortex or a similar mod manager, you may want to trick it into treating the new BA2 as a variant of BetterInventory instead of a new version altogether. In Vortex...

  1. Right-Click BetterInventory
  2. Reinstall
  3. Select Install as variant of the existing mod
  4. Continue
  5. (Optional) Name the new variant with the date the relevant Fallout 76 update was released e.g. 2023.10.10 (YYYY.MM.DD)
  6. Update current profile
  7. Right-Click BetterInventory again.
  8. Open in File Manager
  9. Replace the BetterInventory.ba2 with the patched one you created earlier.
diff --git a/Pipboy_InvPage.class.asasm b/Pipboy_InvPage.class.asasm
index 010f670..28be0a7 100644
--- a/Pipboy_InvPage.class.asasm
+++ b/Pipboy_InvPage.class.asasm
@@ -279,20 +279,46 @@ class
getlex QName(PackageNamespace("Shared.AS3.COMPANIONAPP"), "CompanionAppMode")
getproperty QName(PackageNamespace(""), "isOn")
iffalse L238
getlocal0
getlex QName(PackageNamespace(""), "uint")
getproperty QName(PackageNamespace(""), "MAX_VALUE")
initproperty QName(PrivateNamespace(null, "Pipboy_InvPage/instance#0"), "previousSelectedNodeId")
L238:
+ getlocal0
+ findpropstrict QName(PackageNamespace("flash.display"), "Loader")
+ constructprop QName(PackageNamespace("flash.display"), "Loader"), 0
+ initproperty QName(PackageNamespace(""), "__betterInventoryLoader")
+
+ findpropstrict QName(PackageNamespace(""), "trace")
+ pushstring "InvPage loaded"
+ callpropvoid QName(PackageNamespace(""), "trace"), 1
+
+ findpropstrict QName(PackageNamespace(""), "addChild")
+ getlocal0
+ getproperty QName(PackageNamespace(""), "__betterInventoryLoader")
+ callpropvoid QName(PackageNamespace(""), "addChild"), 1
+
+ getlocal0
+ getproperty QName(PackageNamespace(""), "__betterInventoryLoader")
+ findpropstrict QName(PackageNamespace("flash.net"), "URLRequest")
+ pushstring "BetterInventory.swf"
+ constructprop QName(PackageNamespace("flash.net"), "URLRequest"), 1
+ findpropstrict QName(PackageNamespace("flash.system"), "LoaderContext")
+ pushfalse
+ getlex QName(PackageNamespace("flash.system"), "ApplicationDomain")
+ getproperty QName(PackageNamespace(""), "currentDomain")
+ constructprop QName(PackageNamespace("flash.system"), "LoaderContext"), 2
+ callpropvoid QName(PackageNamespace(""), "load"), 2
+
returnvoid
end ; code
end ; body
end ; method
trait slot QName(PackageNamespace(""), "List_mc") type QName(PackageNamespace("Shared.AS3"), "BSScrollingList") end
trait slot QName(PackageNamespace(""), "ComponentList_mc") type QName(PackageNamespace("Shared.AS3"), "BSScrollingList") end
trait slot QName(PackageNamespace(""), "ComponentOwnersList_mc") type QName(PackageNamespace("Shared.AS3"), "BSScrollingList") end
trait slot QName(PackageNamespace(""), "ItemCardScrollable_mc") type QName(PackageNamespace(""), "ItemCardScrollable") end
trait slot QName(PackageNamespace(""), "ModalFadeRect_mc") type QName(PackageNamespace("flash.display"), "MovieClip") end
trait slot QName(PackageNamespace(""), "PaperDoll_mc") type QName(PackageNamespace(""), "PaperDoll") end
@@ -3110,20 +3136,39 @@ L7:
localcount 5
initscopedepth 14
maxscopedepth 15
code
getlocal0
pushscope
pushbyte 0
setlocal 4
+ getlocal0
+ getproperty QName(PackageNamespace(""), "__betterInventoryLoader")
+ getproperty QName(PackageNamespace(""), "content")
+ coerce_a
+ setlocal3
+
+ getlocal3
+ iffalse L999
+
+ getlocal3
+ getlocal1
+ getlocal2
+ callproperty Multiname("ProcessUserEvent", [PackageNamespace(""), Namespace("http://adobe.com/AS3/2006/builtin"), PackageInternalNs(""), StaticProtectedNs("flash.display:MovieClip"), StaticProtectedNs("flash.display:Sprite"), StaticProtectedNs("flash.display:DisplayObjectContainer"), StaticProtectedNs("flash.display:InteractiveObject"), StaticProtectedNs("flash.display:DisplayObject"), StaticProtectedNs("flash.events:EventDispatcher")]), 2
+ iffalse L999
+
+ pushtrue
+ returnvalue
+
+L999:
pushfalse
setlocal3
getlocal0
getproperty QName(PackageNamespace(""), "ModalFadeRect_mc")
getproperty QName(PackageNamespace(""), "visible")
pushtrue
ifne L13
pushtrue
@@ -4149,20 +4194,21 @@ L38:
decrement
convert_i
L44:
setproperty QName(PackageNamespace(""), "selectedIndex")
returnvoid
end ; code
end ; body
end ; method
end ; trait
+ trait slot QName(PackageNamespace(""), "__betterInventoryLoader") type QName(PackageNamespace("flash.display"), "Loader") end
end ; instance
cinit
refid "Pipboy_InvPage/class/init"
body
maxstack 1
localcount 1
initscopedepth 13
maxscopedepth 14
code
getlocal0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment