じ☆ve冰风 发表于 2026-8-3 09:41:28

Level Up ME & SE ACE

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.


The Level Up ME Script

                Ruby:       
# * 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] = .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

                Ruby:       
# * 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!



本贴来自国际rpgmaker官方论坛作者:kyonides处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/level-up-me-se-ace.165073/
页: [1]
查看完整版本: Level Up ME &amp; SE ACE