Run common event on level-up?

Yummytiger22

Villager
Member
Joined
May 25, 2012
Messages
17
Reaction score
4
First Language
English
Primarily Uses
Hello everyone!

I was wondering if anyone would have a suggestion on how to go about having the game run a common event every time the player levels up? I'd like to have messages (kind of like Morrowind) when the player levels up detailing how the player has grown. I've manually adjusted every level up to reflect specific growth for the main character, and want the player to understand why growth is so uneven. So, I'd need to be able to call up a common event and then have specific messages based on the level gained. I'm pretty sure I can already set up conditional branches based on main character level, so that part should be easy.

Thanks for any suggestions people have! This community is awesome!

YT
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,430
Reaction score
7,711
First Language
German
Primarily Uses
RMMV
Use one variable per actor to store old level


make a common event checking current level of each actor against the variable, displaying message and updating whenever the current level is higher.


call that common event after each event that rewards XP, and once after each battle
 

Lecode

(─‿‿─)
Veteran
Joined
Dec 18, 2013
Messages
490
Reaction score
659
First Language
French
Primarily Uses
N/A
Hi.

Try this: (Not working in battle however :x )

Code:
module CommonEvent_OnLevelUp  ID = 1endclass Game_Interpreter    def launch_common_event(ce_id)    common_event = $data_common_events[ce_id]    if common_event      child = Game_Interpreter.new(@depth + 1)      child.setup(common_event.list, same_map? ? @event_id : 0)      child.run    end  end  endclass Game_Actor    alias lecode_lceolu_level_up level_up  def level_up    lecode_lceolu_level_up    $game_map.interpreter.launch_common_event(CommonEvent_OnLevelUp::ID)  end  end
 
Last edited by a moderator:

Lantiz

PunyMagus
Veteran
Joined
Dec 29, 2012
Messages
723
Reaction score
1,074
First Language
Portuguese
Primarily Uses
Other
I did something a little different, so you can call a different event for each party member:

 

module On_Level_Up # define the common event id for each party member # eq. when the first party member (index 0) level up, run the common event that has this ID and so on # you can add more if you have more party members EVENTS = {'0'=>1, '1'=>2, '2'=>3, '3'=>4 }endclass Game_Actor alias :very_old_level_up :level_up def level_up very_old_level_up member = nil for i in 0..(On_Level_Up::EVENTS.length - 1) member = i if $game_party.members && $game_party.members.id == @actor_id end $game_temp.reserve_common_event(On_Level_Up::EVENTS[member.to_s]) endendEdit: so you can use as many party members you want
 
Last edited by a moderator:

Yummytiger22

Villager
Member
Joined
May 25, 2012
Messages
17
Reaction score
4
First Language
English
Primarily Uses
Thank you both so much! I really, really appreciate it.

@Magno: I was just happy someone put something together and was trying Lecode's script when I realized the issue with more than one party member :). I was actually redesigning things to make that work, but you fixed that problem. All I can say is awesome. I've tested it and it works as intended.

YT
 

Lantiz

PunyMagus
Veteran
Joined
Dec 29, 2012
Messages
723
Reaction score
1,074
First Language
Portuguese
Primarily Uses
Other
Thank you both so much! I really, really appreciate it.

@Magno: I was just happy someone put something together and was trying Lecode's script when I realized the issue with more than one party member :). I was actually redesigning things to make that work, but you fixed that problem. All I can say is awesome. I've tested it and it works as intended.

YT
Awesome! Glad to help.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,450
Members
137,820
Latest member
georg09byron
Top