Важно Форуму RPGRUSSIA 15 лет!
  • 2.195
  • 19
Друзья, сегодня нашему форуму исполняется 15 лет! Кажется, только вчера мы открывали первые разделы, спорили о правилах и радовались каждому новому участнику. Но годы пролетели - а мы всё здесь, и...
Новости Path of Exile 2: Патч 0.2.0 «Dawn of the Hunt» - краткое описание
  • 1.264
  • 0
Вчера вечером, в 22.00 по МСК, в прямом эфире вышла презентация по будущему патчу 0.2.0. В целом, игроки ждали нового класса и ребаланса существующих умений, но то что выкатили GGG на публику...
Новости Gothic 1 Remake - Demo (Nyras Prologue)
  • 4.642
  • 2
Ну что, заключённые, готовы к встрече с колонией? Мир, где каждый встречный мечтает вас зарезать за кусок хлеба, а единственный закон - сила. Вас ждёт совершенно новый пролог к легендарной...
Новости Большое интервью с HotA Crew - часть 2
  • 3.015
  • 0
HotA Crew о Кронверке и будущих обновлениях (часть 2) Какие герои будут вести армии Кронверка? Герои-воины зовутся Вожди, маги — Старейшины. Их параметры и способности подчеркнут сильные стороны...
Иконка ресурса

Референс / справочник Инструментарий Union SDK

Union SDK для работы с игровыми движками: события, методы через UserAPI, перехват функций с HOOK
Core Engine Events
n Plugin.cpp, you’ll find functions automatically triggered by engine events — their names typically indicate their purpose. The call order of some functions is explained in the comments at the end of the file. These hooks are enabled via CApplication, which synchronously runs them across all loaded plugins.

Extending Game Classes
To add methods or variables to classes across all four Gothic engines in one go, use the UserAPI catalog. Locate the target class using the filter, and add your members — although IntelliSense may show errors, that’s just a limitation of the tech. Implementations can be placed anywhere in your project.

Only non-virtual methods, static functions, and static variables are safe to add. Virtual methods or modifying class sizes can break the virtual table or game stability.

Function & Method Hooks
Union supports two main hooking strategies:
  • HOOK + AS: Uses MS Detours.
  • HOOK + PATCH: Alters the call by patching the instruction.
To call the original function:
  • Use the hook object like a pointer to function.
  • For class methods, use this->*HookName or simplify with the THISCALL macro.
✅ Hook signatures must match originals. Union validates this at startup and throws an error if mismatched — helping prevent crashes.​
🔁 Multiple plugins can hook the same function. Union queues them to ensure compatibility and shared execution.​
You can hook either by function name or address.

Method

AS

PATCH

Guarantee of 100% hook

Yes

No, if the call address is passed implicitly

Compatibility with other extenders and patches

No

Yes

Hook scope

The whole process

Module Gothic.exe


Conditional Hooks (AS_IF / PATCH_IF):


These versions accept a third argument as a condition. If False, the hook is deferred. You can later activate it by calling .Commit() on the hook object.
Сверху Снизу