Hey, everyone.
With my first script having been done almost completely (which I am really excited about), there's only one problem that remains... a new problem I've run into. Sounds definitely seem to overwrite each other.
I have made a spell which spawns lasers, which leave behind trails of projectiles that begin moving after a short while. It's the same spell I had 0,0 spawning issues with back then, but that was thankfully fixed since.
However, I've run into a new, mainly cosmetic, but still a quite annoying problem. I have made the spell so a laser sound effect is heard whenever the lasers are fired, and a "charge" sound (similiar to the sound heard when the laser cage in Boundary of Humans and Youkai moves around) is heard when the projectiles begin moving.
The problem is... should new lasers be fired at the moment the projectiles move, the lasers' sounds "overwrite" the charge sound, as in, cut it short, which doesn't happen in the original Touhous (think BoHaY again).
task lazertime{
let angle = 100;
wait(60); //One time wait so the cutin can disappear by this time, and the boss can move into position
loop{
while(GetShotCount(Zataihou) > 160){yield;} //If there's many souls on screen, stop creating new lasers and trails. Souls are "Yuyuko-type butterflies".
wait(10);
ascent(i in 1..6){
let obj = CreateCurveLaserA1(ObjMove_GetX(Zataihou), ObjMove_GetY(Zataihou), 12, angle+i*12, 30, 20, 1019+i, 10); //Handles the lasers
SE_Play(laser2,70); //laser sound
ObjCrLaser_SetTipDecrement(obj,0); //Makes laser hitbox fair
ObjMove_SetAngularVelocity(obj,-7); //Handles the curving of the lasers
trail(obj); //Task to spawn trails. No issue with this one.
straighten(obj); //Task to have the lasers go straight after a short while (so they leave the screen). No issue here either.
angle+=30; //Increment angle to give different laser angles
}
}}
task fly(souls){
while(GetShotCount(Zataihou) < 150){yield;} //Wait until there's enough souls, then...
ObjMove_AddPatternA2(souls,60,NO_CHANGE,rand(40,150),0.01,0,12); //... let them move around.
SE_Play(charge4,100); //charge sound
}
The SE_Play in the above example is a task that loads, plays, then removes the sound, based on AJS' Praise The Sun (without looking at and analysing his scripts, I probably wouldn't have been able to start at all, shoutout for his great works!)
task SE_Play(let path, let vl){
let seobj = ObjSound_Create;
ObjSound_Load(seobj,path);
ObjSound_Play(seobj);
ObjSound_SetVolumeRate(seobj,vl);
loop(120){yield;}
RemoveSound(path);
}
Could the problem be that both sounds are being handled via SE_Play? What could be possible ways to fix this?
Also, I haven't been able to stop the background music once the script ends (not while paused, I managed to do that). Any ideas about how to do that?
Thanks for replies in advance!