RGSS3 Regedit Modifying - script call error

Original script:

Trying to set the value of DWORD values in-game (0 or 1) and it's not working; think I'm messing up the value format on the reg.set line. Script call:
Code:
reg = Registry.new()
reg.open(:HKEY_CURRENT_USER, "Software\Enterbrain\RGSS3")
reg.set("PlayMusic", 0)
value = reg.get("PlayMusic")
reg = nil; GC.start
What's the specific format needed for that reg.set command? The documentation for this line of code starts at line 76 or so in the script but I'm still a bit confused. (Working off of rough google auto-translations for this script.)
Code:
> reg.open:(HKEY_CURRENT_USER, "Software\\Enterbrain\\RGSS3")
Code:
reg.open:(HKEY_CURRENT_USER, "Software\Enterbrain\RGSS3")
Perhaps you forgot to escape your backslash characters?
Code:
> reg.open:(HKEY_CURRENT_USER, "Software\\Enterbrain\\RGSS3")
Code:
reg.open:(HKEY_CURRENT_USER, "Software\Enterbrain\RGSS3")
Perhaps you forgot to escape your backslash characters?
Still getting an error popup.
Code:
reg = Registry.new()
reg.open(:HKEY_CURRENT_USER, "Software\\Enterbrain\\RGSS3")
reg.set("PlayMusic", 0)
value = reg.get("PlayMusic")
reg = nil; GC.start
upload_2019-7-14_23-52-54.png

For reference, this one (modifying ButtonAssign values) seems to work fine:
Code:
reg = Registry.new()
reg.open(:HKEY_CURRENT_USER, "Software\\Enterbrain\\RGSS3")
reg.set("ButtonAssign", [0] * 25)
value = reg.get("ButtonAssign")
reg = nil; GC.start
Trying it myself, I found that neither works; both can return that same error message. Sometimes it manages to work if I catch the error and spam the Enter key enough. I dug a little deeper and have narrowed it down to the .to_ansi calls it makes, notably in the open and query methods. Removing them ensured 100% success in my calls.

Now the annoyance is that this will still not get you what you want. I've actually explored this topic before:
https://forum.chaos-project.com/index.php/topic,15959.msg196896.html#msg196896
In short, changing the registry value won't suddenly enable the player's Game.exe to play music.
Trying it myself, I found that neither works; both can return that same error message. Sometimes it manages to work if I catch the error and spam the Enter key enough. I dug a little deeper and have narrowed it down to the .to_ansi calls it makes, notably in the open and query methods. Removing them ensured 100% success in my calls.

Now the annoyance is that this will still not get you what you want. I've actually explored this topic before:
https://forum.chaos-project.com/index.php/topic,15959.msg196896.html#msg196896
In short, changing the registry value won't suddenly enable the player's Game.exe to play music.
For some reason, this now happens:
Code:
reg = Registry.new()
reg.open(:HKEY_CURRENT_USER, "Software\\Enterbrain\\RGSS3")
reg.set("PlayMusic", 0x1, :REG_DWORD)
value = reg.get("PlayMusic")
reg = nil; GC.start
SceneManager.exit
upload_2019-7-15_4-2-49.png


On my end, if I modify the ButtonAssign value and force-close the game immediately afterwards, once I re-open it, the values are applied to the game and show up properly in the F1 menu. It's strange to hear that the ButtonAssign script call gave you any errors...

Original thread: https://forums.rpgmakerweb.com/threads/rgss3-regedit-modifying-script-call-error.111070/