Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lua): additional, mostly creature class family, bindings #3170

Closed
wants to merge 5 commits into from
Closed

feat(lua): additional, mostly creature class family, bindings #3170

wants to merge 5 commits into from

Conversation

AluminumAlman
Copy link
Contributor

@AluminumAlman AluminumAlman commented Sep 17, 2023

Summary

SUMMARY: Infrastructure "A lot of creature class family functions and members exposed to Lua"

Purpose of change

Building on top of #2216, a whole bunch of functions for creature, character, avatar and NPC are now exposed to Lua, with other bindings in order for the aforementioned bindings to work, and a few other miscellaneous bindings.

Describe the solution

In order to bind most of the creature class family's methods and members to Lua, the types used/returned had to be bound to Lua first, which required additions to them, most of them covered by doc/LUA_SUPPORT.md. By using (mostly) regex, header files of the classes in question were formatted step-by-step so that it wouldn't be as tedious as doing it manually, however looking over the result was necessary sometimes. Preprocessor macros were made to make typing bindings manually less of a hassle when the regex processing didn't work.

Testing

  • Project builds (on my machine);
  • Ran some bound functions through the Lua console to make sure that they worked;

Additional context

  • Some of the bindings are commented out, whether it be because they are unnecessary, throw errors when building or "I did not want to confuse Lua modders with too many bindings" (I was lazy to uncomment them). If need be, those can (hopefully) be uncommented easily.
  • No regression tests were done; get_character_name was replaced by a member of a class, therefore there may be some broken Lua mod(s) with the current state of the PR.
  • Additional images:
    image
    image
    image
    image

@github-actions github-actions bot added the src changes related to source code. label Sep 17, 2023
@scarf005 scarf005 requested a review from olanti-p September 17, 2023 11:21
@scarf005 scarf005 changed the title Lua: additional, mostly creature class family, bindings feat(lua): additional, mostly creature class family, bindings Nov 13, 2023
@github-actions github-actions bot added the tests changes related to tests label Dec 26, 2023
@AluminumAlman
Copy link
Contributor Author

AluminumAlman commented Dec 27, 2023

Closing because after commit 18d9778, building fails at the linking stage, with the linker freezing with no error. Will remake this PR in another, more up-to-date, branch.

EDIT: #3990 is the new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code. tests changes related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant