There's a part of my game where night suddenly falls, and I want the pitch of the BGM to fall along with it. But, I have no idea how to do it. I'm pretty sure a script can fix it, but I couldn't make heads or tails of what I found when I looked it up.
Knowing how this works would also help other parts of my game since music is such an integral part.
just use a change background music command and set it a lower pitch of course how you use this will depend on how exactly night is falling in your game.
I've just tried the code and it works for me. I am wondering about that apparent line break in your script call. I can get the whole call on to one line. Is there a reason why yours is split? As it appears to have split in the middle of the name, that could be what is throwing the whole thing off.
I have the updated version of Ace and perhaps it has a wider script box than the earlier version.
The reason I was asking is that I have seen several posts in different queries which warn that splitting the line can cause problems, and that one cannot rely on the automatic wrapping to get it right. I know that there is a work around, but don't remember what it is.
I think you will have to wait until someone who does know reads this thread.
I can confirm that on the earlier version (1.01a) it breaks at this position.
Edit:
It works if you manually break the line like this:
Audio.bgm_play(
"Audio/BGM/14 Abandoned Water", 80, 60,
Audio.bgm_pos)
The latest version has bigger window indeed, but still the same issue can happen.
If your title is too long and it's wrapped (even automatically) it still counts as next line and doesn't know how to combine them.
If your title will be short enough to have:
Audio.bgm_play("Audio/BGM/Abandoned",100, 120, Audio.bgm_pos)Then it will work. If a line is ending with a 'comma' then it will continue reading the code as normal.
I tried putting
Audio.bgm_play("Audio/BGM/Super_Long_Title_Of_The_Soundtrack_I_Mean_BGM_That_Will_Not_Fit_Into_The_Window_And_Will_Cause_Crash", 100, 120, Audio.bgm_pos)(It was automatically wrapped, due to no space.)
And it crashed.
Try using shorter BGM titles if they're not fitting.
Then if it is not possible to prevent that, perhaps you have to be a bit sneaky and disguise it. You don't say how the transition from day to night is caused, but if it is evented, then playing around with something like this might work.
Use a suitable SE or ME with the command for night to fall. For that sound it could be a sort of tinkling that often goes with starlight, or anything you want. As it is playing, it will cover over the pause in the pitch change in the BGM. Possibly the order of event commands would be
Play SE
Change pitch
command to change to night.
@Rikifive
That's actually quite a different question as it is for a battle scene. Let's stick to one question at a time.
Then if you to try what I suggested above put it in the event on that tile.
And Rikifive's is a bit of a different question because it needs to be tied in with keeping track of the boss's HP etc.