-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Disallow script that inherit from a type be assigned to something else #615
Comments
this would be made obsolete by this |
Your proposal is much faster to implement, though. |
@Zireael07 this one would be faster and easier to implement but the one I linked uses script OPP for custom nodes there since nodes and scenes would basically be script |
I'm reopening this due to the unlikely hood of the script and node combination being added. |
It might be cool to simply remove the first "extends" statement and get a dynamic inheritance based on the attached node. |
@DriNeo Scripts can be attached to multiple nodes of different types, so it would make any type assumptions impossible. Also, no |
Attaching a script to a node would be exactly like adding the "extends" statement on top. Errors can be raised as usual. |
@DriNeo What I'm saying is that the same script can be attached to any number of nodes, including nodes of different types. Therefore making any assumptions about scripts base type would be impossible inside of the script itself. Scripts don't know to which nodes they are attached. And like I've said, having no |
Describe the project you are working on:
spaceship project
Describe the problem or limitation you are having in your project:
I can't remeber what type a script is without opening and looking at what it inherits
I keep getting crashes due to accidentally accessing something that doesn't exist
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
basically nodes would only accept a script that inherit from them or a child node.
this would solve some crashes and would overall improve workflow
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
for example this could be assigned to a TextureRect but not a Node...
however this could be assigned to a TextureRect and a Node...
If this enhancement will not be used often, can it be worked around with a few lines of script?:
this would be used whenever assigning scripts to nodes so very often and I don't know if this can be worked around using a script
Is there a reason why this should be core and not an add-on in the asset library?:
this should be added because who would want to assign a script to something it doesn't derive from?.
The text was updated successfully, but these errors were encountered: