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.

[XP]Battle System Editing

Basically, what I have is a very simple sideview script that I found on another forum a while back, but there's a problem with it's built-in HP and MP gauges: whenever MP is 0 for any battler on either side, the game crashes and the error is on line 30.

I want to know how I would go about fixing this, since the script is not commented properly, I can't find exactly where it is to fix.

The Code

Oh yeah, it's not indented properly, either.

If someone more RGSS literate would look over the code for me and tell me how to fix it, I'd be very appreciative! :cheers:

EDIT: Now I have another problem. The script makes no provision to notify the player of a level up. What should I do?
 
It didn't crash for me in a blank project. Do you have other scripts installed? If so, which ones affect the Bitmap class? (Search all scripts (Ctrl+Shift+F) for "class Bitmap")
 
Go to line 743 and change
[rgss]rate = i.to_f / @battler.maxsp
[/rgss]
to (only the first line)
[rgss]rate = ((@battler.maxsp == 0) ? 1.0 : (i.to_f / @battler.maxsp))
# the above is a short way of doing
#   if @battler.maxsp == 0
#     rate = 1.0
#   else
#     rate = i.to_f / @battler.maxsp
#   end
[/rgss]
Which says if the battler's maxsp is 0 it uses the full bar (rate = 1.0), otherwise it does things the normal way (current sp / max sp).

If that doesn't work or you have a question about it, say so.
 
Metatron":177cwfed said:
EDIT: Now I have another problem. The script makes no provision to notify the player of a level up. What should I do?
Note that this isn't game design support... you should know how you want your player to be notified of a level up (for example, RMXP's default, while not being completely bad, still sucks ;) )

So, as soon as you know what you want, you know what you need for that: A modified window, probably another window, an animation played, SE or ME playback, sprite display, stats being displayed, nude chicks dancing on poles, ... that's when you can come again and ask for script support ;)
 
Ok, I've decided I want a window in the bottom left-hand corner of the screen to show up with the name and stats of the character that leveled up, plus the improvement.

So...

Code:
 

[Name] Level Up

LVL 1 > 2

STR 1 > 2

DEX 1 > 2

AGI 1 > 2

INT 1 > 2

Or something like that.
 

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