Script Call to change the Battle Start Sound and allow different encounters to have different ones

There's been a few broken plugins for this. I've tried digging into the system.json but they made it all one line and browsing columns is confusing. I found that the Battle Start Music Sound goes into Row 2161 but I don't know how to make the call.

Driftwood suggested I play around with $dataSystem.sounds[7].setValue("sfxName.ogg".toString()); and I've been trying diferent things.
The most common error it gives me is that the SE I'm choosing is not defined, I'm trying out Bell2.

I've put this line in the Troop Events section to fire off, but I think that might start too late to be a battle start sound. So I put it in a utility event that runs various functions, that didn't work nor putting it in a walking event with Approach.

I even tried to fire off a SE on that walking event and then start battle processing, but the SE is cut off after about 30 frames and there's an awkward silence after the SE but before the battle.

I am on my wit's end, please help if you have any knowledge and this stuff comes easy to you! -__-;
$dataSystem.sounds[7].setValue("sfxName.ogg".toString());
This is wrong. The correct one is:
Code:
$dataSystem.sounds[7].name = "SE_FILENAME";
You can also do this for the pan, pitch and volume:
Code:
$dataSystem.sounds[7].pan = INT;
$dataSystem.sounds[7].pitch = INT;
$dataSystem.sounds[7].volume = INT;
This is wrong. The correct one is:
Code:
$dataSystem.sounds[7].name = "SE_FILENAME";
You can also do this for the pan, pitch and volume:
Code:
$dataSystem.sounds[7].pan = INT;
$dataSystem.sounds[7].pitch = INT;
$dataSystem.sounds[7].volume = INT;

Thank you so much Dr! How did you know it was wrong, was it just from experience or is there a way that n00bs like me can tell?

I will put you in my Credits Page. Again, thank you.
You can open the developer tools and the code there. It will give you an error that setValue is not a function because $dataSystem.sounds[x] is an AudioFile object that has no setValue function. You can read about what AudioFile is in the Help Page (press F1 in the editor).

You're welcome 🙂
You can open the developer tools and the code there. It will give you an error that setValue is not a function because $dataSystem.sounds[x] is an AudioFile object that has no setValue function. You can read about what AudioFile is in the Help Page (press F1 in the editor).

You're welcome 🙂

I have nothing inside RPG Maker MV Tools and F1 Help only opens a text file with this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>RPG Maker MV Help</title>
<link rel="stylesheet" href="inc/css/style.min.css" />
<script type="text/javascript" src="inc/js/lib/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="inc/js/common.js"></script>
</head>
<frameset rows="80px, *, 20px">
<frame src="parts/header.html" name="frame_header" frameborder="0" noresize="noresize" />
<frameset cols="*,1000px,*">
<frame src="about:blank" frameborder="0" noresize="noresize" />
<frameset cols="250px,750px">
<frame src="parts/side.html" name="frame_side" frameborder="0" noresize="noresize" />
<frame src="page/01.html" name="frame_main" frameborder="0" noresize="noresize" />
</frameset>
<frame src="about:blank" frameborder="0" noresize="noresize" />
</frameset>
</frameset>



</html>
That's not a txt file, that's an html file and you should open it with a browser.
By the way to open the developer tools press F8 (MV 1.5.x and below) or F12 (MV 1.6.x).
That's not a txt file, that's an html file and you should open it with a browser.
By the way to open the developer tools press F8 (MV 1.5.x and below) or F12 (MV 1.6.x).

So, there must be something wrong because I still get text when I open the file in FF and I don't know how to make it run the HTML code and when I press F8 or F12 sometimes Steam takes a screenshot. I looked under Help > About and it says I have version 1.6.1.

EDIT:
I resaved the file from a .txt to .html and tried to open with FF again and it gave me a page with a frame and a column and each section had an error. It is looking for a directory named "parts" and "page" on my desktop. I looked in the RPGM MV main directory and couldn't find said folders.

Original thread: https://forums.rpgmakerweb.com/threads/script-call-to-change-the-battle-start-sound-and-allow-different-encounters-to-have-different-ones.103383/