About this mod
Lua wrapper for REFramework API methods, allowing for code autocomplete (IntelliSense), inline documentation, and detailed error messages.
- Requirements
- Permissions and credits
- Donations
This is a beta release and doesn't yet include the full REFramework API.
This is a Lua wrapper generated from the REFramework C++ code along with the HTML documentation to create a simple Lua library. The library wraps the REFramework APIs to provide full IntelliSense, strong typing, documentation, and detailed error messages for your mods.
APIs
- draw
- fs
- imgui
- json
- log
- re
- reframework
- sdk
- types (type definitions)
It also includes a few useful utility functions that commonly come up in mod development.
- write_valuetype
- find_index
- merge_tables
- table_contains
- generate_statics
- save_config
- load_config
- vec2_tostring
- vec3_tostring
- vec4_tostring
- get_components
- get_component
- get_transform
- get_fields_by_type
- get_fields
Editors
This should work in any editor that supports the Lua language server - so something like VS Code or Neovim with a Lua plugin/extension.
You may need to open the whole autorun folder in your editor so it will see all the files and autocomplete correctly.
Installation
Just extract and copy this API along with REFramework into the game install directory. Then you can require and use it in your script. If you release a mod using this API, just mark it as a requirement.
local api = require("REFrameworkAPI")
local vec = api.types.Vector2f:new(1.0, 2.0)
api.sdk.hook(
api.sdk.find_type_definition("app.ItemManager"):get_method("getStorageWeight"),
function(args)
end,
function(rtval)
return rtval
end
)