- Joined
- Jan 5, 2016
- Messages
- 149
- Reaction score
- 88
- First Language
- English
- Primarily Uses
- RMVXA
Bit of an odd question, but I'm not sure where to begin.
Basically I'm trying to insert a line of code into a frame update that tracks the BGM timestamp. In other words, the update method activates after a global boolean in Audio.play_bgm is made true and it increases +1 every frame update while the song is active. With a little bit of math and whatnot, you could theoretically calculate the position of the song at any time, assuming it loops properly. This could be used for several really interesting things but I won't go into that now.
This frame update method needs to be present during every scene, however, since BGM plays during any scene unless specified otherwise. So where would I insert this code? Scene_Base? SceneManager? I'm not sure about either because Scene_Base is only a superclass and when other Scene classes get created/erased, there's a bit of update lag - meaning the BGM tracker will be off. Is there a class that's just constantly present that always updates every frame without lag? Or should I just create one?
Any help is greatly appreciated!
Basically I'm trying to insert a line of code into a frame update that tracks the BGM timestamp. In other words, the update method activates after a global boolean in Audio.play_bgm is made true and it increases +1 every frame update while the song is active. With a little bit of math and whatnot, you could theoretically calculate the position of the song at any time, assuming it loops properly. This could be used for several really interesting things but I won't go into that now.
This frame update method needs to be present during every scene, however, since BGM plays during any scene unless specified otherwise. So where would I insert this code? Scene_Base? SceneManager? I'm not sure about either because Scene_Base is only a superclass and when other Scene classes get created/erased, there's a bit of update lag - meaning the BGM tracker will be off. Is there a class that's just constantly present that always updates every frame without lag? Or should I just create one?
Any help is greatly appreciated!


