Godot Version
4.6.3 2D, updated from 4.6.2
Question
Hello again Comrades!
I’m currently trying to get sound working in my game, but have hit another hiccup. I was wondering if anyone knows how to override _instantiate_playback. I’ve left the related code and errors below.
It seems my method, where the objects are created from scratch, has some sort of hiccup when it comes to this, though admitted I’ve not really tampered too deeply with sounds in any of my previous shenanigans.
Code
Where Local is the command broken apart for access, ActiveInstances is the active, loaded instances, and exePath is the path to the executible
print("Command:Sound") #109
ActiveInstances.append(AudioStreamPlayer.new()) #110
add_child(ActiveInstances[-1]) #111
var a = AudioStream.new() #112
a.set_path(exePath + Local[1]) #113
ActiveInstances[-1].set_stream(a) #114
ActiveInstances[-1].play() #115
ActiveInstances[-1].set_script(load("res://SoundManager.gd")) #116
ActiveInstances[-1].called() #117
Errors + My internal thoughts
E 0:00:05:809 Maker.gd:115 @ Manage(): Required virtual method AudioStream::_instantiate_playback must be overridden before calling.
<C++ Source> servers/audio/audio_stream.h:173 @ _gdvirtual__instantiate_playback_call()
<Stack Trace> Maker.gd:115 @ Manage()
Maker.gd:181 @ _process()
From what I can trace from this, there is some function that usually runs or, though I’m tempted to believe the former, some variable that needs to be overridden. Either way, this is my main concern.
E 0:00:05:809 Maker.gd:115 @ Manage(): Failed to instantiate playback.
<C++ Error> Condition "stream_playback.is_null()" is true. Returning: stream_playback
<C++ Source> scene/audio/audio_stream_player_internal.cpp:147 @ play_basic()
<Stack Trace> Maker.gd:115 @ Manage()
Maker.gd:181 @ _process()
This one I’m not terribly worried about. The above error arose while I was trying to fix this one, and I am 99% sure fixing the above will fix this as well.
If there is a specific variable or command I am missing, would anyone happen to know the documentation for it?