Skip to content

ashoktamang/dota2bot-OpenHyperAI-linux-patcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Dota 2 Open Hyper AI - Linux Compatibility Patcher

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.

The Issue: Case-Sensitivity

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.

Why These Scripts Exist

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.

What the Patchers Do:

  1. Filesystem Normalization: Recursively renames every file and directory in the mod to lowercase.
  2. Lua Source Patching: Scans all .lua files 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.

Prerequisites

  • Python 3.x (Required for both the .py and .sh versions)
  • The Open Hyper AI mod installed from the Steam Workshop (ID: 3246316298).

Usage

Important

The scripts are designed to be run from within the OHA workshop directory structure.

Automatic Method (Shell Script)

  1. Download linux-compat-patcher.sh.
  2. Place it inside the install-to-vscript folder of the OHA mod directory.
  3. Run it:
    chmod +x linux-compat-patcher.sh
    ./linux-compat-patcher.sh

Manual Method (Python Script)

  1. Download linux-compat-patcher.py.
  2. Place it inside the install-to-vscript folder.
  3. Run it:
    python3 linux-compat-patcher.py

Project Structure

  • 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).

Safety Check

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.

About

Normalizes the filesystem and patches Lua import paths to fix Dota 2 Open Hyper AI (OHA) bot compatibility on Linux.

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors