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.

[Resolved] Play sound when leveling up.

Status
Not open for further replies.
I tried.
No really I did.
Then I got pissed off and almost threw my laptop. Yea not a good thing  :-\

So here I am, rock you like a hurricane and such, asking for help. All i'm really looking for is a little something that will play a sound when you level up.

Thanks for all help in advance! 
 
well, take a look at the menu script and look for the code that will let you play a sound file. it may include SE or se as part of the script call. I know the most common one is the cancel sound effect. Later press Ctrl+Shift+F and look for levelup, level.up, I don't remember which one, just try some alternatives, it will show you the places where it is defined. The next thing is to try to include the sound effect where you see that the level up process is called. I'll see if I can give you a better explanation next time...
 
I think its somewhere at the BattleResults part of the script, theres one statement that says

Code:
level_up flag = true

Just put the Play se statement after that statement, I think its there
 
Code:
class Game_Actor
  Level_Up_SE = RPG::AudioFile.new(filename, volume, pitch)
  Level_Down_SE = RPG::AudioFile.new(filename, volume, pitch)
  alias_method :seph_levelsoundeffects_gmactr_exp=, :exp=
  def exp=(exp)
    level = @level
    self.seph_levelsoundeffects_gmactr_exp=(exp)
    if @level > level
      $game_system.se_play(Level_Up_SE)
    elsif @level < level
      $game_system.se_play(Level_Down_SE)
    end
  end
end

Add. Replace the filename, volume and pitch variables with you know... the filename, volume and pitch. ^_^
 
No wait as sec, I did what you said Sephiroth (love the name btw... but I digress ^_^) and I'm getting this error

Script *level up sound* line 2: Nameerror occurred
undefined local variable or method 'leveludsound' for Game_Actor: class

What did I do this time >_<
 
You have to send a string object.

Code:
  Level_Up_SE = RPG::AudioFile.new('filename', volume, pitch)
  Level_Down_SE = RPG::AudioFile.new('filename', volume, pitch)
]

So replace levelupsound with 'levelupsound'
 
Status
Not open for further replies.

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