Hi, so I wanted to give it a bit before asking but I'm kind of stuck here - I bumped into this tutorial on how to make an HP bar common event - and I figured it got me into trying to attempt my own system but I'm having a few problems that I need help with.
I figured it would be better to post here rather then the script call support thread - since I tried to get it into a test script - I'm trying to keep it as a function so that I can have another part of the script just trigger things based on conditional statements.
I've been trying to mess with the script and here's what it looks like now:
So the big problem here, is that I feel like the health bar is constantly getting "refreshed" causing it to flicker. And the health bar doesn't move - when the script is like this. However, If I take out the bit that draws the picture from the function - and have it run once, the flickering stops and that's fine - but then then the health bar decides to just start shrinking itself really low, or just stretching so far it goes off screen. And seems to be ignoring the script all together.
If anyone know's what's going on and can help with this - I'd appreciate it.
I figured it would be better to post here rather then the script call support thread - since I tried to get it into a test script - I'm trying to keep it as a function so that I can have another part of the script just trigger things based on conditional statements.
I've been trying to mess with the script and here's what it looks like now:
def healthbardraw
#Checks to see if HP is higher or lower than the scroll variable, then fixes itself to match.
if $game_variables[21] < $game_actors[1].hp
$game_variables[21] += 1
end
if $game_variables[21] > $game_actors[1].hp
$game_variables[21] -= 1
end
#turns the equation into a nice bit of text that I can just throw around in formulas.
def actorhealth
25*($game_variables[21]/$game_actors[1].mhp)
end
screen.pictures[1].show("hp_bar", 0, 12, 12, 25, 25, 255, 0)
screen.pictures[1].move(0, 10, 10, actorhealth, 25, 255, 0, 60)
end
#Checks to see if HP is higher or lower than the scroll variable, then fixes itself to match.
if $game_variables[21] < $game_actors[1].hp
$game_variables[21] += 1
end
if $game_variables[21] > $game_actors[1].hp
$game_variables[21] -= 1
end
#turns the equation into a nice bit of text that I can just throw around in formulas.
def actorhealth
25*($game_variables[21]/$game_actors[1].mhp)
end
screen.pictures[1].show("hp_bar", 0, 12, 12, 25, 25, 255, 0)
screen.pictures[1].move(0, 10, 10, actorhealth, 25, 255, 0, 60)
end
So the big problem here, is that I feel like the health bar is constantly getting "refreshed" causing it to flicker. And the health bar doesn't move - when the script is like this. However, If I take out the bit that draws the picture from the function - and have it run once, the flickering stops and that's fine - but then then the health bar decides to just start shrinking itself really low, or just stretching so far it goes off screen. And seems to be ignoring the script all together.
If anyone know's what's going on and can help with this - I'd appreciate it.