Letter sound Toggle (using Yan Options And Yan Message core X-1)

Yougotsomechocolate

Random Chest
Veteran
Joined
Jan 29, 2019
Messages
203
Reaction score
84
First Language
English
Primarily Uses
RMMV
I've been looking for a way to do this for a while, tried to do so but I'm not sure exactly how to code turning the sound on/off as an option. So if anyone knows how please tell me.
(I do know that someone asked before me a while back, like a year ago, but never got a response.)
 
Last edited:

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
1,049
Reaction score
328
First Language
Dutch
Primarily Uses
RMMV
what exacly do you want? make a typing sound or turn off/on the typing sound in the option menu?
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
1,049
Reaction score
328
First Language
Dutch
Primarily Uses
RMMV
I dont use it but if you can make a commen event into it, it might be easier, but I cant check atm.
but the option core is to complicated so I drop the plugin.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,401
Reaction score
880
First Language
EN
Primarily Uses
RMMV
Plugin link: http://www.yanfly.moe/wiki/Extended_Message_Pack_1_(YEP)

From looking at the code, I believe the script call to turn letter sounds on is:
Code:
$gameSystem._msgSoundEnable = true;
Swap true for false to turn them off. Then you could use Yanfly's Options Core plugin to add the option for the player. I think the default "new option" stuff is for a simple on/off switch like this so I imagine it'd be fairly easy as these things go: just add that script call where appropriate to turn the sounds on/off. :)

Note that this approach assumes you won't be using the on/off plugin commands or message escape codes for letter sounds. If you want something to track player preference separately from the actual game setting then you may want to request an add-on over in JS Plugin Requests.
 

Yougotsomechocolate

Random Chest
Veteran
Joined
Jan 29, 2019
Messages
203
Reaction score
84
First Language
English
Primarily Uses
RMMV
@caethyril I’ll fiddle with it and see what makes it work (also for some reason lettersound glitches on my computer). edit: it seems the code doesn't work when I put it in the option menu, maybe the plugin command works?
 
Last edited:

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,401
Reaction score
880
First Language
EN
Primarily Uses
RMMV
Oh I just realised something. While I can get it working correctly like this (on/off while in-game), the letter sound thing is part of the saved data ($gameSystem), meaning it won't necessarily align with the game options (global). You may need a different letter-sound plugin, or at least some kind of add-on to handle re-initialising the config values on new game. :kaoslp:

I'll leave my text-format "letterSound" Options Core entry here for anyone interested, but as I said, by itself the displayed and internal system values won't necessarily match up~
Code:
{"Name":"Letter Sounds","---Settings---":"","HelpDesc":"\"Enable or disable typing sounds for messages.\"","Symbol":"letterSound","ShowHide":"\"show = true;\"","Enable":"\"enabled = true;\"","Ext":"\"ext = 0;\"","---Functions---":"","MakeCommandCode":"\"this.addCommand(name, symbol, enabled, ext);\"","DrawItemCode":"\"var rect = this.itemRectForText(index);\\nvar statusWidth = this.statusWidth();\\nvar titleWidth = rect.width - statusWidth;\\nthis.resetTextColor();\\nthis.changePaintOpacity(this.isCommandEnabled(index));\\nthis.drawOptionsName(index);\\nthis.drawOptionsOnOff(index);\"","ProcessOkCode":"\"var index = this.index();\\nvar symbol = this.commandSymbol(index);\\nvar value = this.getConfigValue(symbol);\\nthis.changeValue(symbol, !value);\\n$gameSystem._msgSoundEnable = !value;\"","CursorRightCode":"\"var index = this.index();\\nvar symbol = this.commandSymbol(index);\\nvar value = this.getConfigValue(symbol);\\nthis.changeValue(symbol, true);\\n$gameSystem._msgSoundEnable = true;\"","CursorLeftCode":"\"var index = this.index();\\nvar symbol = this.commandSymbol(index);\\nvar value = this.getConfigValue(symbol);\\nthis.changeValue(symbol, false);\\n$gameSystem._msgSoundEnable = false;\"","DefaultConfigCode":"\"ConfigManager[symbol] = false;\"","SaveConfigCode":"\"config[symbol] = ConfigManager[symbol];\"","LoadConfigCode":"\"if (config[symbol] !== undefined) {\\n  ConfigManager[symbol] = !!config[symbol];\\n}\\nif ($gameSystem) {\\n  $gameSystem._msgSoundEnable = !!ConfigManager[symbol];\\n}\""}
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Eh... just the three of us killing mosquitoes and collecting them. Current kill count: 14.
Been watching videos about IRS phone scammers. Some really scummy people in the world.
Is the "2 status updates per 24h" still in effect?
My first attempt at Pixel Art :blink::) (I have no idea what I'm doing but I'm doing it)
Plugin instructions: *exists*
Plugin: What did he say? *error*

Forum statistics

Threads
93,724
Messages
914,941
Members
123,330
Latest member
Rikuto
Top