A Neutral-Network Plugin for Godot, in which users can write in an @export Array[String] to represent the inputs/outputs from the network.
Describe the problem or limitation you are having in your project
It is not possible to access an item in an array using get_indexed(my_string)
All other properties, including parts of vectors, can be referenced this way... except items in arrays
For me, this means that I need to use lots of member variables (var raycast1; var raycast2; var raycast3 ...) instead of an array raycasts[1], raycasts[2]... because the variables inside an array cannot gotten from a string
Describe the feature / enhancement and how it helps to overcome the problem or limitation
It should be possible to use a similar syntax to subproperties (like with position:x or rectangle:size) to access items in an array via a nodepath
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I think either:
get_indexed("my_array:0")
or...
get_indexed("my_array:array:0")
to try and match the existing syntax (where the number is the index of an item in an array)
If this enhancement will not be used often, can it be worked around with a few lines of script?
I, in this specific usecase, could add specific support for arrays assuming that all the contents of the array would want to be used in the network
However I believe this should be a feature for consistencies sake... I was under the assumption that NodePaths could access all the variables of a given node, except this is not true
Is there a reason why this should be core and not an add-on in the asset library?
Describe the project you are working on
A Neutral-Network Plugin for Godot, in which users can write in an
@export Array[String]
to represent the inputs/outputs from the network.Describe the problem or limitation you are having in your project
It is not possible to access an item in an array using
get_indexed(my_string)
All other properties, including parts of vectors, can be referenced this way... except items in arrays
For me, this means that I need to use lots of member variables (
var raycast1; var raycast2; var raycast3 ...
) instead of an arrayraycasts[1], raycasts[2]...
because the variables inside an array cannot gotten from a stringDescribe the feature / enhancement and how it helps to overcome the problem or limitation
It should be possible to use a similar syntax to subproperties (like with
position:x
orrectangle:size
) to access items in an array via a nodepathDescribe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I think either:
get_indexed("my_array:0")
or...get_indexed("my_array:array:0")
to try and match the existing syntax (where the number is the index of an item in an array)
If this enhancement will not be used often, can it be worked around with a few lines of script?
I, in this specific usecase, could add specific support for arrays assuming that all the contents of the array would want to be used in the network
However I believe this should be a feature for consistencies sake... I was under the assumption that NodePaths could access all the variables of a given node, except this is not true
Is there a reason why this should be core and not an add-on in the asset library?
GDScript core feature