hi,all~
i want to write a lua plugin,
the principle is simple:
register everything(class and function) to script,
make call between c++ and lua.
that has been done many times in past projects.
the key problem is how to produce the big amount of glue code.
maybe i can custom the unrealheadertool, let it produce wraper function for everyone
but instead of that, i’d like to reuse the “Inspect system” made by UE:
every UObject-based class has a UClass instance in runtime,
through it we can enum all properties and member functions?
and then, we can call these functions with a universal mode as:“func->call(param_stack)”
with this , we may even get a thin script layer which only make dynamic forward of call:)
so, could we? how to do that: find function and call it?
Finally, if you look for how the UFUNCTION() and similar macros are implemented, and the code they generate, and then follow that rabbit hole using “go to definition” and recursive find in the C++ code base, you will find what you’re looking for.
The short answer is: Yes, it is possible to tie the UFUNCTIONS and UCLASSES of Unreal C++ to Lua.