How to manage a scene tree using GDScript

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DimitriyPS
:warning: Old Version Published before Godot 3 was released.

I need to used GDScript: add, remove, or change parameters for the nodes tree of the scene at the time when scene is already actively.

Is this possible?

As using GDScript to add a node to the scene?

As using GDScript to gain access to an existing node of the scene?

:bust_in_silhouette: Reply From: KRL

“As using GDScript to add a node to the scene?”
link
“As using GDScript to gain access to an existing node of the scene?”

get_node("your node name")  

=>get_node("beatifull flower")

“Is this possible?”

Yes it is.

“Is this possible?”
Yes it is.

I was almost sure, but I’ve decided to ask)))

“As using GDScript to add a node to the scene?”
Link

Thank you.

“As using GDScript to gain access to an existing node of the scene?”
get_node("your node name")

I apologize. I not correctly formulated a question.

Using this method of loading scenes:

Singletons (AutoLoad)

In the global script:

func _deferred_goto_scene(path):
      current_scene.free()
      var s = ResourceLoader.load(path)
      current_scene = s.instance()
      # 
      # 
      # I think that at this place, I want in
      # current_scene add another scene
      # as the object scene (which I of course pre-load)
      # 
      # 
      get_tree().get_root().add_child(current_scene)
      get_tree().set_current_scene( current_scene )

DimitriyPS | 2016-03-17 15:10

Loading a scene is under the link above, its instancing a bullet which is a packed scene.

KRL | 2016-03-17 17:58

KRL, thanks, I figured it out. I had a small error.

DimitriyPS | 2016-03-18 08:21