makspll / makspll/bevy_mod_scripting

Triggering callbacks from within BMS scripts

Open
#389 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
649
Forks
59
PR merge metrics
No merged PRs in 30d

Description

Request

Provide an API similar to this:

trigger_event("EventHandlerLabel", script_entity, args, script_id)

Which leads to the provided event handler being triggered. Target capabilities should match the Recipients enum.

Describe the solution you'd like

  • run_event_deferred: executes when the current callback ends. No frame delay
  • run_event: executes immediately, possibly returning a result.
  • Take into account the possibility that the triggered event might also lead to another event being triggered. If it can lead to a chain like that, then we also need to take into account infinite loops.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the callback and event-handling entry points, then inspect the Recipients enum and how BMS scripts currently invoke callbacks. Define how run_event and run_event_deferred should behave, including chained events and infinite-loop handling. Done means the requested script API supports the intended recipients and both execution modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, rust
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.