|
| 1 | +# [`bevy_mod_scripting`](https://github.com/makspll/bevy_mod_scripting/) 0.9.9 is out! |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +## Summary |
| 6 | +### Script Systems |
| 7 | +Script Systems get an overhaul, now supporting: |
| 8 | + - Parallelisation & Ordering against any other rust or script system |
| 9 | + - Previously you could only order script systems against rust systems |
| 10 | + - Parameterisation via `resource` and `query` builder functions |
| 11 | + - Exclusive and non-exclusive script systems are permissible, setting `exclusive` on the builder will allow the system to access anything like normal, but it will mean the system cannot be paralellised |
| 12 | + - Non-exclusive systems are only allowed to access the resources and queries they declared, this is why we can parallelise them like normal bevy systems |
| 13 | + - The pre-declared resource references and query results are passed in as arguments to the provided system handler |
| 14 | +e.g.: |
| 15 | + |
| 16 | +```lua |
| 17 | +function on_init() |
| 18 | + local my_system = world.add_system( |
| 19 | + post_update_schedule, |
| 20 | + system_builder("my_parameterised_system", script_id) |
| 21 | + :resource(ResourceTypeA) |
| 22 | + :query(world.query():component(ComponentA):component(ComponentB)) |
| 23 | + :resource(ResourceTypeB) |
| 24 | + ) |
| 25 | +end |
| 26 | + |
| 27 | +function my_parameterised_system(resourceA,query,resourceB) |
| 28 | + print(resourceA, query, resourceB) |
| 29 | + for i,result in pairs(query) do |
| 30 | + components = result:components() |
| 31 | + assert(#components == 2) |
| 32 | + end |
| 33 | +end |
| 34 | +``` |
| 35 | + |
| 36 | +### Type Cache |
| 37 | +A `types` global is now exposed containing all of the types found in the type registry: |
| 38 | + |
| 39 | +```lua |
| 40 | +-- instead of: |
| 41 | +world.get_type_by_name("MyType") |
| 42 | +-- you can use: |
| 43 | +types.MyType |
| 44 | +``` |
| 45 | + |
| 46 | +### LAD Global Improvements |
| 47 | +The LAD format now supports arbitrary `TypedThrough` types as global instances. |
| 48 | + |
| 49 | +The the mdbook pre-processor globals page got some love and now inlines links to each type as well as splits up the section to be more readable: |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +## Changelog |
| 54 | +See a detailed changelog [here](https://github.com/makspll/bevy_mod_scripting/blob/main/CHANGELOG.md) |
0 commit comments