Skip to content

HTMonkeyG/HTML-Sky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HT's Mod Loader

Use HTML to execute code before the game does.

This project and its derivatives are only intented to be used for learning purposes. This repository won't contain any anti-anti-cheat.

The responsibility arising from the use of this project and its derivatives in multiplayer games shall be borne by the users themselves.

Usage

This project is designed to work exclusively with assembly logic code generated by compiled languages. Execution on interpreted languages or bytecode virtual machine executables may cause unexpected results.

  1. Download latest mod loader in releases.
  2. Put winhttp.dll together with the game's executable (e.g. Sky.exe).
  3. Create htmodloader folder in the folder contains Sky.exe. Your directory should look like this:
<Game installation directory>
 ├─Sky.exe
 ├─htmodloader
 │ └─mods
 │   ├─<A single mod>
 │   │ ├─manifest.json
 │   │ └─<mod executable>.dll
 │   └─<...>
 ├─html-config.json
 ├─winhttp.dll
 └─<...>
  1. Place each mod in a separated folder within mods. Every mod should contain an executable file (dll) and a manifest.json at least.
  2. Start the game, and view loaded mods in HTML Main Menu.

Build

Use MinGW-w64 15.1.0 to build the project.

  1. Clone the repository.
  2. Change the working directory to HTML-Sky, then execute mingw32-make.exe all on the first compilation.
  3. If you have some issues on libraries/leveldb/lib/leveldb.lib, clone and build https://github.com/extremeheat/leveldb-mcpe.git, and replace leveldb.lib with your own building. HTModLoader uses C API of leveldb-mcpe only, so we don't care about binary compatibility.

FAQ

1. Difference between sky- versions and full- versions?

The pre-compiled sky- versions only contain the backends that Sky needs (Vulkan layer and the sky game backend). full- versions contains the logger and all avaliable backends.

Download the version you need.

2. How to create a mod?

  1. Download the latest HTML SDK zip in releases.
  2. Write your own dll codes with HTML APIs and internal ImGui. You should include the provided ImGui headers by the SDK.
  3. Compile and link htmodloader.lib with MinGW. HTML is compiled under MinGW, and it may cause problems due to different ABIs if compiling with MSVC. The mod should use c11 and c++17 standard.
  4. Write manifest.json for the mod. Please remove the comments before put it into the game.
{
  // Internal mod id, must be unique.
  "package_name": "modtest",
  // Mod version.
  "version": "1.0.0",
  // Compatible game edition flags. Check the backends for further information.
  // -1 for all games.
  "game_edition": 3,
  // Display name.
  "mod_name": "Mod Test",
  // Mod description.
  "description": "Test mod of HT's Mod Loader",
  // Executable file of the mod.
  "main": "modtest.dll",
  // Mod dependencies. Unused.
  "dependencies": {},
  // Unused.
  "keywords": [
    "test"
  ],
  // Mod author and license.
  "author": "HTMonkeyG",
  "license": "MIT",
  // Mod website.
  "website": ""
}
  1. Place your mod DLL and the manifest.json file together in a folder within the htmods directory. The subfolder can have any name.

3. How to create a mod with compilers not compatible with MinGW (like MSVC) ?

  1. Download the latest HTML SDK zip in releases.
  2. Download the libraries/imgui-* directory located under the tag that corresponds to the SDK version, and add them into your project.
  3. Write your own dll codes with HTML APIs and downloaded ImGui. On the first HTModRenderGui() call, use HTImGuiDispatch() to get ImGui contexts, then use ImGui::SetCurrentContext() and ImGui::SetAllocatorFunctions() to set the context. Invoke ImGui functions within HTModRenderGui() only.
  4. The same as How to create a mod?.