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

ScriptComponent only uses the path of the asset path not its source. #233

Open
shanecelis opened this issue Jan 29, 2025 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@shanecelis
Copy link
Contributor

This issue is based on the staging branch and PR #183. I'm noticing the following things:

  1. I can load a script using an asset path, e.g., "nano9://main.lua" using AssetServer. (This uses an additional source like this example.)
  2. Then to make it run, I have to use only the path "main.lua" on ScriptComponent, which is ambiguous.

Is it expected to reference the script in ScriptComponent and load it? If it's expected that I must load and retain a Handle<ScriptAsset> it would be nice if ScriptId could be an asset path Cow<'static, str> or a Handle<ScriptAsset>.

@makspll makspll added the enhancement New feature or request label Jan 31, 2025
@makspll
Copy link
Owner

makspll commented Jan 31, 2025

Generally yes script ID's are supposed to be asset paths, however they are derived from the asset path itself without the source. I can change this behaviour so path mappers can have access to the source as well, this way you could set a custom AssetPathToScriptIdMapper which will retain source information in the path

@makspll
Copy link
Owner

makspll commented Jan 31, 2025

I am weary of including the source in these ID's by default as it could be confusing

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

No branches or pull requests

2 participants