Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Sound Effect

Okay, this is enfuriating!
I cannot get this to work!
I'm trying to play a sound effect within a script I have, and it's not working!

This is what I have:

Code:
Audio.se_play(RPG::AudioFile.new("BookPageFlip", 100, 100))

The error message I'm getting says:

TypeError occured. cannot convert RPG::AudioFile to String

....WHY?! Why would it be trying to do that! It's a filename!

*sigh* So... does anyone know what's wrong?
 
Ah! All right! Thanks!
I found that code somewhere else on this site; maybe it just depends on how it's being used. I don't know enough about RGSS to know. ^_^
Well, thank you! It works now.
 
Just FYI, the code you used is only valid if you use the Game_System object or any other method rewrite to do this.
So the code would be:
Code:
$game_system.se_play(RPG::AudioFile.new(""Audio/SE/BookPageFlip",100,100))
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top