thepeacockproject / Peacock

The Peacock Project is a HITMAN™ World of Assassination trilogy server replacement.
https://thepeacockproject.org
GNU Affero General Public License v3.0
387 stars 60 forks source link

Check for small item sizes for hidden stash #359

Closed solderq35 closed 10 months ago

solderq35 commented 10 months ago

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:

RDIL commented 10 months ago

This is awesome! Few concerns:

grappigegovert commented 10 months ago

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.

RDIL commented 10 months ago

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

RDIL commented 10 months ago

I think the best way to move forward here would be:

solderq35 commented 10 months ago

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):

Feel free to make any necessary adjustments to this.

I don't know enough about how SMF or plugins work to comment on that.

RDIL commented 10 months ago

Thanks @solderq35!