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

Ability to load scenes/resources without loading scripts linked within #22049

Closed
LikeLakers2 opened this issue Sep 13, 2018 · 5 comments
Closed

Comments

@LikeLakers2
Copy link
Contributor

LikeLakers2 commented Sep 13, 2018

Godot version:
v3.1.alpha.calinou.9c0cc0d

Issue description:
This idea came about as I was thinking about the sandboxing support suggested in #7753, but I believe it would be a good idea regardless of sandbox support as a whole.

The idea is simple: Load a scene, but don't load the scripts that are attached to nodes and resources. When the game gets the resulting PackedScene, it should already not include the scripts. This would potentially make it easier for developers to allow level creation through the engine editor (rather than through an in-game interface) without concern that the level might have scripts attached that could act maliciously.

@LikeLakers2 LikeLakers2 changed the title Ability to load scenes without loading scripts linked within Ability to load scenes/resources without loading scripts linked within Sep 13, 2018
@TGRCdev
Copy link
Contributor

TGRCdev commented Sep 14, 2018

I think it would be easier to modify PackedScene.instance() to have an include_scripts argument (defaulting to true) that, when false, skips attaching scripts to newly instanced sub-scenes.

I haven't looked into PackedScene's source, though, so I don't know how instance() is implemented.

@ElfEars
Copy link

ElfEars commented Oct 23, 2018

This is interesting. I'd personally also like an option that just removes built in scripts as I'd like to allow users to have a bunch of "pre approved" scripts they can use in scenes.

Also, the scripts in the PackedScene won't execute until they are instanced (as is standard GDScript behaviour) so this is purely ease of use

@ElfEars
Copy link

ElfEars commented Oct 23, 2018

Doublepost but I've just realized something. You are unable to pre edit PackedScenes. (At least in the final executable?) I think that's more then this issue's scope however so I'll make another. It is relevant however.

Edit: You totally can. It's a little wierd and hard to figure out though. The get functions return references not values. With all the wierd permissions stuff I'm not sure if this works in compiled builds

Edit: Checked again. Coding error on my end. No you cant.

@ElfEars
Copy link

ElfEars commented Oct 28, 2018

Another variation of this would be to load it in but everything is in pause_mode so you can shove it in the tree and unpause it before any errors occur

@clayjohn
Copy link
Member

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

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

No branches or pull requests

5 participants