Skip to content

Unreal

The unreal plugin makes Wraith’s tools work in Unreal Engine 4 and 5 games. It works out the engine’s names, objects and class layouts as the game starts, so it doesn’t need signatures or offsets for each version.

Wraith loads it in every Unreal game.

  • Camera. The free camera moves the player’s camera, cutscenes included.
  • Look. Photo mode’s Look changes the game’s exposure, colour, effects and depth of field. Other under it sets any of the game’s post-process settings, for games that go by their own.
  • Posing. Posing poses the 32 animated characters nearest the camera.
  • Game speed. Game speed goes through the world’s time dilation, so the UI carries on and 0 pauses the world. A plugin for a game with its own speed can take it over.
  • Ticks. Plugins’ ticks run on Unreal’s game thread.
  • Console. Games that ship without a console get one back, on the game’s console key, usually ` or ~.
  • Scene and Classes. The Workbench gets an Unreal tab with Scene in it, the world’s actors, their components and properties, and Classes, every class, struct and enum.

The plugin’s Unreal.Unreal service finds objects and uses them by name, the way the Scene panel does. Its schema is schemas/unreal.sal in the plugin.

  • findObjects(class) and findObject(class) find live objects of a class or one that comes from it, like "Character" or "BP_P001_C".
  • get(object, property) and set(object, property, value) read and change a property. address(object, property) gives where it is, for the memory area, for the ones they can’t do.
  • call(object, function, args) calls one of its functions, with args in order, and gives back what it returns.
  • location, setLocation, rotation and setRotation move actors.
  • nameOf, classOf, pathOf, isA, properties and isObject say what an object is.
  • setLook(setting, field) points one of Look’s settings, like "exposure", at another post-process field, or hides it with "", for games that render from their own. lookNeeds(setting, field, value) sets another field along with it, like an intensity that turns the effect on.

Values are like { kind: "number", number: 0.5 }, with flag, integer, number, text, object or floats as the kind.

Unreal frees its objects on its game thread, so the service only works there. Anywhere else it fails with WrongThread. threads.onTick runs on the game thread, and so do tweaks and Workbench scripts unless they’re moved.

An object is its address, and it’s good till Unreal’s garbage collector takes it. Find it again on a later tick rather than keeping it, or check it with isObject.

A Workbench script or a tweak has it without depending on anything, as Unreal.unreal(). Those are JavaScript or Lua.

const ue = Unreal.unreal();
const player = ue.findObject("BP_P001_C");
ue.set(player, "CustomTimeDilation", { kind: "number", number: 2 });
log.info(`${ue.location(player).z}`);

Add "unreal" to your depends, and use it from threads.onTick. Its types are in the Unreal namespace, like Unreal.UnrealValue, and the service is Unreal.unreal(), with Unreal imported from wraith. See Sharing between plugins.

import { Wraith, Unreal } from "wraith";
const ue = Unreal.unreal();
Wraith.threads().onTick(() => {
for (const light of ue.findObjects("PointLightComponent")) {
ue.call(light, "SetIntensity", [{ kind: "number", number: 0 }]);
}
});

findObjects looks through every object the game has, so find things now and then, not every tick.

Made with ♥ by Asgard