Hi everyone, i wanted some specific help with the awesome Luna Engine... What i want to achieve is making the HP/MP numbers in green color when the characters got their HP/MP at max (full), when they get hurt/use magic the numbers will get in white color, and when its on critical (near zero) the numbers will get a red color. This function is similar to Lunar games for the SS/PSX.
So far i tried with a script i made but it didnt worked, it was this code:
#Draw HP
def draw_actor_hp(actor, x, y, width = 124)
change_color(normal_color)
if actor.hp > (actor.mhp-1)
change_color(max_color)
end
if actor.hp < (actor.mhp/3)
change_color(low_color)
end
draw_text(x, y, 30, line_height, actor.hp)
end
# Draw MP
def draw_actor_mp(actor, x, y, width = 124)
change_color(normal_color)
if actor.mp > (actor.mmp-1)
change_color(max_color)
end
if actor.mp < (actor.mmp/3)
change_color(low_color)
end
draw_text(x, y, 30, line_height, actor.mp)
end
But it didnt worked, i am also using the sfont script "OLD_RM_STYLE v1.1.3" by Joke...
Well hope someone can help me with this, thanks.
Oh sorry, i always mess with where i put my threads haha
Actually, Luna Engine has its own section, so...
Moderator note: moving this again to VX Ace Lune Engine Support
Well seems no one knows how to do this...
Window_base
def hp_color
These determine the color of the numbers
But your use of the OLD_RM_STYLE script is what is messing you up. It is using graphic files to change the numbers. You need to find a way to change the image when your hp is low through that script.
Remove the script and test it out.
There are also other scripts that I remember seeing which give more control over the color of the numbers.
Hey brother, thanks for the help, i already got rid of OLD RM STYLE, and i am using Victor SFont Script instead... i got it working a bit, but there is a problem... the align seems to be to the left instead of to the right, like this: As you can see, the number "50" is to the left side, i want it to the right, but i dont have a idea of how to do that...
Not sure how you have it configured. Looking at Battle Luna Config - the hp_num for type_0 and 1 are both set to align 2 by default. (right)
Well, i made some edits in battle luna, in line 680 i added this:
############################################################################
##### ADD MAX AND LOW NUMBER COLORS#########################################
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
Graphics.width - 160
end
#--------------------------------------------------------------------------
# * Get Window Height
#--------------------------------------------------------------------------
def window_height
500
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
return 1
end
def col_max
5
end
#--------------------------------------------------------------------------
# * Get Number of Items
#--------------------------------------------------------------------------
def item_max
$game_party.battle_members.size
end
def item_width
40
end
#--------------------------------------------------------------------------
# * Get Item Height
#--------------------------------------------------------------------------
def item_height
64
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_all_items
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.battle_members[index]
draw_basic_area(basic_area_rect(index), actor)
#draw_gauge_area(gauge_area_rect(index), actor)
# draw_gauge_area_without_tp(rect, actor)
end
#--------------------------------------------------------------------------
# * Get Basic Area Retangle
#--------------------------------------------------------------------------
def basic_area_rect(index)
rect = item_rect_for_text(index)
rect.width -= gauge_area_width + 10
rect
end
#--------------------------------------------------------------------------
# * Get Gauge Area Rectangle
#--------------------------------------------------------------------------
def gauge_area_rect(index)
rect = item_rect_for_text(index)
rect.x += rect.width - gauge_area_width
rect.width = gauge_area_width
rect
end
#--------------------------------------------------------------------------
# * Get Gauge Area Width
#--------------------------------------------------------------------------
def gauge_area_width
return 40
end
#--------------------------------------------------------------------------
# * Draw Basic Area
#--------------------------------------------------------------------------
def draw_basic_area(rect, actor)
draw_actor_hp(actor, rect.x + 54, rect.y+104,134)
draw_actor_mp(actor, rect.x + 54, rect.y+120,76)
draw_actor_level(actor, rect.x + 38, rect.y+88)
# draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104)
end
#--------------------------------------------------------------------------
# * Draw Gauge Area (without TP)
#--------------------------------------------------------------------------
def spacing
48
end
def draw_actor_hp(actor, x, y, width = 124)
change_color(normal_color)
if actor.hp > (actor.mhp-1)
change_color (power_up_color)
end
if actor.hp < (actor.mhp/3)
change_color(power_down_color)
end
draw_text(x, y, 30, line_height, actor.hp)
end
#--------------------------------------------------------------------------
# * Draw MP
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 124)
change_color(normal_color)
if actor.mp > (actor.mmp-1)
change_color(power_up_color)
end
if actor.mp < (actor.mmp/3)
change_color(power_down_color)
end
draw_text(x, y, 30, line_height, actor.mp)
end
end # Window_BattleStatus
By default Luna Engine doesnt let me use max numbers and low numbers, so i made this myself
its a bit messy lol