maktoobgar / scene_manager Goto Github PK
View Code? Open in Web Editor NEWA tool to manage, organize and ease transitions between different scenes.
License: MIT License
A tool to manage, organize and ease transitions between different scenes.
License: MIT License
Hi, unsure what's the problem, but I have a bunch of warnings on load
Godot Engine v4.2.2.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--- Debug adapter server started ---
--- GDScript language server started on port 6005 ---
Add Autoload
scene/resources/resource_format_text.cpp:448 - res://addons/scene_manager/menu.tscn:3 - ext_resource, invalid UID: uid://cnhtsuf78gsy7 - using text path instead: res://addons/scene_manager/icons/GuiChecked.svg
scene/resources/resource_format_text.cpp:448 - res://addons/scene_manager/menu.tscn:5 - ext_resource, invalid UID: uid://bt1mtu3gbmwqc - using text path instead: res://addons/scene_manager/icons/FileDialog.svg
scene/resources/resource_format_text.cpp:448 - res://addons/scene_manager/ignore_item.tscn:3 - ext_resource, invalid UID: uid://dw322nmqpqwfq - using text path instead: res://addons/scene_manager/icons/ImportFail.svg
scene/resources/resource_format_text.cpp:448 - res://addons/scene_manager/scene_item.tscn:4 - ext_resource, invalid UID: uid://brxxaey30q7uk - using text path instead: res://addons/scene_manager/icons/GuiTabMenuHl.svg
scene/resources/resource_format_text.cpp:448 - res://addons/scene_manager/scene_item.tscn:6 - ext_resource, invalid UID: uid://b4xi5nvjb3rhr - using text path instead: res://addons/scene_manager/icons/PlayOverlay.png
scene/resources/resource_format_text.cpp:448 - res://addons/scene_manager/sub_section.tscn:4 - ext_resource, invalid UID: uid://dsgnkxtiko66g - using text path instead: res://addons/scene_manager/icons/GuiOptionArrowRight.png
scene/resources/resource_format_text.cpp:448 - res://addons/scene_manager/sub_section.tscn:6 - ext_resource, invalid UID: uid://dw322nmqpqwfq - using text path instead: res://addons/scene_manager/icons/ImportFail.svg
scene/resources/resource_format_text.cpp:448 - res://addons/scene_manager/scene_list.tscn:4 - ext_resource, invalid UID: uid://dw322nmqpqwfq - using text path instead: res://addons/scene_manager/icons/ImportFail.svg
scene/resources/resource_format_text.cpp:448 - res://addons/scene_manager/scene_list.tscn:5 - ext_resource, invalid UID: uid://d250i5cu8lgbd - using text path instead: res://addons/scene_manager/icons/eye_open.png
Add Autoload
Add Autoload
Following a PhysicsBody2D node will likely result in jitter - on lower physics ticks in particular.
Once Godot 4.3 is released, will strongly recommend upgrading to that as it has built-in support for 2D Physics Interpolation.
Until then, try following the guide on the documentation site for better results.
This tip can be disabled from within Project Settings / Phantom Camera / Tips / Show Jitter Tips
Do i understand this line of code correctly:
Remove the last node in the root of the tree, being the instanced scene by the scene manager.
If i add my own nodes to the end of the tree(for example some data node to persist between scene change), it could free my own node instead of the scene node.
I'm wondering why you dont simply call free on the 'current_scene'.
Im not sure if i'm understanding the code correctly, i'd love to learn why it was implemented this way.
My first scene configured is "StartMenu".
Inside of this scene I have a node "GameStart". This node has a Script "GameStart.gd" with the following contents:
extends Node
## This is no real script.
## It is only used to fade in first game scene.
func _ready() -> void:
var fadeIn = SceneManager.create_options(10, "fade", 0.1, false)
var options = SceneManager.create_general_options("black", 0.0, false, true)
SceneManager.show_first_scene(fadeIn, options)
When I click on Play the StartMenu scene is visible for like half a seconds and then it smoothly fades in.
I this the desired behavior or am I doing something wrong? I thought the first scene should not be visible before fading in.
Hi!
It would be useful to have a possibility to set the path for the res://addons/scene_manager/scenes.gd file.
The file has to be stored in the git, however with fixed path it requires the who addon to be stored.
I've faced with that issue on my own. I'm using gd-plug to manage dependencies, so my whole addons/ folder is added to .gitignore, meaning the file is not tracked.
There are a lot of tools which requieres data storage, so I have a dedicated folder for that.
A quick workaround is to manually modify path in the files plugin.gd and manager.gd
Great addon. Thank you for taking the time to develop it and make it available to all.
For some reason (my fault no doubt), I can use the addon without an issue within Godot, that is, I can run some test project and it works as expected. Specifically, this means that the first _ready()
to be called is in the script of the main scene, e.g., Start.gd
However, when I run the same code from VSCode the first _ready()
to be called is in this addon's script scene_manager.gd
which leads to a crash. If the addon is removed, the test project runs as expected.
The crash (in case it matters) is in _get_scene_key_by_value(...)
because the path returned by get_tree().current_scene.scene_file_path
in _set_current_scene()
is a full Windows path, e.g., C:\TestProject\Start.tscn
instead of the type of paths the scenes
dictionary contains, e.g., res://Start.tscn
Please let me know if you need more information.
Thanks again.
So right now I am currently creating a button and then using a Group call to execute a transition, I don't currently have any option to call the transition directly from C#.
I have no real idea how to implement this, but I would love to not have to work around it in this manner.
There is this of course: https://docs.godotengine.org/en/stable/tutorials/scripting/cross_language_scripting.html Perhaps a simple C# wrapper that takes C# method calls and converts them to GDscript?
Of note, I'm not sure how to make this just an enhancement, the only option I seem to have is to make issues, I apologize.
Hi there,
is the following possible?
So it's like change_scene()
with null
or ignore
but split into two calls.
If not, would it be possible to implement?
Thanks in advance ๐
Would be nice to have a shortcut button next to each of the scene buttons (or even something like ctrl + click) to open that scene in the editor, instead of going through the project to find it again to look at it.
Currently, the canvas in the SceneManager has a layer index of 1. If a game uses a any canvas with the same index or greater, the fade animations will play below the user interface.
If possible, it would be nice to be able to set the layer of the SceneManager.
Anyway, thanks for your work. This is the most complete scene manager I've ever used!
Doesnt matter what I do, this error runs before my first scene ready function.
No amount of copying the demo files or documentation script, matters.
It always run before the _ready of the first scene.
I'm not necessarily sure if this is an issue of the addon or something 4.3 is doing, or maybe something weird in my project, but whenever I start my game and then close it this prompt comes up:
It also seems to do it when focusing a window other than Godot, then focusing back into Godot. This happens even if I've never started my game, just after opening the project.
I can't seem to recreate it with the demo project, but I'm using the same setup that the "loading with initialization" setup is using from the demo so I'm not entirely sure what is going on.
I can recreate it in the demo project. When you add a new "ignores" folder/directory, it will start to cause the same prompt in both of the situations outlined above. Seems like 4.3 doesn't like that the scenes.gd file gets changed.
Choosing "Discard local changes and reload" in the demo project seems to make it go away until adding a new folder to the ignores list, then it will happen again.
Edit: I think I found the culprit. I had Auto Save checked and I'm guessing that auto save happens in certain scenarios, or seems to be at least. Turning that off and manually hitting Save will cause the prompt but only one time after clicking it. Selecting "Discard local changes and reload" after hitting "Save" in the plugin does "solve" it, though I imagine this will be an annoying thing for people to deal with (not the addon fault).
Can probably close this if it's not a thing the addon can solve for.
Not really issue, but have no other way to ask questions.
Is there currently any way to initiate a callback after a transition has finished, or about to finish? Or a signal that is emitted after a transition has finished? There's a few scenarios I'm looking to trigger after a transition has finished and it would be useful if this was something built-in (if it's not already) rather than trying to work around it. Apologies in advance if this is already possible and I'm just overlooking it.
I'm attempting to utilize the loading or loading with initialization setups, and both are always falling into the "Scene Manager Error: for some reason, loading failed, I don't know why
condition. The demo project has the same issue.
I tested the demo project in 4.2 and both loading setups work, so it seems like something in 4.3 has changed and is affecting the way loading is currently written.
After #23 was solved (thank you so much for this!), I downloaded the current main branch. I opened my project and got a lot of errors and the scene manager window was empty. I just closed it and reopened it again. Now the errors were gone and the window displayed my scenes.
But I get a loading cursor and MacOS reports the app as "not responding". So I cannot work on the project.
I restored the previous version of scene manager I used (3.8.0) and it immediately works again.
Unfortunately no error message is displayed, so I don't know what could cause the problem.
Hey, there. Do you have a more detailed explanation of how to use this addon somewhere? Or a youtube video? I've installed it and assigned some of my scenes as Character, Menu, and created a new Category "Districts" for my maps. But I'm trying to assign a Subcategory. I've created one called Pois, but I can't add anything to it or use it at all.
Hi, first of all, thanks for this amazing addon, helps me a lot !
As you mentionned in your code examples, it's not that hard to add a loading screen, change_scene
to your loading screen scene, then inside the loading screen, call change_scene
again.
The issue with this is if the second scene is taking some time to load (like a procedurally generated world for instance), in which case you'll have the following:
I'm pretty new to Godot so I might be missing something obvious here but it looks like having the Loading screen add a given scene to the tree to then check when it's ready before triggering transition isn't possible, and that would be amazing as it'd allow for more detailed loading screen, showing data from the scene that's currently being set up.
v3.6.0
Godot:4.1.1
if we move all files inside the demo
folder to other folder whose path is addons_demos/scene_manager/
, follow error will be printed if run scene1 test.
Scene Manager Error: loaded scene is not defined in scene manager tool.
The load_scene_interactive()
method of the SceneManager is hardcorded to use use_sub_threads = true
when calling ResourceLoader.load_threaded_request()
. In the newest versions of Godot there seems to be a bug that can cause a threadlock in the resource loader that will result in infinite loading of the scene without any error.
This is likely cause by use of the preload() function shortly prior to or at the same time as ResourceLoader.load_threaded_request()
with use_sub_threads = true
.
See the following two GitHub issues:
godotengine/godot#85255
godotengine/godot#84012
It would be cool to add a warning somewhere in the scene manager documentation about it until its fixed and maybe give the option to set use_sub_threads = false
when calling load_scene_interactive()
.
Thank you very much, this plugin is awesome!
So if you export the game with the default code the transitions will not work, as the files within the shader_patterns folder have all had a ".import" file type added.
Here's the code to work around this, but it does require the adding of a build feature called "standalone" to the export.
Line 30: scene_manager.gd
if not OS.has_feature("standalone"):
if file_folder.get_extension() == "png":
_patterns[file_folder.replace("."+file_folder.get_extension(), "")] = load(root_path + file_folder)
else:
if file_folder.get_extension() == "import":
_patterns[file_folder.replace("."+file_folder.get_extension(), "").replace(".png", "")] = load(root_path + file_folder.replace("."+file_folder.get_extension(), ""))
Not sure if this helps any, but I hope it does.
hello, I have been using scene manager 2.0.1 for Godot 3.x game that will make it to android game market as a puzzle. I have read all the work that you have put into this, I must say I was amazed by this addon. (it is the best tool out there in godot plugin market)
one thing I realized is, the stack size keeps growing unless I reset the scene, in later versions of 2.0.1, have you considered adding a stack cleaning/pruning default limit? like 50-100 default and after that many transitions, the stack does remove on the [0] element like a buffer size.
I added "res://addons" to Ignores list. But when I try to run a scene from there, scene manager crashes with:
"Scene Manager Error: loaded scene is not defined in scene manager tool, to fix this, on Scene Manager UI panel, just once click on refresh and then save buttons."
Obviously clicking refresh and save won't help, because the scenes are ignored.
I think ignored paths should be checked at this point:
https://github.com/maktoobgar/scene_manager/blob/main/addons/scene_manager/scene_manager.gd#L48
So, I made a game jam game over the last week, and in the build when transitioning from a game level to another game level, or to a death screen, but it does not occur when transitioning from the main menu to the level scene, or vice versa, but when transitioning to the death scene. I went back in and hit save on the Scene Manager and it resolved this, even though no scene changes were made. Not sure what is going on, but I uploaded to github BEFORE hitting save, so theoretically if you download the source, and hit export, and export it to windows it SHOULD break when you die in game.
I know this is not exactly an issue, per say, it could be if I didn't resolve it, but I wanted to let you know so you could resolve it if you are able.
Repo:
https://github.com/Bonkahe/WildJam53-Pattern-Blue
Be advised; I built it with Godot 4 Beta 11-mono, entirely unsure if it will occur in other versions.
If you want to go ahead and hit resolved on this, and just use it as a source of info, that's perfect.
Thank you for the addon regardless, it's excellent and does exactly what I need it to do.
scene_manager: master branch (3.4.1)
Godot: v4.0.rc6.official [0cd148313]
OS: Windows 10
After starting a simple demo app after pressing F5 I get a lot of warnings:
_set: This material (containing shader with path: 'res://addons/scene_manager/scene_manager.gdshader') uses an old deprecated parameter names. Consider re-saving this resource (or scene which contains it) in order for it to continue working in future versions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.