Normalizes the filesystem and patches Lua import paths to fix Dota 2 Open Hyper AI (OHA) bot compatibility on Linux.
This repository provides scripts to make the Open Hyper AI (OHA) Dota 2 bot system compatible with Linux-based operating systems.
Dota 2's Open Hyper AI was primarily developed on Windows, which uses a case-insensitive filesystem. On Windows, a Lua script can require("BotLib/Main") even if the file is actually named botlib/main.lua.
On Linux, this fails. The Linux filesystem is case-sensitive, meaning Require is not the same as require, and BotLib is not the same as botlib. This causes the bots to fail to load, resulting in errors or default bot behavior.
Manually renaming hundreds of files and patching thousands of lines of code is impractical. These scripts automate the process to ensure 100% compatibility in seconds.
- Filesystem Normalization: Recursively renames every file and directory in the mod to lowercase.
- Lua Source Patching: Scans all
.luafiles for path-related functions (require,dofile,LinkLuaModifier) and specific mod keywords (BotLib,FunLib, etc.), converting the internal strings to lowercase to match the new filesystem.
- Python 3.x (Required for both the
.pyand.shversions) - The Open Hyper AI mod installed from the Steam Workshop (ID:
3246316298).
Important
The scripts are designed to be run from within the OHA workshop directory structure.
- Download
linux-compat-patcher.sh. - Place it inside the
install-to-vscriptfolder of the OHA mod directory. - Run it:
chmod +x linux-compat-patcher.sh ./linux-compat-patcher.sh
- Download
linux-compat-patcher.py. - Place it inside the
install-to-vscriptfolder. - Run it:
python3 linux-compat-patcher.py
linux-compat-patcher.py: The core logic written in Python.linux-compat-patcher.sh: A wrapper that executes the Python logic (useful for users who prefer standard shell scripts).
The scripts contain a safety check to ensure they aren't run in the wrong directory. They look for the OHA Workshop ID (3246316298) in the parent path to prevent accidental modifications to other folders.