General improvements to VisualScript and learning the workflow
Describe the problem or limitation you are having in your project
There is no easy way in VisualScript to use autoload singletons.
Maybe not even a correct way
Describe the feature/enhancement and how it helps to overcome the problem or limitation
[4.0] I would like to rename VisualScriptEngineSingleton to VisualScriptSingleton
[3.x] I would like to expand VisualScriptEngineSingleton
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
VisualScriptEngineSingleton would keep working as is.
Only access the autoload singletons.
If this enhancement will not be used often, can it be worked around with a few lines of script?
This is the known workaround. As you see it is not user friendly
Is there a reason why this should be core and not an add-on in the asset library?
It's a core node of VisualScript that implements Basic language instructions. It should run reliably and be flexible.
My exploratory work.
successes
When inserting the following snippet between lines The editor is able the have the class selectable
` List singletons;
List<PropertyInfo> props;
ProjectSettings::get_singleton()->get_property_list(&props);
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
String s = E->get().name;
if (s.begins_with("autoload/")) {
Engine::Singleton pi;
pi.name = s.lstrip("autoload/");
// pi.ptr = Engine::get_singleton()->get_singleton_object(s.lstrip("autoload/"));
singletons.push_back(pi);
}
}
Engine::get_singleton()->get_singletons(&singletons);`
Not jet found a solution
I need to be able to reference the singleton object for 2 reasons.
1 So the editor will provide proper typehints
2 So the runtime is able to provide obj.reference to connected nodes
I think this is done by giving the Engine::Singleton pi; pi.ptr =??
Describe the project you are working on
General improvements to VisualScript and learning the workflow
Describe the problem or limitation you are having in your project
There is no easy way in VisualScript to use autoload singletons. Maybe not even a correct way
Describe the feature/enhancement and how it helps to overcome the problem or limitation
[4.0] I would like to rename VisualScriptEngineSingleton to VisualScriptSingleton
[3.x] I would like to expand VisualScriptEngineSingleton
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
VisualScriptEngineSingleton would keep working as is. Only access the autoload singletons.
If this enhancement will not be used often, can it be worked around with a few lines of script?
This is the known workaround. As you see it is not user friendly
Is there a reason why this should be core and not an add-on in the asset library?
It's a core node of VisualScript that implements Basic language instructions. It should run reliably and be flexible.
My exploratory work.
successes
When inserting the following snippet between lines The editor is able the have the class selectable
` List singletons;
Not jet found a solution
I need to be able to reference the singleton object for 2 reasons. 1 So the editor will provide proper typehints 2 So the runtime is able to provide obj.reference to connected nodes I think this is done by giving the
Engine::Singleton pi; pi.ptr =??