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
5,260
Reaction score
4,735
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: 8
  • Screenshot_3.png
    Screenshot_3.png
    66.6 KB · Views: 8

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
5,260
Reaction score
4,735
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 Profile Posts

A sad day for me. A monitor that served me loyally for more than 5 years is getting replaced. It's begun to throw very large sparks.
skill.gif
experimenting with outlines in GIMP. found out it's EXTREMELY easy to do actually.
I have locked myself away into my Reaper dungeon. I assume this is all you'll need until I get back.

1701973777966.jpeg1701973812025.jpeg

Forum statistics

Threads
136,813
Messages
1,270,334
Members
180,575
Latest member
SredniVashtar
Top