Level Up ME & SE ACE
#1
Level Up ME & SE ACE

by Kyonides

Introduction

Here you can find 2 scriptlets that will let you either change the ME that should be played right after winning the battle or play a short SE for every actor that did level up then.

Both have something in common: the LVL_UP_SOMETHING_SETUP constant where SOMETHING stands for either ME or SE.

It is an array that needs 3 values: the "Filename", the Volume, and the Pitch.

The rest of the process is taken care of by the scripts themselves. Now just win the battle and you'll be listening to them in no time. Winking

The Level Up ME Script

Code:
# * Level Up ME ACE * #
#   2024-01-23

class << BattleManager
  LVL_UP_ME_SETUP = ["Victory2", 80, 100]
  LVL_UP_ME = RPG::ME.new(*LVL_UP_ME_SETUP)
  alias :kyon_lvl_up_me_play_btl_proc_vict :process_victory
  def play_battle_end_me
    @level_up_flag ? LVL_UP_ME.play : $game_system.battle_end_me.play
    @level_up_flag = nil
  end

  def test_gain_exp
    exp = $game_troop.exp_total
    lvl_up = $game_party.all_members.map {|actor| actor.test_change_exp(exp) }
    @level_up_flag = lvl_up.any?
  end

  def process_victory
    test_gain_exp
    kyon_lvl_up_me_play_btl_proc_vict
  end
end

class Game_Actor
  def test_change_exp(exp)
    last_exp = @exp[@class_id]
    @exp[@class_id] = [exp, 0].max
    last_level = @level
    level_up while !max_level? && self.exp >= next_level_exp
    next_level = @level
    level_down until @level == last_level
    @exp[@class_id] = last_exp
    next_level > last_level
  end
end

The Level Up SE Script

Code:
# * Level Up SE ACE * #
#   2024-01-23

class Game_Actor
  # Arguments Order: ["Filename", Volume, Pitch]
  LVL_UP_SE_SETUP = ["Chime2", 80, 100]
  LVL_UP_SE = RPG::SE.new(*LVL_UP_SE_SETUP)
  alias :kyon_lvl_up_se_gm_act_dis_lvl_up :display_level_up
  def display_level_up(new_skills)
    LVL_UP_SE.play
    kyon_lvl_up_se_gm_act_dis_lvl_up(new_skills)
  end
end

Terms & Conditions

Well, they're nothing but short scripts so I don't mind letting people use them for free.
Just include me in your game credits and that's it! Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Map Safety Level VX + ACE kyonides 0 133 09-27-2024, 07:30 AM
Last Post: kyonides



Users browsing this thread: 1 Guest(s)