RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
max level status screen error

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 57
RPG VX - Project Moonhunter
upon using this scriptby dartdaman (http://rmrk.net/index.php/topic,43879.msg498396.html#msg498396) for my status screen, I came across a little snag.

Seems that - when a character's at maximum level, an error occurs:

"Script line 96: ZeroDivissionError occured, divided by 0."

I like using a picture in the status screen, but I wouldn't want to rob the player of my game from reaching maximum level - and getting this error. Any ideas?

~ Geoff
My project:

*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
Between line 95 and 101 you should see this
Code: [Select]
def draw_actor_exp_gauge(actor, x, y, width = 120)
    gw = width * actor.bar_now_exp / actor.bar_next_exp
    gc1 = exp_gauge_color1
    gc2 = exp_gauge_color2
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end

Replace that with this:
Code: [Select]
def draw_actor_exp_gauge(actor, x, y, width = 120)
    if @actor.level <= 98
      gw = width * actor.bar_now_exp / actor.bar_next_exp
    else
      gw = width * actor.bar_now_exp
    end
    gc1 = exp_gauge_color1
    gc2 = exp_gauge_color2
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end


All that will do is prevent the error. But if you want the gauge to display exp at max or something, you'll need to ask for that, I'm not familiar enough with RGSS to figure out how to do that.
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

***
Rep:
Level 65
Working on Monster Leader
Contestant - GIAW 9
To display the gauge full when at max level you only need to specify the width used in gradient_fill_rect as the width of the full gauge ^^

Code: [Select]
  def draw_actor_exp_gauge(actor, x, y, width = 120)
    if @actor.level <= 98
      gw = width * actor.bar_now_exp / actor.bar_next_exp
    else
      gw = width
    end
    gc1 = exp_gauge_color1
    gc2 = exp_gauge_color2
    self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end




*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
I just figured that out.

You beat me to it :(
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

***
Rep:
Level 65
Working on Monster Leader
Contestant - GIAW 9
Oh, I'm sorry ^^''
Just saw it, looked and it and thought I'd inform you about it XD




*
*crack*
Rep:
Level 64
2012 Best Newbie2012 Most Unsung MemberFor frequently finding and reporting spam and spam bots
Don't be sorry. I meant that as in
"Oh damn, I was too late" :P

But thanks for the info ^-^
All of my scripts are totally free to use for commercial use. You don't need to ask me for permission. I'm too lazy to update every single script post I ever made with this addendum. So ignore whatever "rule" I posted there. :)

All scripts can be found at: https://pastebin.com/u/diamondandplatinum3

***
Rep:
Level 57
RPG VX - Project Moonhunter
You people are wizards. Thank you so much! Cookies go to you.

~ Geoff
My project: