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.

[VX] Sos Level-up Display

SoS Level-up Display
Version: 1.0

Introduction

I created a simple level-up display that will show HP, MP, ATK, DEF, SPI, and AGI stat increases when leveling up.

Features
  • Displays all stat increases upon leveling
  • Works with most custom battle systems
  • Does not currently work when leveling outside of combat

Screenshots

Screenshot1
Screenshot2

Demo

None currently

Script

Code:
#===================================================

# SoS Level-Up Display

# by: Serpent of Shadow

#

# Version 1.0

#===================================================

 

module Vocab

  LevelUp2        = "HP increases by %s!"

  LevelUp3        = "MP increases by %s!"

  LevelUp4        = "ATK increases by %s!"

  LevelUp5        = "DEF increases by %s!"

  LevelUp6        = "SPI increases by %s!"

  LevelUp7        = "AGI increases by %s!"

end

 

class Game_Actor

  #--------------------------------------------------------------------------

  # * Get HP Difference

  #--------------------------------------------------------------------------

  def dif_hp

    n = actor.parameters[0, @level] - actor.parameters[0, @level-1]

    return n

  end

  

  #--------------------------------------------------------------------------

  # * Get MP Difference

  #--------------------------------------------------------------------------

  def dif_mp

    n = actor.parameters[1, @level] - actor.parameters[1, @level-1]

    return n

  end

  

  #--------------------------------------------------------------------------

  # * Get ATK Difference

  #--------------------------------------------------------------------------

  def dif_atk

    n = actor.parameters[2, @level] - actor.parameters[2, @level-1]

    return n

  end

  

  #--------------------------------------------------------------------------

  # * Get DEF Difference

  #--------------------------------------------------------------------------

  def dif_def

    n = actor.parameters[3, @level] - actor.parameters[3, @level-1]

    return n

  end

  

  #--------------------------------------------------------------------------

  # * Get SPI Difference

  #--------------------------------------------------------------------------

  def dif_spi

    n = actor.parameters[4, @level] - actor.parameters[4, @level-1]

    return n

  end

  

  #--------------------------------------------------------------------------

  # * Get AGI Difference

  #--------------------------------------------------------------------------

  def dif_agi

    n = actor.parameters[5, @level] - actor.parameters[5, @level-1]

    return n

  end

  

  #--------------------------------------------------------------------------

  # * Show Level Up Message

  #     new_skills : Array of newly learned skills

  #--------------------------------------------------------------------------

  def display_level_up(new_skills)

    $game_message.new_page

    #Display the Level achieved

    text = sprintf(Vocab::LevelUp, @name, Vocab::level, @level)

    $game_message.texts.push(text)

    #Dislay what skill was learned

    for skill in new_skills

      text = sprintf(Vocab::ObtainSkill, skill.name)

      $game_message.texts.push(text)

    end

    

    #Display HP gained

    text = sprintf(Vocab::LevelUp2, dif_hp)

    $game_message.texts.push(text)

    #Display MP gained

    text = sprintf(Vocab::LevelUp3, dif_mp)

    $game_message.texts.push(text)

    #New Page

    $game_message.new_page

    #Display ATK gained

    text = sprintf(Vocab::LevelUp4, dif_atk)

    $game_message.texts.push(text)

    #Display DEF gained

    text = sprintf(Vocab::LevelUp5, dif_def)

    $game_message.texts.push(text)

    #Display SPI gained

    text = sprintf(Vocab::LevelUp6, dif_spi)

    $game_message.texts.push(text)

    #Display AGI gained

    text = sprintf(Vocab::LevelUp7, dif_agi)

    $game_message.texts.push(text)

    

  end

end

Instructions

Just insert in the Materials section above main (like any other custom script).

FAQ

n/a

Compatibility

The only thing this should conflict with is any other level-up displaying scripts.

Credits and Thanks

n/a

Author's Notes

n/a

Terms and Conditions

Free for non-commercial use so long as I get credit. For commercial use, please e-mail me.
 
Wow Serpentofshadow thanks for taking my request.  The script is good and does what I need it to do.  I do agree with Krobelus that a new window would be better but I'm not complaining.  The script you made is good enough, thank you so much!
 
RPGBdesign":1ola1jhh said:
i did like you said...post above main...it doesnt work

It doesn't show anything? It gives an error?  Can you give me any more details?

I just went and created a new VX project and copied my script from above and it worked fine.  Do you have any other scripts running?
 
Serpentofshadow":4yf319f3 said:
RPGBdesign":4yf319f3 said:
i did like you said...post above main...it doesnt work

It doesn't show anything? It gives an error?  Can you give me any more details?

I just went and created a new VX project and copied my script from above and it worked fine.  Do you have any other scripts running?


woops i did rmxp i didnt see the VX tag
 
Hey, as far as I can tell this works great besides one thing.


It seems like if a character levels up twice in the same battle(due to boss experience, etc) that the level up stats only display once. Does that seem accurate to you? I could be wrong...but it seems to be the case. Not a huge deal but perhaps entails an easy fix?

Thanks for the script by the way!
 
Hmm, I think some of the commercial RPGs just shows an overall end-result (haven't played Lufia series in awhile though..) instead of just going through the level-by-level report on stat gains.
 
Razaroic":2a6clb1a said:
Hmm, I think some of the commercial RPGs just shows an overall end-result (haven't played Lufia series in awhile though..) instead of just going through the level-by-level report on stat gains.

I'm pretty sure it didnt show the total stat gains though, just what they would've gained from one level increase.
 
Skaithe":3rpq0092 said:
I'm pretty sure it didnt show the total stat gains though, just what they would've gained from one level increase.

I haven't been able to figure out how to fix that just yet.  I'm still pretty new to Ruby.  I'll keep trying but help from any more experienced coders would be appreciated.
 

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