nathanhoad / godot_dialogue_manager

A powerful nonlinear dialogue system for Godot
MIT License
2.04k stars 161 forks source link

Cannont call 'has_method' on null value. #590

Closed lukehayes closed 2 months ago

lukehayes commented 2 months ago

This is my first try with the plugin so may well be me and not a bug!

Describe the bug I copied the example balloon into my project and renamed it. I have a test scene to see how I can trigger the dialogue manager from code and I get this error.

Affected version

To Reproduce Steps to reproduce the behavior:

I'm not entirely sure, but all I am doing is trying to call the dialogue manager from GDScript.

Here is all the code:

extends Node2D

# Called when the node enters the scene tree for the first time.
func _ready():
    var res = preload("res://dialogs/test-dialog.dialogue")
    DialogueManager.show_dialogue_balloon(res, "this_is_a_node_title")
    pass # Replace with function body.

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
    pass

Expected behavior The scene to run and the dialogue to show.

Screenshots Screenshot_2024-06-10_18-26-59

nathanhoad commented 2 months ago

Did you manually copy the balloon or use the Project > Tools > Create copy of dialogue example balloon option?

lukehayes commented 2 months ago

Did you manually copy the balloon or use the Project > Tools > Create copy of dialogue example balloon option?

No, I used the 'copy' from the drop down when you right click the scene. I will try this method and see what happens :+1:

lukehayes commented 2 months ago

Yes, that was what the problem was :man_facepalming: . Thank you for the help, and this great plugin!

I will close this issue now :+1: