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.

[Filled] [VX] Level Up Sound Effect

I'm guessing a script will be needed for this one, but am not sure. I was wondering if there was a way someone could make it so that when a character levels up, it plays a sound effect.

Thanks in advance :)
 
Paste above main:

Code:
class Window_BattleStatus
  #--------------------------------------------------------------------------
  # * Set Level Up Flag
  #     actor_index : actor index
  #--------------------------------------------------------------------------
  def level_up(actor_index)
    @level_up_flags[actor_index] = true
    $game_system.se_play("LevelUp")
  end
end

Change "LevelUp" to the name of your sound effect, without the extension.
Make sure the SE is in your game SE folder, or in the RTP.

Be Well

ref: junk2
 
You didn't. That would have been helpful.  :scruff:

<scratches head...>

Weird, this only plays it once.

[ EDIT ] there we go. It was playing all 4 of them at once.

Code:
class Game_Actor
  #--------------------------------------------------------------------------
  # * Show Level Up Message
  #     new_skills : Array of newly learned skills
  #--------------------------------------------------------------------------
  def display_level_up(new_skills)
    $game_message.new_page
    text = sprintf(Vocab::LevelUp, @name, Vocab::level, @level)
    se = RPG::ME.new("LevelUp")
    se.play
    $game_message.texts.push(text)
    for skill in new_skills
      text = sprintf(Vocab::ObtainSkill, skill.name)
      $game_message.texts.push(text)
    end
  end
end

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Display Level Up
  #--------------------------------------------------------------------------
  def display_level_up
    exp = $game_troop.exp_total
    for actor in $game_party.existing_members
      last_level = actor.level
      last_skills = actor.skills
      actor.gain_exp(exp, true)
      wait_for_message
    end
  end
end

Be Well
 

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