Skip to content

Errors when instantiating FmodEventEmitter2D in globally loaded _ready script when using should_load_by_name #405

@eghernqvist

Description

@eghernqvist

I have implemented a global autoload which instantiates the FmodBankLoader and a music event emitter. This works fine, the music plays, I am able to change parameters, all the good stuff - but the debugger is spammed with errors seemingly hinting at the event emitter trying to load an empty value of both event_name and event_guid.

When inspecting via breakpoint in the script which instantiates the event emitter, the event_name parameter is indeed undefined, but event_guid is set properly.

I have worked around this by disabled the should_load_by_name option.

Here's a screenshot of the emitter node, which shows both name and guid is set:

Image

The auto loaded global `gdscript` instantiating the node

# AudioController
extends Node

var audio_nodes_scene = preload("res://Audio/audio_nodes.tscn")
var master_music_system_scene = preload("res://Audio/master_music_system.tscn")
var audio_nodes = audio_nodes_scene.instantiate()
var fmod_bank: FmodBankLoader = audio_nodes.get_node("FmodBankLoader")
var master_music_system: FmodEventEmitter2D

func _ready() -> void:
	audio_nodes = audio_nodes_scene.instantiate()
	fmod_bank = audio_nodes.get_node("FmodBankLoader")
	master_music_system = master_music_system_scene.instantiate()
	add_child(audio_nodes)
	audio_nodes.add_child(master_music_system)
	print(master_music_system.event_name) # ""
	print(master_music_system.event_guid) # "{0bd118....}"

Error log dump:

E 0:00:00:922   audio_controller.gd:14 @ _ready(): Cannot find event with path , will try with guidvoid godot::FmodEventEmitter<godot::FmodEventEmitter2D, godot::Node2D>::_load_event_description_if_needed() const [Derived = godot::FmodEventEmitter2D, NodeType = godot::Node2D]src/nodes/fmod_event_emitter.h341
<C++ Source>  core/variant/variant_utility.cpp:1024 @ push_error()
<Stack Trace> audio_controller.gd:14 @ _ready()
E 0:00:00:922   audio_controller.gd:14 @ _ready(): You should fix this before releasing your game, check event exists and fallback is only a debug featurevoid godot::FmodEventEmitter<godot::FmodEventEmitter2D, godot::Node2D>::_load_event_description_if_needed() const [Derived = godot::FmodEventEmitter2D, NodeType = godot::Node2D]src/nodes/fmod_event_emitter.h343
<C++ Source>  core/variant/variant_utility.cpp:1024 @ push_error()
<Stack Trace> audio_controller.gd:14 @ _ready()
E 0:00:00:922   push_error: Cannot find event with path , will try with guidvoid godot::FmodEventEmitter<godot::FmodEventEmitter2D, godot::Node2D>::_load_event_description_if_needed() const [Derived = godot::FmodEventEmitter2D, NodeType = godot::Node2D]src/nodes/fmod_event_emitter.h341
<C++ Source>  core/variant/variant_utility.cpp:1024 @ push_error()
E 0:00:00:922   push_error: You should fix this before releasing your game, check event exists and fallback is only a debug featurevoid godot::FmodEventEmitter<godot::FmodEventEmitter2D, godot::Node2D>::_load_event_description_if_needed() const [Derived = godot::FmodEventEmitter2D, NodeType = godot::Node2D]src/nodes/fmod_event_emitter.h343
<C++ Source>  core/variant/variant_utility.cpp:1024 @ push_error()
E 0:00:00:923   push_error: Cannot find event with path , will try with guidvoid godot::FmodEventEmitter<godot::FmodEventEmitter2D, godot::Node2D>::_load_event_description_if_needed() const [Derived = godot::FmodEventEmitter2D, NodeType = godot::Node2D]src/nodes/fmod_event_emitter.h341
<C++ Source>  core/variant/variant_utility.cpp:1024 @ push_error()
E 0:00:00:923   push_error: You should fix this before releasing your game, check event exists and fallback is only a debug featurevoid godot::FmodEventEmitter<godot::FmodEventEmitter2D, godot::Node2D>::_load_event_description_if_needed() const [Derived = godot::FmodEventEmitter2D, NodeType = godot::Node2D]src/nodes/fmod_event_emitter.h343
<C++ Source>  core/variant/variant_utility.cpp:1024 @ push_error()
E 0:00:00:923   push_error: You should fix this before releasing your game, check event exists and fallback is only a debug featurevoid godot::FmodEventEmitter<godot::FmodEventEmitter2D, godot::Node2D>::_load_event_description_if_needed() const [Derived = godot::FmodEventEmitter2D, NodeType = godot::Node2D]src/nodes/fmod_event_emitter.h343
<C++ Source>  core/variant/variant_utility.cpp:1024 @ push_error()
E 0:00:00:923   push_error: You should fix this before releasing your game, check event exists and fallback is only a debug featurevoid godot::FmodEventEmitter<godot::FmodEventEmitter2D, godot::Node2D>::_load_event_description_if_needed() const [Derived = godot::FmodEventEmitter2D, NodeType = godot::Node2D]src/nodes/fmod_event_emitter.h343
<C++ Source>  core/variant/variant_utility.cpp:1024 @ push_error()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions