Allien16

Warper
Member
Joined
Feb 6, 2023
Messages
2
Reaction score
1
First Language
Portuguese
Primarily Uses
RMMV
I'm making a game and i made a mechanic with a long SE that plays everytime the mechanic starts, the events have to run on parallel because the player have to move and find another event to reset the mechanic and run everything again. The mechanic is working well but the only issue is that the SE is not stopping when it has to stop. I tried everything even scripts but nothing worked, i even searched for help on discord and a girl told me to come here and post about because she couldn't know how to fix, she told me to mention that this function:
AudioManager.playSe = function(se) {
if (se.name) {
this._seBuffers = this._seBuffers.filter(function(audio) {
return audio.isPlaying();
});
var buffer = this.createBuffer('se', se.name);
this.updateSeParameters(buffer, se);
buffer.play(false);
this._seBuffers.push(buffer);
}
};

"In particularly the "filter" part is responsible of the fact that multiple SE might overlap each other and therefore erased SE are not stopped when asked to. Why ? I don't know, but it happens even with fresh and new projects."
If someone know to fix i will be very thankful because i stopped working on my project because of that...
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,506
Reaction score
3,545
First Language
EN
Primarily Uses
RMMZ
If your sound is not stopping, that means either you haven't actually told it to stop, or you're replaying it right afterwards. I suspect this is a problem with your event setup. It may help if you share screenshot(s) of your events. :kaohi:

You can use the Stop SE command to stop all currently-playing SE. If that's not working, then check for any events (particularly Parallel ones) with a relevant Play SE command.

Each frame, the game updates all non-Parallel events, then triggers/updates all Parallel events. So if you're using Stop SE in a non-Parallel event but playing it in a Parallel event, that may be the problem.

(The filter in the code you quoted simply removes references to sounds that have stopped playing. I don't see how that's relevant to your problem.)
 

Allien16

Warper
Member
Joined
Feb 6, 2023
Messages
2
Reaction score
1
First Language
Portuguese
Primarily Uses
RMMV
If your sound is not stopping, that means either you haven't actually told it to stop, or you're replaying it right afterwards. I suspect this is a problem with your event setup. It may help if you share screenshot(s) of your events. :kaohi:

You can use the Stop SE command to stop all currently-playing SE. If that's not working, then check for any events (particularly Parallel ones) with a relevant Play SE command.

Each frame, the game updates all non-Parallel events, then triggers/updates all Parallel events. So if you're using Stop SE in a non-Parallel event but playing it in a Parallel event, that may be the problem.

(The filter in the code you quoted simply removes references to sounds that have stopped playing. I don't see how that's relevant to your problem.)
Thanks for replying and here is the screenshots. As you can see i have put the Stop SE command but still not working and also the Parallel event shuts itself off when it starts to play the SE, so i don't know why it keeps playing. The funny part is that only occurs when i click fast on the event.
 

Attachments

  • Screenshot_2.png
    Screenshot_2.png
    63.3 KB · Views: 5
  • Screenshot_3.png
    Screenshot_3.png
    66.6 KB · Views: 5

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
4,506
Reaction score
3,545
First Language
EN
Primarily Uses
RMMZ
Just to be sure: is it the "Waking" SE that is repeating?

Maybe another event is turning the switch back on? The editor's menu bar has an option: Tools -> Event Searcher. This can help to find all places where a switch is turned on/off.

For testing, you can put a Show Text command at the start of the "hns" event (Parallel). If that text keeps appearing, then the event is still repeating. Some ideas:
  1. Does the hide_and_seek switch always get switched off? E.g. what happens if the hide_places variable is set to 3 or 4?

  2. Does any other event turn that switch on?

The funny part is that only occurs when i click fast on the event.
When you click on the "Hide place 1" event, right? That might be related to the Wait 300 frames at the start of the "hns" event. Maybe you have an event connected to one of those other switches, death_counting or time_death, that is causing the problem?
 

Latest Threads

Latest Posts

Latest Profile Posts

Calibrating the timing of dialogue is deffo my new least favorite thing.
I died aged 27 to cancer. Then I was reborn in a South-American state. I retained all memories and skill and had a goal from my previous life I needed to finish, but now I was just a 1-year-old girl capable of only smiling at others.

Dreams like this one make me glad I'm able to wake up from them at will.
Found a critical bug the other day with the time system that would have caused none of the NPCs to spawn. Since I use dev mode to test time-based stuff, I didn't catch this for way too long!
Last missing piece, a plugin to let weapons and armor be used as multiple equip types
What if the Actor Battlers disappeared when your selecting enemies...
ndyhHXV.gif

Forum statistics

Threads
129,974
Messages
1,206,652
Members
171,196
Latest member
Evolsuperx
Top