You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I'm working on Qarminer - automated tool(or maybe fuzzer is better name) to check every available functions with random parameters.
Describe the problem or limitation you are having in your project
Currently I don't see possibility to get from Godot list of all available classes which don't instance from Object like String, int, GDScript(global scope class) etc. and execute on them not known at compilation time functions.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Get list of functions of non objects like String
If Godot will provide API to get list of such things, then I will be able to check every single class and its methods.
This will allow to find some hidden bugs in engine.
e.g.
ClassDB.get_non_object_methods_list(TYPE_STRING) # Should return method info just like get_methods_list()
Instance non object with default values
Something like this:
ClassDB.instance_non_object(TYPE_VECTOR2)
should do same thing as
Vector2()
This is not so important since it can be easily implemented manually with match/if/else
Allow to execute on non object, not known at "compilation" time function
For object I can use such code
get_random_object().call("show")
This will fail when object is type Timer and work properly when this will be Node2D
I cannot do this with e.g. Vector2
Vector2().call("size")
because they don't implement call function.
This will allow users to use exactly same code across different Godot version, without worrying about breaking changes
e.g.
var text : String = "allow"
if text.has_method("length"): # Godot 20 before breaking change
print(text.call("length")
else: # Godot 21 after breaking change
print(text.call("size"))
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I think that ClassDB.get_class_list() should return all available classes.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I don't think it would be a frequently used feature, but it would make it possible to attach it to CI, where it would automatically respond to API changes.
Manually created project needs constant changes when someone add/remove/modify functions
Is there a reason why this should be core and not an add-on in the asset library?
Yes, this are API changes which must be done in core.
The text was updated successfully, but these errors were encountered:
Calinou
changed the title
Allow to get list of non objects(like String, Plane etc.) and its methods from GDScript
Allow to get list of non objects (like String, Plane etc.) and its methods from GDScript
Feb 25, 2021
Describe the project you are working on
Currently I'm working on Qarminer - automated tool(or maybe fuzzer is better name) to check every available functions with random parameters.
Describe the problem or limitation you are having in your project
Currently I don't see possibility to get from Godot list of all available classes which don't instance from Object like String, int, GDScript(global scope class) etc. and execute on them not known at compilation time functions.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
If Godot will provide API to get list of such things, then I will be able to check every single class and its methods.
This will allow to find some hidden bugs in engine.
e.g.
Something like this:
should do same thing as
This is not so important since it can be easily implemented manually with match/if/else
For object I can use such code
This will fail when object is type
Timer
and work properly when this will beNode2D
I cannot do this with e.g. Vector2
because they don't implement call function.
This will allow users to use exactly same code across different Godot version, without worrying about breaking changes
e.g.
Example: https://github.com/qarmin/RegressionTestProject/blob/aa250456edea167c9f110cb85a2db2a4ddabbc47/Autoload/Autoload.gd#L27-L30
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I think that
ClassDB.get_class_list()
should return all available classes.If this enhancement will not be used often, can it be worked around with a few lines of script?
I don't think it would be a frequently used feature, but it would make it possible to attach it to CI, where it would automatically respond to API changes.
Manually created project needs constant changes when someone add/remove/modify functions
Is there a reason why this should be core and not an add-on in the asset library?
Yes, this are API changes which must be done in core.
The text was updated successfully, but these errors were encountered: