Crate bevy_mod_scripting

Source
Expand description

§ 1 2

§Bevy Scripting

Although Bevy doesn’t directly support scripting, efforts are underway to incorporate it. This crate represents an initial attempt to enable scripting within Bevy’s existing framework. It’s important to note that this is a work in progress and not yet optimized or complete. As Bevy evolves, significant changes to this API are anticipated.

§Why Use Scripts?

  • Update your game mechanics without the need for re-compiling
  • Encapsulating game logic in scripts paves way for modders to create custom content easilly
  • Scripting game logic/UI in a simpler language broadens development accessibility to non-programmers on your team

§Features

  • Script management via commands
  • Hot loading
  • Support for multiple scripting languages
  • All script bindings managed in one place (ScriptDynamicFunctionRegistry)
  • Customizable event driven communication between bevy and scripts (on_update, on_init etc..)
  • Automatically generated bevy bindings
  • Documentation generation temporarilly on hold3

§Support

The languages currently supported are as follows:

Language
Lua
Lua51
Lua52
Lua53
Lua54
Luajit
Luajit52
Luau
Rhai
Rune temporarilly on hold3

§Documentation

For examples, installation and usage instructions see our shiny new book

§Bevy Compatibility

bevy_mod_scriptingbevy
0.9.10.15.1
0.90.15.0
0.80.15.0
0.70.14
0.60.13.1

  1. the coverage does not include generated bindings. 

  2. The crate strictly enforces no unwrap, expect, panic or todo’s via clippy lints. 

  3. Due to the recent re-write of the crate, documentation generation as well as rune support are temporarilly on hold. They will likely be re-implemented in the future. 

Modules§

bevy_bindings
core
lua
rhai

Structs§

ScriptFunctionsPlugin
A plugin that registers the core scripting functions.

Functions§

register_bevy_bindings
register_core_functions
register_reflect_reference_functions
register_script_query_builder_functions
register_script_query_result_functions
register_script_type_registration_functions
register_world_functions