yo, I know I just made an account but I do know RPGcode quite well, I've been messing with it for about 1.5 years(not bad eh?).
I actually made a similar method a while ago... but it really depends on how flexible you want it, if you are using the same character throughout the entire story than you can have the character's handle already set, as in it is not a variable such as "handle$". Also it depends on what it is going to be used for and the circumstances, ex: it would be alot easier if you do not have this as a custom method if it is being used for a CBS(custom battle system) or CMS(custom menu system). this is an examle for a status bar method for a menu. (in order for this to work you need to have the "handle$" of the character pre-set, I like to set it at the beggining of a game or when I get a new character)
here it is:
//status$ is the status you want to display, ex: Hp Smp and so on...
//x! and y! are the pixel location
//h!=height(vertical) w!=length(horizontal)
//set1! and set2! are the percentages that you set for different
//-color changes
method statusbar("status$",x!,y!,h!,w!,set1!,set2!)
{
get[status$]("handle$",status!)
getmax[status$]("handle$",max!)
tempstatus!=status!*w!
tempstatus!=tempstatus!/max!
clear(status!)
castint(tempstatus!,status!)
set1!=set1!*100
set1!=set1!/w!
set2!=set2!*100
set2!=set2!/w!
colorrgb(r!,g!,b!) //replace the variables with the frame's color
drawrect(x!,y!,w!+x!,h!+y!)
if(status!>=set1!)
{
color(r!,g!,b!) //replace the variables with the color for high
fillrect(x!+1,y+1!,status!+x!-1,h!+y!-1)
}
if(status!<=set1!+1)
{
if(status!>=set2!)
{
color(r!,g!,b!) //replace the variables with the color for medium
fillrect(x!+1,y+1!,status!+x!-1,h!+y!-1)
}
if(status!<=set2!+1)
{
color(r!,g!,b!) //replace the variables with the color for low
fillrect(x!+1,y+1!,status!+x!-1,h!+y!-1)
}
}
}