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

Backport to 3.x and accept *.tscn files? #6

Open
elvisish opened this issue Jan 24, 2025 · 2 comments
Open

Backport to 3.x and accept *.tscn files? #6

elvisish opened this issue Jan 24, 2025 · 2 comments

Comments

@elvisish
Copy link

Is it possible to backport this to 3.x and have it check .tscn files instead of just .tres? I'd like to check if custom levels don't have any scripts added before they get loaded (the tscn files I'd expect to load would not have any embedded scripts).

@derkork
Copy link
Owner

derkork commented Jan 25, 2025

I'm sorry, but I don't have the bandwidth to maintain multiple versions of this for different Godot versions. In addition this requirement is very specific and probably not something a lot of people would need. If you'd like you can make a fork of this and alter the main part so it works for your purposes. TSCN and TRES are somewhat similar formats so it might be enough to remove the check for the file extension to get to a starting point.

@elvisish
Copy link
Author

elvisish commented Jan 26, 2025

I'm sorry, but I don't have the bandwidth to maintain multiple versions of this for different Godot versions. In addition this requirement is very specific and probably not something a lot of people would need. If you'd like you can make a fork of this and alter the main part so it works for your purposes. TSCN and TRES are somewhat similar formats so it might be enough to remove the check for the file extension to get to a starting point.

Sure thing, I'm trying to backport it but this line:

static func load(path:String, type_hint:String = "", \
		cache_mode:ResourceLoader.CacheMode = ResourceLoader.CacheMode.CACHE_MODE_REUSE) -> Resource:

gives the error Default parameter expected. I assume because ResourceLoader doesn't have cache_mode in 3.x?

EDIT: nevermind, I just found this: https://github.com/derkork/godot-safe-resource-loader/blob/defeaa0c1b71b83caace2acb8faaa1578072fc50/addons/safe_resource_loader/safe_resource_loader.gd

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

2 participants