ScriptHookWar3 Complete Guide 2026: Install, Build API, and Mod Warcraft 3

Your ScriptHookWar3 ASI file is not loading because you used the 64-bit ASI Loader on a 32-bit game. Warcraft 3 1.20e is 32-bit. The F5 hotkey does nothing because the timer code offset is wrong for your version. The CallFn template compiles but crashes because you passed a lambda without C++14 enabled.

This dedicated Axeetech guide fixes every installation build and API problem, so you stop guessing and start injecting.

ScriptHookWar3 complete guide showing Warcraft 3 ASI plugin injection and NativeTrainer menu
ScriptHookWar3 is an ASI plugin for Warcraft 3 that executes Jass native functions via C++ at runtime

Also on Axeetech: Best Roblox Executor Scripts | Grow A Garden Keyless Scripts |

What Is ScriptHookWar3

ScriptHookWar3 is an ASI plugin for Warcraft 3 created by developer seven-mile. It executes Jass native functions via C++ at runtime without modifying map files. The plugin uses DLL injection through an ASI Loader to hook into the running Warcraft 3 process.

This script is similar to HKE Script Inject but uses modern C++ instead of Jass or VJass. It supports Warcraft 3 version 1.20e officially. Other versions are adaptable with offset modifications. The project is open source on GitHub with a community fork by xingzhuangli.

The core architecture uses C++ templates for type-safe Jass native calling, lambda callbacks for trigger actions, and OOP wrapper classes for Jass objects like players, units, and groups. A built-in NativeTrainer provides cheat functionality through an in-game menu.

Quick Start Download and Install ScriptHookWar3

Step 1: Install an ASI Loader

ScriptHookWar3 requires an ASI Loader to inject into Warcraft 3. The ASI Loader is a DLL proxy that loads .asi plugin files into the game process.

ThirteenAG Ultimate ASI Loader dinput8.dll placed in Warcraft 3 game directory
Place dinput8.dll or winmm.dll from ThirteenAG Ultimate ASI Loader in your Warcraft 3 folder

Download ThirteenAG Ultimate ASI Loader from GitHub, for Warcraft 3 1.20e, which is a 32-bit use the x86 version. The loader file is named dinput8.dll or winmm.dll. Place this DLL file directly into your Warcraft 3 game directory, where war3.exe is located.

Alternative option: Silent’s ASI Loader works for older executables if ThirteenAG fails.

Step 2: Download ScriptHookWar3

Official repository: github.com/seven-mile/ScriptHookWar3 Community fork: github.com/xingzhuangli/ScriptHookWar3

ScriptHookWar3 GitHub repository by seven-mile showing releases and source code
Download ScriptHookWar3 from the official seven-mile GitHub repository or the xingzhuangli fork

Download the latest release .asi file from the Releases section. Alternatively, clone the repository and build from source using the build instructions below.

Step 3: Place and Launch

Put ScriptHookWar3.asi in your Warcraft 3 root directory. Some ASI Loaders also support a scripts or plugins subfolder. Launch Warcraft 3 1.20e. Press F5 to open the NativeTrainer menu. If the menu appears, installation is successful.

How to Build Script Hook War3 from Source

Prerequisites

Visual Studio 2019 or later with C++ desktop development workload installed. CMake 3.20 or later. Git for Windows.

Clone and Configure

Open Command Prompt or PowerShell. Run: git clone https://github.com/seven-mile/ScriptHookWar3.git. Navigate to the cloned directory. Run: cmake -B build This generates Visual Studio project files in the build directory.

Build and Output

Open the generated ScriptHookWar3.sln in Visual Studio. Select the Release configuration and x86 platform. Build the solution. The output file ScriptHookWar3.asi appears in build/Release/.

Visual Studio build configuration for ScriptHookWar3 showing Release x86 platform selection
Build ScriptHookWar3 in Release x86 configuration for Warcraft 3 1.20e 32-bit compatibility

Common Build Errors and Fixes

Missing Windows SDK: Install via Visual Studio Installer under Individual Components. CMake not found: Add CMake to your PATH environment variable or use the CMake GUI. 32-bit 64-bit mismatch: Ensure x86 target platform. Warcraft 3 1.20e is 32-bit and cannot load 64-bit ASI files.

ScriptHookWar 3 NativeTrainer Built-In Cheats

NativeTrainer is the built-in cheat menu that requires no coding knowledge. Press F5 to open the main menu. Navigate with arrow keys. Select options with Enter.

The arrow left key triggers instant building completion for selected structures. This is the fastest way to test base building without waiting for construction timers.

ScriptHookWar3 NativeTrainer menu open in Warcraft 3 showing cheat options
Press F5 in Warcraft 3 to open the ScriptHookWar3 NativeTrainer built-in cheat menu

Menu options include Add Gold, Add Lumber, Unit Modifications, and Hero XP. These modify game state through direct Jass native calls. No configuration files are needed for basic NativeTrainer usage.

ScriptHookWar 3 API Calling Jass Native Functions

The CallFn Template

CallFn is the core template function for calling Jass natives from C++. The syntax is CallFn<ReturnType>

ScriptHookWar3 CallFn C++ template code example for calling Jass Player and CreateGroup
CallFn is the type-safe C++ template for calling Jass native functions at runtime

This provides a type-safe C++ wrapper around Jass native functions. The template resolves the native function address at runtime and marshals arguments correctly.

Examples: CallFn<JassPlayer><JassGroup><void>

Complete CallFn Reference Table

Return TypeFunction NameParametersDescription
JassPlayerPlayerint playerIdGet player by ID
JassGroupCreateGroupnoneCreate empty unit group
voidGroupEnumUnitsSelectedJassGroup, JassPlayer, boolFill group from selection
JassUnitFirstOfGroupJassGroupGet first unit in group
boolIsUnitTypeJassUnit, intCheck unit type flags
voidAddHeroXPJassUnit, int, boolAdd experience to hero
voidDisplayTimedTextToPlayerJassPlayer, float, float, float, stringShow timed message
JassTriggerCreateTriggernoneCreate new trigger
JassTriggerActionTriggerAddActionJassTrigger, lambdaAdd C++ lambda callback
JassEventTriggerRegisterPlayerChatEventJassTrigger, JassPlayer, string, boolChat event binding

C++ Lambda Callbacks

ScriptHookWar 3 supports C++ lambda expressions in TriggerAddAction. This replaces the traditional callback argument system with modern C++ closures.

ScriptHookWar3 C++ lambda callback example in TriggerAddAction with DebugOutput
ScriptHookWar3 supports modern C++ lambda callbacks for Jass trigger actions

Example: auto act = CallFn<JassTriggerAction>

The lambda captures no variables by default. Use capture lists for external state. This feature requires C++14 or later.

ScriptHookWar 3 OOP Wrapper Classes

ScriptHookWar3 OOP wrapper classes showing JassPlayer JassUnit and JassGroup hierarchy
ScriptHookWar3 provides OOP wrapper classes for JassPlayer JassUnit JassHero and JassGroup

JassPlayer

JassPlayer::LocalPlayer() is a static method returning the local player object. GetSelectedUnits() returns a JassGroup containing the player’s current selection. SetState(PLAYER_STATE, value) and GetState(PLAYER_STATE) modify and read player resources like gold and lumber.

JassUnit and JassHero

SetMoveSpeed(float) modifies unit movement speed. SetScale(float) changes unit visual size. FirstUnit() from JassGroup returns the first unit for iteration. Implicit bool conversion allows null checks without explicit comparison.

JassGroup

FirstUnit() returns JassUnit. Enumeration support allows range-based for loops in C++11 and later.

ScriptHookWar 3 Menu Creator API

Creating Nested Menus

ScriptMenu is the class for creating in-game menus. Declare ScriptMenu mainMenu and ScriptMenu subMenu. Use AddSubMenuButton(“Label”, targetMenu) to create nested navigation. Use AddActionButton(“Label”, lambda) for immediate actions. Use AddSwitchButton(“OffLabel”, “OnLabel”, offLambda, onLambda) for toggle options.

ScriptHookWar3 Menu Creator API showing nested ScriptMenu with AddSubMenuButton and AddActionButton
ScriptHookWar3 ScriptMenu API supports nested menus with action buttons and toggle switches

Complete Menu Example

Resource submenu: Add Money button calls gold addition lambda. Add Lumber button calls lumber addition lambda. Selected Unit submenu: Scale Up toggle increases unit scale. Scale Down toggle decreases unit scale. Navigation: Return to Parent button exits submenu. Exit Menu button closes NativeTrainer.

Menu Best Practices

Use static ScriptMenu instances to prevent memory issues. Keep lambdas short and focused on single actions. Test the menu flow extensively before distribution to other players.

ScriptHookWar 3 vs HKE Script Inject Comparison

FeatureScriptHookWar 3HKE Script
LanguageC++Jass or VJass
Injection MethodRuntime ASIMap-based
Map Modification RequiredNoYes
Callback SupportC++ LambdaJass Functions
OOP WrappersYesNo
Menu APIBuilt-in NativeTrainerManual Implementation
Version Support1.20e officially expandableMultiple versions
Learning CurveC++ Knowledge RequiredJass Knowledge Required
ScriptHookWar3 vs HKE Script Inject feature comparison table showing C++ vs Jass differences
ScriptHookWar3 uses runtime C++ ASI injection while HKE requires map-based Jass modification

Adapting ScriptHookWar 3 to Other Versions

Finding Timer Code Offset

Use Cheat Engine to scan for timer-related values in the Warcraft 3 1.20e executable. Look for consistent patterns that identify the timer code location. Apply this offset to newer version binaries. The timer code is essential for ScriptHookWar 3 hooking.

Finding Native Function Pool

Warcraft 3 1.20e uses a linear array structure for native function pointers. Version 1.3 and later use a binary search tree structure. Adapting to 1.3 plus requires additional traversal logic for BST navigation.

Version Support Status

Table

ScriptHookWar3 version support status from 1.20e easy to Reforged not compatible
ScriptHookWar3 officially supports Warcraft 3 1.20e with other versions requiring adaptation
VersionStatusDifficulty
1.20eOfficially supportedEasy
1.26aAdaptable with offsetsMedium
1.27bAdaptable with offsetsMedium
1.28Adaptable with BST logicHard
1.29 plusNot testedUnknown
ReforgedNot compatibleVery Hard due to x64 and new engine

Troubleshooting ScriptHookWar 3

ErrorCauseFix
ASI not loadingWrong ASI Loader versionUse x86 loader for 1.20e 32-bit
F5 does nothingWrong game versionEnsure Warcraft 3 1.20e is running
Menu not appearingASI Loader not installedPlace dinput8.dll or winmm.dll in game folder
Crash on callbackLambda capture issueCheck lambda syntax use C++14 minimum
Build failsMissing Windows SDKInstall via Visual Studio Installer
CallFn returns nullWrong function nameCheck exact spelling from common.j
ScriptHookWar3 troubleshooting flowchart for ASI not loading F5 not working and build errors
Follow this troubleshooting flowchart to fix common ScriptHookWar3 installation and runtime errors

Frequently Asked Questions

Is ScriptHookWar 3 safe for Battlenet?

No. Use offline or LAN only. Battlenet Warden may detect ASI injection and flag your account.

Can I use ScriptHookWar 3 with Reforged?

No. Reforged uses 64-bit engine architecture and a different game engine. ScriptHookWar 3 is 32-bit only.

Do I need to know C++ to use ScriptHookWar 3?

For NativeTrainer cheats no. For custom scripts and menus yes.

What is the difference between ScriptHookWar 3 and HKE?

ScriptHookWar 3 is runtime C++ injection via ASI. HKE is map-based Jass injection requiring map modification.

Can I run multiple ASI plugins?

Yes. ThirteenAG Ultimate ASI Loader supports multiple .asi files simultaneously.

How do I change the F5 hotkey?

Modify the keyboard manager in the source code or use an external key remapper like AutoHotkey.

Will ScriptHookWar 3 work on Linux or Wine?

Untested. ASI Loader may work with Wine DLL overrides but no guarantees.

Is the project still maintained?

Last update was 2022. Community forks exist. A C++20 Modules refactor is planned but not released.

Final Thoughts and Quick Reference

Bookmark this guide for API reference. Join Warcraft 3 modding communities for support. Contribute to GitHub if you adapt ScriptHookWar 3 to new versions.

Quick Reference Cheat Sheet

Install: ASI Loader plus ScriptHookWar3.asi in game folder Launch: Start Warcraft 3 1.20e press F5 Instant build: Arrow left key Add gold: NativeTrainer menu then Resources then Add Money Custom script: Include ScriptHookWar 3 headers use CallFn compile to .asi Menu: ScriptMenu with AddSubMenuButton AddActionButton AddSwitchButton Callback: Lambda in TriggerAddAction OOP: JassPlayer::LocalPlayer() JassHero for selected units.

Leave a Reply

Your email address will not be published. Required fields are marked *