Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change the event of an FMODEventEmitter #256

Open
YuriPrickles opened this issue Oct 5, 2024 · 4 comments
Open

Can't change the event of an FMODEventEmitter #256

YuriPrickles opened this issue Oct 5, 2024 · 4 comments

Comments

@YuriPrickles
Copy link

so my eventemitter (which is autoloaded) is set to a certain song by default, and when i load a scene i always make sure to change the event_name of the eventemitter and the do play(). for soem reason it still plays the default event.

is this intended? attached below is an example of the code i wrote to change the event. let me know if you need anything more
{E0813C27-BE37-4A77-AE56-7868162762DE}

@CedNaru
Copy link
Member

CedNaru commented Oct 6, 2024

Is your Node set with autoplay ?
If yes, then here's the explanation.
Right now the behaviour (which is not the best one, I admit) is that autoplay will automatically load your default song when your Node calls _ready(), because of script inheritance and such, our code for _ready get called before yours script code. Autoplay makes your default song instanced first. The issue with play() is that it's basically a no-op if a song is already playing. We forgot to make it check if the currently set event is different from one playing.

If no, I need to go back, check the code to be sure what's the sequence of event.

@YuriPrickles
Copy link
Author

Is your Node set with autoplay ? If yes, then here's the explanation. Right now the behaviour (which is not the best one, I admit) is that autoplay will automatically load your default song when your Node calls _ready(), because of script inheritance and such, our code for _ready get called before yours script code. Autoplay makes your default song instanced first. The issue with play() is that it's basically a no-op if a song is already playing. We forgot to make it check if the currently set event is different from one playing.

If no, I need to go back, check the code to be sure what's the sequence of event.

nope, it doesnt have autoplay.

@YuriPrickles
Copy link
Author

i even tried stopping it, and then setting the event name, and finally playing it, but that doesnt seem to work as well

@YuriPrickles
Copy link
Author

my current solution for this is just to put every event into 1 fmod event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants