Docs menu · Hook points: Ratchet & Clank+

    You are reading the docs of SDK 1.0.1, an older release. See the latest (1.11.0).

    Reference · SDK 1.0.1

    Hook points

    Functions of Ratchet & Clank your mod can take over: 6 in all, 6 of them stable

    Hook points

    6 hook points

    Pad_ProcessReport

    one pad report into the pad's state (PadState, at pad), each poll, before the tick reads it.

    void Pad_ProcessReport(openrac_gaddr pad, openrac_gaddr report, int32_t size)

    Start a mod with it

    Do something, call the original, maybe do more after.

    src/mod.c
    #include "openrac/openrac_mod.h"
    #include "openrac/games/rac1.h"
    
    OPENRAC_MOD_DEFINE("my-mod", "0.1.0")
    
    static openrac_rac1_Pad_ProcessReport s_original; /* what your hook goes on to */
    
    static void my_pad_process_report(openrac_gaddr pad, openrac_gaddr report, int32_t size) {
        /* before: change an argument, count a call, ... */
        s_original(pad, report, size);
        /* after */
    }
    
    OPENRAC_MOD_EXPORT int openrac_mod_load(const openrac_api* api, openrac_mod* mod) {
        if (OPENRAC_RAC1_HOOK(api, mod, Pad_ProcessReport, my_pad_process_report, &s_original) != OPENRAC_HOOK_OK) {
            api->fail(mod, "no Pad_ProcessReport hook point here");
            return 1; /* not loaded; the launcher shows why */
        }
        return 0;
    }

    Name it in your manifest too: "hooks": ["Pad_ProcessReport"]. Open it in the manifest builder

    Generated from sdk/include/openrac/games/rac1.h at sdk-v1.0.1. Edit this page or report a problem.