Skip to content
praydog edited this page Dec 31, 2021 · 38 revisions

This is the REFramework wiki. It will mostly serve as documentation for the upcoming scripting system.

VR Troubleshooting

Lua Scripting

REFramework comes with a scripting system using Lua.

Leveraging the RE Engine's IL2CPP implementation, REFramework gives developers powerful control over the game engine.

Lua scripting can be found here now:

Binaries: https://ci.appveyor.com/project/praydog/reframework-dev/build/artifacts

Source code: https://github.com/praydog/REFramework/tree/sdk-improvements-re7-mhr

Loading a script

Manual Loading

Click on ScriptRunner from the main REFramework menu. From there, press Run Script and locate the corresponding *.lua file you wish to load.

Automatic Loading

Create an autorun folder in your game directory. REFramework will automatically load whatever *.lua scripts are in here during initialization.

Handling Lua errors

During script startup

When a Lua error occurs here, a MessageBox will pop up explaining what the error is.

During callback execution

When a Lua error occurs here, the reason will be written to a debug log. DebugView is required to view these.

We don't pop a MessageBox here so the user doesn't lock their game.

Side notes

Everything is subject to change and maybe refactored over time.

RE Engine's IL2CPP implementation is not the same as Unity's. While RE Engine and Unity have many similarities, they are not the same, and no existing tooling for Unity or IL2CPP will work on the RE Engine.

C# scripting maybe a possibility in the future for more natural interaction with the engine, but is not currently being looked at. REFramework is open source, so any developer wishing to do that can try.

While REFramework's scripting API can do all sorts of things, RE_RSZ is another powerful tool that may be more suitable in some scenarios. For example:

  • Inserting/cloning more game objects into a specific scene
  • Edits that don't require runtime awareness of the game's state
  • Time-sensitive edits to files (like something REFramework can't capture during startup)
  • Using it for base edits with an REFramework script on top for additional functionality
  • Changes that are impossible with REFramework's scripting system

Thanks

cursey for helping build the scripting system.

The Hitchhiker for testing/writing scripts/finding bugs/helpful suggestions.

alphaZomega for testing/writing scripts/finding bugs/helpful suggestions.

Clone this wiki locally