Closed solderq35 closed 10 months ago
This is awesome! Few concerns:
The allunlockables.json file used to be a straight up copy from the game, right? That means we need to run this script to automatically add this data on every game update, and the script should thus also be in the repo I think.
My initial thought was to just include a copy of the full repository as well, but @RDIL will probably dislike adding that much data to memory.
While I'm not entirely sure how plugins would affect this, it will definitely not work for any items added with SMF, as the lastdeploy json currently only has a list of unlockables, and no repo entries.
The repository is a multi-megabyte game asset, and from a quick benchmark, it takes almost a second to parse and until it’s GC’d takes up ~20mb so I think shipping it is a bad idea
I think the best way to move forward here would be:
I updated script / menudata logic to work for the other games (well I don't have Hitman sniper challenge, but I tested H1 / H2 / H3).
Also I'm pretty sure sniper challenge (Scpc) would be fine anyways, since the mode allows large weapon (sniper rifles) by default, and there are no agency pickup or hidden stash in that mode.
Usage instructions (also commented on the script):
packaging/add_itemsize/
packaging/add_itemsize/
directory, run: node add_itemsize.js <path to Runtime> <Game Version (H1 / H2 / H3 / Scpc)>
node add_itemsize.js "C:\Program Files\Epic Games\HITMAN3\Runtime" H3
Feel free to make any necessary adjustments to this.
I don't know enough about how SMF or plugins work to comment on that.
Edit: another idea would be to check to see if itemsize exists, otherwise use old logic to check if item is carriedweapon. That would help prevent breaking old plugins or smf mods
Interestingly enough, H1 chunk0 files did contain info for "PROP_MELEE_EIFFELSOUVENIR_CLUB" (repository ID: 7257eaa1-c8f3-4e0c-acbf-74f73869c1b2), with itemSize of large. I think this item is bugged anyways though
EDIT: Added a check for chunk0patch300 as that's what SMF uses. Otherwise verify files to prevent weird results
Script checks for each chunk0patch in order otherwise
Thanks @solderq35!
Fixes https://github.com/thepeacockproject/Peacock/issues/333
Used rpkg cli to check itemSize as suggested by @grappigegovert
NodeJS / RPKG CLI script I used: https://github.com/solderq35/hitman-tech-tips/blob/main/modding/add_itemsize.js
The only item in allunlockables.json that I couldn't find in rpkg was "PROP_MELEE_EIFFELSOUVENIR_CLUB" (repository ID: 7257eaa1-c8f3-4e0c-acbf-74f73869c1b2). So feel free to update the itemsize for that if it's known.
Edit: Also realized later that Brine Damaged SMG (repository ID: 79f8c0e9-4690-4ebf-b2b3-fd8411a1407f) has "ItemSize: small" despite being a "carriedweapon", so I changed the logic in menuData.ts to reflect that. The Brine Damaged SMG is equippable to hidden stash, but not concealed weapon slot on vanilla servers.
Use cases tested: