godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.48k stars 21.07k forks source link

When error in script and "Open dominant script on Scene change" is checked, related scene shoud be opened #5646

Open kubecz3k opened 8 years ago

kubecz3k commented 8 years ago

Operating system or device - Godot version:

Issue description (what happened, and what was expected): Was avoiding to open this issue for a very long time, mostly because I don't feel like a lot of people would benefit from this, but it's coming back to me constantly, so here we go: In general I'm not using script panel to much, it's quite confusing for me. As far as I know for people like me there is an option Open dominant script on Scene change, when this option is checked for 90% of time the script you are seeing is the script that is related to opened scene and this is cool. The problem occurs in those remaining 10% of time. The most common case when this happens is simply at the time when there is an error in the script: scene_script_relation In this example the error is inside the script that is related to SplashNew.tscn scene, but what I'm seeing when I'm looking at tabs is "BaseBall.tscn" and this is confusing me regularly.
It would be super nice if Godot could open scene that's linked to script in which error occur.

Steps to reproduce:

Link to minimal example project (optional but very welcome):

kubecz3k commented 8 years ago

Another issue related to "Open dominant script on scene change" option: https://github.com/godotengine/godot/issues/3638

aaronfranke commented 6 years ago

This probably isn't relevant anymore. The script editor now has a list of open scripts on the left.

d

kubecz3k commented 6 years ago

If we still have the option then the issue is still relevant

MaxStgs commented 3 years ago

Is still actual? I wants to take it. There is problem, when one script can be attached to few scenes, looks that should be opened scene in which error occurs.

KoBeWi commented 3 years ago

You can obtain scene information from the node that the script is attached to. Probably something like owner.filename (accessed from the node affected by error) should be the scene path.

AkhRani commented 1 year ago

Can you confirm this commit fixes the issue? I can rebase the commit if that helps.

MaxStgs commented 1 year ago

Yes, it fixes for 4.x. But Idk how it works for current version.