- Lua 85.3%
- C++ 11.2%
- CMake 2.9%
- Shell 0.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
HunterShock: REFramework mod for MHWilds and MHRise that triggers OpenShock/PiShock actions when the player takes damage. Includes the Lua sources, the HunterShockNative plugin, the packaging script, and the Forgejo/GitHub Actions CI workflows. |
||
| .forgejo/workflows | ||
| .github/workflows | ||
| dist/reframework | ||
| native/HunterShockNative | ||
| scripts | ||
| src | ||
| third_party | ||
| .gitignore | ||
| .gitmodules | ||
| LICENSE | ||
| README.md | ||
HunterShock
HunterShock is a REFramework mod for Monster Hunter games that triggers OpenShock or PiShock actions when you take damage. Supports MHWilds and MHRise. MHWorld is at the moment unsupported due to engine differences. If there's enough demand I can make a version for that.
Requirements
- REFramework (the monolithic nightly from GitHub)
- HunterShockNative.dll (native HTTP bridge, built from
native/HunterShockNative/)
Installation
1. Install REFramework
Download REFramework from here. Extract dinput8.dll into your game's install directory.
| Game | Install directory (Steam) |
|---|---|
| MHWilds | steamapps/common/MonsterHunterWilds/ |
| MHRise | steamapps/common/MonsterHunterRise/ |
2. Install HunterShock
Grab the latest release and install it either manually or using a mod manager.
<game>/reframework/
autorun/
hunter_shock.lua ← bootstrap
HunterShock/
main.lua
config.lua
api_client.lua
damage_detector.lua
ui.lua
plugins/
HunterShockNative.dll ← native HTTP bridge
data/
HunterShock/
config.json ← optional, auto-created on first run
The native DLL goes in reframework/plugins/ (not next to dinput8.dll). Download it from releases or build it yourself (see below).
In-Game Setup
- Start the game and press
Insert(or whatever key opens your REFramework window). - Open
Script Generated UI → HunterShock. - Under Setup, select your platform and enter your credentials. See OpenShock setup or PiShock setup.
- Adjust shock settings (action, targeting, intensity, duration, cooldown).
- Toggle Enable HunterShock at the top.
- Press Test (the button is labeled with the current action, e.g. Test Shock) to verify. Either start at a low intensity or test by using Vibrate/Sound instead of Shock.
OpenShock setup
Select the OpenShock platform under Setup and enter:
- API Token: create one at openshock.app → API Tokens.
Click Fetch Devices (read-only), tick the checkboxes of the shockers you want to use, and click Save OpenShock Settings. The selected shocker IDs are saved automatically. Click Verify Setup to validate the token and confirm the saved shockers are accessible.
PiShock setup
Select the PiShock platform under Setup and enter:
- Username: your PiShock account username (the same credentials other PiShock apps ask for).
- API Key: create one at login.pishock.com/Account → API Keys →
+ Add New.
Click Fetch Devices (read-only), tick the checkboxes of the devices you want to use, and click Save PiShock Settings. The selected Device IDs are saved automatically. Click Verify Setup to validate the username + API key pair and confirm the saved devices are accessible (it also shows your User ID). PiShock hardware must be flashed to V3.
Multiple devices & targeting
You can enable any number of shockers (both platforms). Targeting controls which enabled devices fire on each trigger:
- All at once: every enabled device fires on every trigger.
- Random (one per trigger): one random enabled device fires per trigger.
- In order (round-robin): enabled devices fire one at a time, cycling through the list in order.
STOP ALL always targets every enabled device, regardless of the targeting mode. Note that the PiShock API has no stop command, so STOP ALL only works with OpenShock.
How damage maps to intensity
With Scale intensity with damage on, intensity scales linearly: the Damage % for max intensity value (default 60%) is the damage percentage that reaches the Max intensity cap (default 30%). The settings panel shows a live example, and every trigger is logged as X% dmg -> Y% intensity so you can see exactly why a hit produced a given intensity. With scaling off, every trigger uses the fixed Intensity value (still capped at Max intensity cap).
Safety
- Get explicit consent.
- Start at low intensity.
- Do not wear shockers near your heart or your neck. Especially not when alone!
- Keep a quick stop method available.
Building from Source
Native Plugin (HunterShockNative.dll)
Requires Visual Studio 2022, CMake 3.20+, and the REFramework submodule:
git submodule update --init --recursive
cmake -S native/HunterShockNative -B native/HunterShockNative/build
cmake --build native/HunterShockNative/build --config Release
Output: native/HunterShockNative/build/Release/HunterShockNative.dll
Packaging
After building, run the packaging script to assemble the dist/ folder:
chmod +x scripts/package-dist.sh
scripts/package-dist.sh
# Then copy the DLL:
cp native/HunterShockNative/build/Release/HunterShockNative.dll dist/reframework/plugins/
CI
CI builds the native DLL automatically on pushes to master/main; download the artifact from the Actions tab. Push a version tag (e.g. v1.0.0) to build and publish a release with the packaged zip attached.
License
Released under the MIT license.