Godot: Visual Scripting: Object Constructor Node

Created on 6 Jun 2017  路  16Comments  路  Source: godotengine/godot

Operating system or device - Godot version:

Issue description:
It would be awesome to have a node to create objects. This is useful to use Godot鈥檚 file functionality. The GDScript code for this look something like this:

File.new()

the Node could look something like this:

constructorvs

Steps to reproduce:

Link to minimal example project:

archived feature proposal visualscript

All 16 comments

Aren't the "Constructors" category in the visual script nodes for that kind of purpose ?

That's right but you can't create objects like the File object. You can only create objects of basic types like Arrays, Strings or Colors.

I guess that you can use the "Constant class" node that retrieve a class type, then you can instantiate the type with a construct node.
2017-06-06-151546_380x163_scrot

I'm not an expert in visual scripting but I'd say it should work that way.

EDIT: Forget that, this is only to get constants within a class, not the class itself.

Maybe that ? :
2017-06-06-153052_396x126_scrot

I think Call Instance does not work.
grafik

Well why not ?
There no "break" at the end of the line, so the next case is executed instead.

I think this workaround is a little bit complicated for such essential Function.

@MrInformatic well, I can agree on that.
The fact is I am not sure if this is even possible with gdscript... as the visual scripting, does, in a way, "inherits" from gdscript design this is unsure.

I mean, you can use the preload function to retrieve a resource, but not sure for a built-in object class.

@groud is that what you are trying to do ?
image

Yes, that is what I was thinking of. This is simple solution I would say.

@groud GDScript can already instance core classes like:

func x():
  return File.new()

@bojidar-bg, ok.
Thus the original request totally makes sense :)

First of all thank you for your report and sorry for the delay.

We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.

We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about its current status here?

For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.

Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.

Thanks in advance.

Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.

We're putting this in the priority bug list for Google Summer of Code Visual Script.

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings