Categories > Coding > C++ >

[REQ] How do I register custom funcs?

Posts: 8

Threads: 5

Joined: Feb, 2022

Reputation: 0

Posted

As far as I know I have to remake pushcclossure.

any kind of examples or help is appreciated

  • 0

Posts: 24

Threads: 0

Joined: Dec, 2022

Reputation: 5

Replied

If you want stable custom functions that will never break, do something like:

1. Create a closure using closure offsets

2. Get the global table using a lua state offset

3. Create the string which should be the name of the function using string offsets

4. Write to the global table using table offsets, setting the key at the string you created to the closure you created

  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )