Skip to content

Conversation

@Prekzursil
Copy link

@Prekzursil Prekzursil commented Dec 17, 2025

Add TitaniumBullets(shoot through walls), plugin sources under Mods.

It is adapted from a mod that used Simple Mod Framework because through Simple Mod Framework it would cause crashes if used with other mods.

Summary

Adds a new sample mod/plugin, TitaniumBullets, implemented as a native ZHMModSDK plugin (no Simple Mod Framework dependency). It enables bullet wall-penetration by patching AmmoConfig entries inside the in-memory pro.repo repository at runtime, and exposes a menu toggle + optional debug UI.

Motivation

The original TitaniumBullets mod is commonly shipped via Simple Mod Framework (SMF). In my setup, SMF-based repository patches can be unstable / conflict when combined with other tools or mods. This PR ports the same behavior to ZHMModSDK’s runtime patching approach so it can be used alongside other ZHMModSDK plugins.

Implementation details

  • Loads [assembly:/repository/pro.repo].pc_repo via Globals::ResourceManager and waits for RESOURCE_STATUS_VALID.
  • Patches the same set of repository IDs as SMF TitaniumBullets (20 target entries).
  • For each target entry, overrides AmmoConfig to the penetration config ID: 87ae0524-2f22-4fe0-82e1-84a050b43cf0.
  • Stores original AmmoConfig values and restores them when the mod is disabled (safe to toggle).
  • Hooks scene clear (ZEntitySceneContext_ClearScene) to reset internal state so the patch can re-apply cleanly after mission/scene changes.
  • Adds an SDK menu checkbox + optional debug window showing patch/restore counts.

Testing

  • Please update this section with your environment/results (HITMAN 3 build, platform, and whether you verified penetration + toggling + mission reload).

Reference

Prekzursil and others added 3 commits December 17, 2025 04:41
- Add TitaniumBullets plugin sources under Mods/\n- Wire mod into top-level CMake MODS list\n- Document mod in root README
@kellne
Copy link

kellne commented Dec 17, 2025

this will allow us to shoot through walls ?

@kellne
Copy link

kellne commented Dec 18, 2025

Merge it

@Prekzursil
Copy link
Author

Prekzursil commented Dec 27, 2025

this will allow us to shoot through walls ?

Yes it would, it is adapted from a mod that used Simple Mod Framework.

https://www.nexusmods.com/hitman3/mods/347?tab=posts

@Prekzursil
Copy link
Author

@OrfeasZ @pavledev

Copy link
Owner

@OrfeasZ OrfeasZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for this!

Judging from the description of the PR and the code, I'm guessing a big chunk of this was written by an LLM. While this is something I'd ask regardless, it's even more important if that's the case: please carefully and thoroughly test its behavior, especially around possible edge cases like map reloads and switches, cross-map loading, online / offline mode switching, etc.

Another thing to note is that in case ApplyRepositoryPatch fails to patch for whatever reason (e.g. because the guids change after an update), it will keep trying to re-patch on every frame. I'm not sure if this is intended behavior, and could hurt performance.

Copilot AI review requested due to automatic review settings January 5, 2026 15:38
@Prekzursil Prekzursil requested a review from OrfeasZ January 5, 2026 15:38
@Prekzursil
Copy link
Author

Prekzursil commented Jan 5, 2026

Hey, thanks for this!

Judging from the description of the PR and the code, I'm guessing a big chunk of this was written by an LLM. While this is something I'd ask regardless, it's even more important if that's the case: please carefully and thoroughly test its behavior, especially around possible edge cases like map reloads and switches, cross-map loading, online / offline mode switching, etc.

Another thing to note is that in case ApplyRepositoryPatch fails to patch for whatever reason (e.g. because the guids change after an update), it will keep trying to re-patch on every frame. I'm not sure if this is intended behavior, and could hurt performance.

  • Fixes Logger::* calls to use {} formatting
  • RestoreRepositoryPatch() now restores only the entries we actually patched by looking them up directly in the pro.repo hash map (fixes fast-path restore correctness + avoids scanning the whole repo).
  • The fallback patch path now stores the map key for restoration (instead of the ID_ field).
  • Restore failure paths now clear internal state so it can’t get stuck “patched”.
  • Debug “Restore Now” disables the mod and saves the setting to avoid immediate re-apply.

I have made the modifications, also I have tested the mod, there hasnt been any kind of interference or crashes on any of the features i have combined it with, unless I missed something, and if that is the case perhaps if you have time you could run a field test yourself. @OrfeasZ

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new TitaniumBullets mod that enables bullet wall-penetration by patching the in-memory pro.repo repository at runtime. It ports the functionality of the Simple Mod Framework (SMF) TitaniumBullets mod to a native ZHMModSDK plugin to avoid conflicts and crashes when used with other mods.

Key changes:

  • Implements runtime repository patching to swap AmmoConfig entries to a penetration config
  • Provides toggle functionality with automatic restoration of original values when disabled
  • Includes a debug UI for troubleshooting and manual patch control

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Mods/TitaniumBullets/Src/TitaniumBullets.h Header file defining the plugin class with state management and scene clear detour
Mods/TitaniumBullets/Src/TitaniumBullets.cpp Implementation of repository patching logic with fast-path and fallback approaches, UI integration, and scene lifecycle management
Mods/TitaniumBullets/CMakeLists.txt Build configuration for the new mod
Mods/TitaniumBullets/README.md Documentation explaining usage and implementation details
CMakeLists.txt Adds TitaniumBullets to the list of compiled mods
README.md Updates main README with TitaniumBullets entry in the mods table
ZHMModSDK/Src/ModSDK.cpp Minor whitespace formatting fix (removes trailing space)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Prekzursil
Copy link
Author

Prekzursil commented Jan 5, 2026

@OrfeasZ I might add, that I experienced some crashes, but I dont think they are mod related, since i didnt experience them until I added a new NVMe ssd and it seems to overhead so i turned on the link state power management to maximum power saving in order not to experience overhead crashes until my cooler arrives or find a more permanent solution. The crashes usually happened if i alt tabbed while in loading screen(i created this mod for myself since im still doing the freelancer challanges, 2500 members killed and 500 leaders killed, and 100 campaigns completed, so i finish everything in seconds, and even with this, im 3 days into it and im not even at half of it, and it usually takes 1-1.5 mins(along with loading screens) to clear each stage).

Yes most part was written by Codex, but it was curated, as per your advise, though i didnt experience any kind of speed latency or hard load due to inefficient searches, i switched to faster data structures, so yeah when you have time please do review it. (Started contribuiting, since for so long i only leeched, and never shared what i did, perhaps it might not be perfect, but if it was me in the past struggling with this repetitive challange and would have had no idea how make it easier, id have really appreciated somebody that shared their mod).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants