REFramework Documentation

repository·master·Indexed 24 days ago

https://github.com/praydog/reframework

A modding framework, scripting platform, and toolset for Capcom's RE Engine games. It provides Lua scripting, VR support, and gameplay enhancements such as first-person mode and FOV sliders. The framework includes developer tools for RSZ dumping, IL2CPP method naming via ida_namer.py, and PAK file path extraction using pathdumper.py, as well as integration guides for dependencies like sol2, imnodes, and ImGuizmo.

Tokens
4.7K
Snippets
18
Records
36
Agent score
90%

What's inside REFramework

  1. Overview of REFramework features and mods

    master

    REFramework provides a scripting platform and several built-in mods for RE Engine games, including:

    Scripting & Tools

    • Lua Scripting API & Plugin System
    • Game Objects Display (Developer Mode)
    • Object Explorer (Developer Mode)

    Gameplay Mods

    • Generic 6DOF VR support
    • Motion controls (RE2/RE3/RE7/RE8)
    • First Person mode (RE2, RE3)
    • Manual Flashlight (RE2, RE3, RE8)
    • Free Camera, Scene Timescale, and FOV Slider (All games)
    • Vignette Disabler, Ultrawide/Aspect Ratio fixes, and GUI Hider (All games)
  2. Use sol2 to bind C++ functions and types to Lua

    master

    sol2 provides a high-level API to abstract the Lua C stack.

    Key Capabilities:

    • Function Binding: Bind C++ lambdas, functions, or member functions to Lua using lua.set_function.
    • User-Defined Types (Usertypes): Register C++ structs or classes as Lua types using lua.new_usertype. This allows Lua to instantiate and manipulate C++ objects.
    • Type Support: Supports std::string variants, containers (std::map, std::vector, etc.), smart pointers (std::unique_ptr, std::shared_ptr), and C++17 std::variant.
    • Table Manipulation: Supports operator[]-style manipulation of Lua tables.
    • Overloading: Supports overloaded function calls where different C++ functions are routed based on the Lua argument types.
    #include <sol/sol.hpp>
    #include <cassert>
    
    // Example 1: Binding a function
    int main() {
        sol::state lua;
        int x = 0;
        lua.set_function("beep", [&x]{ ++x; });
        lua.script("beep()");
        assert(x == 1);
    }
    
    // Example 2: Binding a user-defined type (usertype)
    struct vars {
        int boop = 0;
    };
    
    int main() {
        sol::state lua;
        lua.new_usertype<vars>("vars", "boop", &vars::boop);
        lua.script("beep = vars.new()
                   beep.boop = 1");
        assert(lua.get<vars>("beep").boop == 1);
    }
  3. Install REFramework (Monolithic Build)

    master

    To install the latest monolithic version of REFramework, extract the contents of REFramework.zip into your game folder. This single DLL works across all supported RE Engine games (DMC5, RE2/3/4/7/8/9, MHRise, MHWilds, MHStories3, SF6, DD2, Pragmata, Star Force Legacy Collection).

    Important for Non-VR users: If you are NOT USING VR, do NOT extract any file other than dinput8.dll into your game folder. Extracting other files may cause game instability and the loss of anti-aliasing.

  4. Setup ImGuizmo example with CMake and vcpkg

    master

    To build the ImGuizmo example, ensure cmake and vcpkg are installed. You must provide the path to the vcpkg toolchain file during the CMake configuration step. This allows CMake to detect the vcpkg.json manifest file, download, and compile all required dependencies automatically.

    mkdir build
    cd build
    cmake .. -DCMAKE_TOOLCHAIN_FILE=C:/dev/vcpkg/scripts/buildsystem/vcpkg.cmake
  5. Dump filepaths for PAK extraction with pathdumper.py

    master

    Use pathdumper.py (or the standalone pathdumper.exe) to hook an RE Engine game and dump the filepaths required to extract PAK files.

    Provide the game executable as an argument. If no process name is supplied, the tool will prompt you for one.

    python ./pathdumper.py re2.exe
    # Or using the executable version:
    ./pathdumper.exe re2.exe
  6. Install REFramework on Proton/Linux

    master

    After extracting the REFramework files into your game folder, you must configure Steam to use the custom DLL. Add the following launch option to your game's properties in Steam:

    WINEDLLOVERRIDES="dinput8.dll=n,b" %command%

    WINEDLLOVERRIDES="dinput8.dll=n,b" %command%
  7. Compile REFramework via VSCode

    master

    Follow these steps to use VSCode with the CMake Tools extension:

    1. Install the CMake Tools extension.
    2. Open the REFramework folder in VSCode.
    3. Press Ctrl+Shift+P and select CMake: Configure.
    4. When prompted to "Select a kit", select Visual Studio Community 2022 Release - amd64.
    5. Select the desired build configuration (e.g., Release or RelWithDebInfo) at the bottom of the window.
    6. Select the desired build target at the bottom of the window (to avoid building all targets).
    7. Compile by pressing Ctrl+Shift+P and selecting CMake: Build or by pressing F7.
  8. Integrate sol2 into C++ projects

    master

    sol2 is a header-only C++ library for binding to Lua (supporting Lua 5.1+ and LuaJIT 2.x). Because it is header-only, integration is straightforward.

    Options for integration:

    1. Standard Header-Only: Include the library headers directly in your project.
    2. Single Header: For maximum ease of use, you can use a single header version. You can download these from the sol2 single header repository or use the single.py script provided in the repository to generate one.
    3. CMake: You can use CMake to generate the sol2_single_header or include the project directly via CMake configuration.
  9. Configure ImGuizmo example in VSCode

    master

    If using the CMake Tools extension in VSCode, add the toolchain file path to your .vscode/settings.json under cmake.configureArgs.

    To ensure compatibility across different machines, it is recommended to use an environment variable (like $env:VCPKG_ROOT) for the vcpkg installation path instead of a hardcoded absolute path.

    {
        "cmake.configureArgs": [
            "-DCMAKE_TOOLCHAIN_FILE={$env:VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
        ]
    }