Hey there.
For my game I wanted to have text sounds when the characters are displayed. For that purpose I use a script from Zerbu (https://www.rpgmakercentral.com/topic/607-text-sound-effect-updated/) because I'm fairly new to Ruby. It works perfectly but now I want to change the text sound via an in-game event. I hope it's okay if I post a fraction of the code here for reference:
So I tried several things:
For my game I wanted to have text sounds when the characters are displayed. For that purpose I use a script from Zerbu (https://www.rpgmakercentral.com/topic/607-text-sound-effect-updated/) because I'm fairly new to Ruby. It works perfectly but now I want to change the text sound via an in-game event. I hope it's okay if I post a fraction of the code here for reference:
Code:
module Text_Sound_Effect
MESSAGE_SOUND = RPG::SE.new("Knock", 50, 70)
MESSAGE_SOUND_FRAMES = 3
MESSAGE_SOUND_DISABLE = 94
end
- first I tried to simply call it via "Text_Sound_Effect.MESSAGE_SOUND = ..." but this didn't work because it is handled as a constant or something like that
- I then researched a bit and tried to write a class containing the variable and calling this variable from the module and my in-game event. I'm not 100% sure anymore but I think the engine then said that my variable name is not a method
- so I tried to write a method within the class to change the variable from outside. That didn't work for me either.