You are viewing a potentially older version of this package. View all versions.
Niko666-Adaptive_Trigger_For_PSVR2-2.1.0 icon

Adaptive Trigger For PSVR2

Implemented some Adaptive Trigger and Headset Rumble effects for chad PSVR2 enjoyers. REQUIRES PSVR2 TOOLKIT TO USE!

Date uploaded 2 weeks ago
Version 2.1.0
Download link Niko666-Adaptive_Trigger_For_PSVR2-2.1.0.zip
Downloads 73
Dependency string Niko666-Adaptive_Trigger_For_PSVR2-2.1.0

This mod requires the following mods to function

BepInEx-BepInExPack_H3VR-5.4.1700 icon
BepInEx-BepInExPack_H3VR

BepInEx pack for H3VR. Preconfigured and ready to use.

Preferred version: 5.4.1700

README

Fuk U Sony We Have Access To (Almost) All Console-Exclusive Features Now

For those who use PSVR2 but didn't know, you can use PSVR2 Toolkit to enable eye tracking and adaptive triggers etc on PC. There are already a couple of games (and mods) utilize those features so I think we should have this too.

Features

  • Clicky trigger effect with Dual Stage trigger simulation
  • Force feedback when firing, simulating recoil "kicks" (also vibration-based feedback as an alternative) - works on normal firearms and on attachable firearms (underbarrel launchers, masterkey, etc.)
  • Only the hand that actually operates a trigger gets force feedback: hold the grip and you feel everything, hold the foregrip and you don't, and akimbo pistols give both hands fully independent feedback
  • Disable the effects when the gun is empty so you'll know when you're out of ammo (still an approximation, disabled by default)
  • Headset vibration when firing and/or when getting hit, stays at full strength during full-auto fire
  • Works with the new CAPI and automatically falls back to the legacy IPC protocol so people who haven't updated PSVR2 Toolkit are not left behind
  • Configurable (somewhat), config changes apply instantly

Known Issues and Limitations

  • You need to install PSVR2 Toolkit for this mod to function (Obviously!)
  • Headset vibration needs the CAPI (the old IPC protocol has no rumble command), so if the mod fell back to IPC you only get the trigger effects
  • My State-of-the-art Shitcode will still make controllers' batteries drain faster than not modding, but the mod now only talks to the controllers when something actually changes
  • No per-weapon (type) configurations
  • The headset vibration does not scale with firearms' actual recoil strength
  • The force-based recoil kick is not great on extremely high RPM weapons, turn on UseVibrationFeedbackForRecoil for those
  • I've never touched real firearms in my life so I don't know how realistic the trigger simulation is. If you have any suggestions, feel free to tell me.

I Asked Myself These Questions

The mod doesn't work!?

  • Update PSVR2 Toolkit. The mod now supports both systems: it uses the new CAPI when it can and silently falls back to the legacy IPC protocol when it can't, so an old toolkit will still give you trigger effects (just no headset vibration).
  • If the log says something about not finding psvr2_toolkit_capi.dll, jump to "Where does the mod look for the PSVR2 Toolkit CAPI DLL?" below.
  • Headset vibration requires Jailbraking your headset.

Where does the mod look for the PSVR2 Toolkit CAPI DLL?

TLDR: Reinstall the PSVR2 Toolkit and make sure you are following the latest instructions properly and extracted those additional DLLs as well.

There used to be psvr2_toolkit_capi_loader.dll, which probably triggers Thunderstore's anti-malware detection, so the mod does the loading itself now. It checks, in order:

  1. psvr2tk_capi_path.txt in your system temp folder (that is %TEMP%, usually C:\Users\<you>\AppData\Local\Temp - the PSVR2 Toolkit driver puts it there). The file contains one line: the folder that holds psvr2_toolkit_capi.dll.
  2. The Steam library that contains "PlayStation VR2 App" (steamapps\common\PlayStation VR2 App\SteamVR_Plug-In\bin\win64, found through the registry + libraryfolders.vdf), which is where the file normally lives if you installed the toolkit correctly.
  3. The mod's own folder / the game folder / the plugins folder, in case you copied a DLL there by hand.

Note that the txt file itself has to be in %TEMP% - not next to the mod and not next to h3vr.exe, the loader only ever looks in the temp folder.

It's really useless and glitchy

  • Sorry, I'm not good at modding. If you have any suggestions, feel free tell me. (Discord: 妮可_Niko666, I'm in UTC+8 timezone so probably won't respond to messages in time)

I want more

  • I'll do my best.🫡

Credits

Generative AI Disclosure

Most parts of the mod was created using Deepseek (The Blue Fat Whale) because I'm a dumbass and too lazy to debug, but I did the manual code review and testing to ensure the mod works as intended.

ko-fi

CHANGELOG

Changelog

2.1.0 I Love the Blue Fat Whale (aka AI completely rewrote this whole shit including the changelog below and I didn't bother to review it no one reads this anyway)

  • No more native DLLs shipped. The bundled psvr2_toolkit_capi_loader.dll (Thunderstore hates it, so the mod couldn't be uploaded) is gone. The mod now finds and loads psvr2_toolkit_capi.dll itself. psvr2tk_capi_path.txt is read from the system temp folder, exactly like the loader does (it was never read from the mod or game folder).
  • Legacy IPC fallback. If the CAPI can't be used (old PSVR2 Toolkit, missing DLL, no free CAPI slot), the mod automatically connects to the old IPC server (TCP 3364) and keeps working. Headset vibration is unavailable on that backend because the legacy protocol has no such command.
  • Fixed the main hand losing its trigger feedback. The old code treated FVRPhysicalObject.savedGrip != null as "the gun is holstered", but savedGrip also gets left behind when your support hand releases a foregrip - so from then on the effect of the hand holding the grip was cleared every frame. The stashed check is gone entirely.
  • Correct hand attribution. A hand now only gets force feedback if it actually operates a trigger (its CurrentInteractable is the firearm itself). The hand on the foregrip / handguard no longer gets a clicky trigger, and akimbo (one gun per hand) gives both hands fully independent feedback.
  • Headset vibration no longer weakens during rapid fire. It used to be a coroutine per shot, restarted from a value that raced with the trigger counter, so full-auto fire made it fade out. It is now a decaying level that a new shot can only raise, driven by a single updater (no coroutine per shot either).
  • Attachable firearms (underbarrel launchers, masterkey, break-action attachments...) now have firing feedback. Both the trigger resistance and the on-fire force feedback / headset vibration, on the hand that actually operates the attachment. A hook on AttachableFirearm.Fire(bool) also means they no longer hijack the host gun's feedback.
  • The recoil kick works on full-auto again. A trigger effect is only felt when the applied effect actually changes, and the controller only gets the last command of a driver update cycle. So the kick is now: apply the recoil command, keep it for RecoilKickHoldTime, then force the clicky resistance back - and if another shot arrives while a kick is still active, the resistance is put back first so that shot still gets its own state change. RecoilKickHoldTime is clamped to a 0.02 minimum: anything shorter lands in the same driver update cycle as the restore and only kicks sometimes. Vibration-based recoil gets a 0.05s minimum, since a buzz needs to stay applied for a moment to be felt at all.
  • DisableEffectWhenEmpty is now spent-casing aware, and no longer cares about the hammer. It asks each of the weapon's chambers (FVRFireArm.GetChambers()) whether it could actually fire right now (IsFull && !IsSpent - the same condition FVRFireArmChamber.Fire() uses) plus the magazine, so a revolver cylinder, break action or anything else holding fired casings counts as empty, while a single action revolver with live rounds keeps its trigger resistance and firing feedback even with the hammer down. Fired casings in the chamber, the cylinder, or a SuppressCaselessDeletion gun no longer fool it. Revolvers, break actions, revolving shotguns, LAPD2019, potato gun, grapple gun and the Carl Gustaf are covered by the empty check now that it is reliable.
  • Config changes apply instantly. Settings edited through the BepInEx ConfigurationManager were already live; on top of that the mod now notices the .cfg file being edited on disk (checked once a second) and reloads itself, and the scene load reload from 1.x is back as well.
  • Fixed a crash on startup: ArgumentNullException: Parameter name: path1 from the DLL discovery. AppDomain.CurrentDomain.BaseDirectory is null inside the game (Unity/Mono + Doorstop) and was being handed straight to Path.Combine. The plugin folder is now resolved through Assembly.GetExecutingAssembly().Location first, every candidate path is null/empty filtered before it reaches Path.Combine, and discovery, backend setup, Awake and the per-frame update are all exception-guarded.
  • Patch groups are applied independently now, so if a future game update renames one target (the attachable firearm hooks are the fragile ones) the rest of the mod keeps working instead of silently doing nothing.
  • Performance. Effects are only pushed to the controller when they actually change (plus a periodic safety refresh), hands are evaluated once per frame instead of every firearm being evaluated every frame, config lookups are cached, and the shot event is subscribed once instead of being added again for every firearm that spawns.
  • New options: HeadsetVibrationDecayTime, HeadsetHitVibrationTime, RecoilKickHoldTime (default and minimum 0.02), TriggerEffectRefreshInterval.
  • OverrideStartPos / OverrideEndPos are now used as literal trigger positions (they used to be silently shifted by one, and the attachable path shifted them the other way).
  • Removed PSVR2ToolkitCAPI.cs (gaze calibration bindings this mod never used) in favour of PSVR2ToolkitBridge.cs.
  • The trigger effect positions for every weapon type are unchanged, so it should feel exactly like 2.0.0.

2.0.0 La Vibrator

  • Migrate to the new CAPI
  • Add Headset Vibration support

1.2.0 Not-So-Smart Trigger

  • Tried to implement Dual Stage trigger effect and disable effect when the gun is empty (originally I want to make it disable effects when the hammer is not cocked but it'll destroy recoil effect so I added the detection of magazines and that causes even more problems)

1.1.2 Frustration

  • Fixed trigger got stuck when single hand shooting (Caused by rewriting the codes in 1.1.1 and forgot to change the name of variables... How can I fuck things up so bad?! I probably should have let other people make this mod)

1.1.1 Coldfix

  • Fixed a bug that caused the mod to not reapply trigger effect when your main hand is released but the other hand is still holding a part of the gun e.g. the foregrip then regrab the gun (Why is this so fucking difficult to fix Fuck! Turns out I only need to add 2 lines of codes to fix it, I however almost rewrite the whole fucking mod to figure it out)
  • Fixed the other hand not having trigger effect when akimbo(Caused by optimizing the code in 1.1.0, I hate coding)
  • Partially support AttachableFirearm (Only when not attached and only trigger resistance, no recoil effect)
  • I can't do math

1.1.0 Optimization Hell

  • Optimized the code, should reduce the CPU usage and make the battery last longer
  • Fixed weak trigger effect (I think so, didn't have the energy to compare it with 1.0.0)
  • Better support for high RPM firearms

1.0.1

  • A workaround for left hand trigger effect issue
  • Add more configuration options
  • Update readme

1.0.0

  • Initial release