alessandrofama / wwise-godot-integration

Wwise Integration for the Godot Engine
Other
288 stars 14 forks source link

Plugin is paused on game pause - no way to set pause state #47

Closed Christovftw closed 2 years ago

Christovftw commented 2 years ago

Unsure if a godot "feature" or something that can be added to the plugin, but there is seemingly no way to stop the plugin from being paused when the game is paused. The engine uses a pause mode to pause the game and nodes, scenes, scripts and singletons can be specified to not pause when this happens so you can keep other parts of the game running. However, there seems to be no way to do this for the wwise plugin so when the game pauses, it stops responding to request. I can confirm this by pausing the game but having a script that is not paused in the game attempt to play an event.

The game is paused and unpaused using a function similar to this:

func pausegame()
    get_tree().paused = not get_tree().paused
    self.visible = get_tree().paused

And scripts can be set to not be paused like this, typically inside the _init or _ready functions:

self.set_pause_mode(2) # set the pause mode to process
set_process(true)

I can't seem to find a way to let the wwise plugin be used while the game is in a paused state. In my specific case, I'm trying to use a wwise state to duck a couple of my buses and set a LPF when the pause menu appears, nothing overly complex.

I've also asked about this over here in the godot Q&A forums, but any advice would be appreciated! https://godotengine.org/qa/125819/pausing-games-also-pauses-plugins-cannot-pause-mode-plugins

alessandrofama commented 2 years ago

Try calling

Wwise.set_pause_mode(2)
Christovftw commented 2 years ago

Yup that does it! Now I feel silly.... is this somewhere in the Wiki or did I miss it?

alessandrofama commented 2 years ago

Since the Wwise class technically extends the Node class, you can call everything listed here on that object: https://docs.godotengine.org/en/stable/classes/class_node.html This could be made more in clear in the Wiki, yes! I didn't even know how to pause in Godot until now. Thanks :)