Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide ScriptID to dynamic script functions #298

Open
makspll opened this issue Feb 21, 2025 · 0 comments
Open

Provide ScriptID to dynamic script functions #298

makspll opened this issue Feb 21, 2025 · 0 comments

Comments

@makspll
Copy link
Owner

makspll commented Feb 21, 2025

Is your feature request related to a problem? Please describe.
Currently this is only retrievable via the script_id global of a script, which needs to be passed as argument. It'd be useful for loading additional data, or initializing scripts from script bindings directly.

Describe the solution you'd like
Provide a thread local similar to the world guard, and have it be accessible from the function context.

Describe alternatives you've considered
adding script ID to the function context directly, might be viable but not sure if that's injectable from all angles, it would mean function lookups would need to happen in a place where we know the script id which is not necessarily the case right now.

Additional context

I think crate devs might run into the same thing, cus ur essentially telling me which script is running the function and that seems important for automation, which is essentially what im doing. - Peepo Juice @ Bevy Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant