kyzfrintin / Godot-Mixing-Desk

A complete audio solution for Godot 3.3.x, making procedural sound and adaptive/procedural music possible with a few nodes and a couple lines of code.
MIT License
636 stars 32 forks source link

Issue with empty autoplay #11

Closed rezgi closed 4 years ago

rezgi commented 4 years ago

When using it for the first time and setting the nodes as in the documentation, there's a bug when running the script saying : Attempt to call function 'get_index' in base 'null instance' on a null instance.

By investigating I found it was the autoplay parameter that launched even when it wasn't called, and it needed to be set to the MDM node to work. So the Autoplay property of the MixingDeskMusic node MUST point to itself, or else it will either autoplay or throw an error.

Proposal : the autoplay property is confusing as it needs to point to a node. A simple checkbox On/Off would be feel more natural. It could be maybe even better to put it in the Song node and not the main MDM node since it can have multiple songs (I guess ?).

First thing to fix is to not run autoplay when the property is empty.

kyzfrintin commented 4 years ago

Fixed with latest commit.

rezgi commented 4 years ago

So what solution did you implement to solve this ? Thanks !

kyzfrintin commented 4 years ago

I simply made autoplay a bool, and created a new export var autoplay_song, which does what autoplay used to do. It only autoplays if autoplay is enabled, and plays whichever song you've pointed it to in autoplay_song :)