Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
Original Source
- Original title: Level Up Common VX
- Original author: kyonides
- Original date: March 21, 2024
- Source thread: https://forums.rpgmakerweb.com/threads/level-up-common-vx.167015/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSS2 Scripts (RMVX)
Summary
Level Up Common VX by Kyonides Introduction This simple scriptlet will let you call a given Common Event by configuring the ACTORS_EVENT in such a way that it will find the target actor's current level and call the common event if any was found.
Archived First Post
Level Up Common VX
by Kyonides
by Kyonides
Introduction
This simple scriptlet will let you call a given Common Event by configuring the ACTORS_EVENT in such a way that it will find the target actor's current level and call the common event if any was found.
How does it find the right common event?
Well, it is very simple to explain. The scriptlet will look for the lowest level possible.
If you set a level like 5 and your actor has just reached level 2, it will trigger the level 5's common event.
Once that actor's level goes beyond that point, it will have to search for a higher level if available.
If no other level is available, nothing will happen.
If you wanna set a specific common event for the remaining levels, 100 or your game's maximum level will suffice.
I embedded some comments in the script to help you add more actors.
Right now it will only work with Ralph.
EDIT: Updated.
Ruby:
# * Level Up Common VX * #
# Scripter : Kyonides Arkanthes
# 2024-03-22
# This scriptlet allows you to call a common event after the actor finishes the
# leveling up process. To accomplish this task, you will have to configure
# the ACTORS_EVENT hash accordingly.
# To add an Actor you need an ActorID & 1 or more Level => CmEvID key pairs.
module LvUpCm
ACTORS_EVENT = {} # Leave it alone!
ACTORS_EVENT.default = {} # Leave it alone!
# Follow this pattern:
# ACTORS_EVENT[ActorID] = { 5 => 1, 10 => 2, 100 => 3, etc. }
ACTORS_EVENT[1] = { 4 => 1, 8 => 2, 100 => 3 }
end
class Game_Actor
alias :kyon_lvl_up_cmmn_gm_act_chng_exp :change_exp
def change_exp(new_exp, show)
old_level = @level
kyon_lvl_up_cmmn_gm_act_chng_exp(new_exp, show)
process_level_up_common_event(old_level)
end
def process_level_up_common_event(old_level)
return if @level <= old_level
event_group = LvUpCm::ACTORS_EVENT[@actor_id]
return if event_group.empty?
key = event_group.keys.sort.find {|n| @level <= n }
$game_temp.common_event_id = event_group[key] || 0
end
end
Download Demo
Terms & Conditions
Free for use in ANY game.
Due credit is mandatory.
Mention this forums in your game credits.
That's it!
Downloads / Referenced Files
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadLicense / Terms Note
Due credit is mandatory. Mention this forums in your game credits. That's it!
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
0
replies
1
view
Topic Summary
Loading summary...