@Jestereir, why are you posting in this thread, if you're using an event command? This is for script support, not event support.
I have solved it. Somehow I was drawing it everytime, so they are repeated throughout the window. Reason being I am creating the window with multiple instances instead of one. Anyway, I have another problem, which I don't know why this is making the map causing a lag.
class Window_ActorHUD < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, fitting_height(1)) refresh end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 340 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear draw_actor_face($game_party.members[0], x, -30) draw_actor_health($game_party.members[0], 100, -5, 150) end #-------------------------------------------------------------------------- # * Draw HP #-------------------------------------------------------------------------- def draw_actor_health(actor, x, y, width = 124) draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2) end endclass Scene_Map < Scene_Base alias milena_start start alias milena_update update alias milena_terminate terminate #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start milena_start @actor_hud = Window_ActorHUD.new end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate milena_terminate end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update @actor_hud.refresh milena_update endendAs far as I know this is the correct way to orchestrate this, but why is it making my map lag?
@Shaz
I wasn't too sure where to go for help, haha-- So sorry about that
@Another Fen
I tried that script, but it made another error. Though I created a new projects and pasted all the scripts and stuff that I have on the original file, and it works fine!
Thanks so much for the help though--
@Jestereir:
The script itself won't fix any error, I was just hoping for a more detailed error message.
Anyway, if you could get rid of your problem without losing to much of your work that's glad to hear. 🙂 .
(btw: did the error only occur for one specifiic savestate or for all?)
@Milena:
As a general rule, try to use bitmap manipulation commands sparingly (especially set_pixel and draw_text). Instead of redrawing a bitmap continuously, you could try to refresh it only when necessary.
So what is the better way of implementing this?
I mean if I remove the refresh method, it would not refresh in the map and thus only when I go to another scene will I be able to see the changes of the hud. Are there things that could be a mistake in my draw methods that makes this wrong?
I just discovered that the problem is in my draw_actor_face method. It makes the Map lag. Anything wrong with drawing faces in the map just like what I did?
@Shuji: you mean the 'C' at "CTRL: Optimize equipment" ?? I had this several times too, I change the font size a bit higher and it doesn't cut off then, maybe try this.
If you look it cuts off also the numbers in the stats, and other words. Anyway even changing the font size the result is the same :/
@Another Fen
Well, the error that showed was part of your code instead orz--
As for the savestate-- the error only popped up when I accessed the save event? then it's appear-- I've no idea why though orz
@Shuji
Try to install Mithran's Text Cache script. That tends to fix these display errors for custom font types and even speeds up text processing.
@Milena
It is not the draw_actor_face which kills the FPS. It is the refresh method called constantly, even when you don't need it.
Do not put anything in the update methods without a condition attached to it, or else the FPS will be lowered.
You should first get to know when the refresh method needs to be called, as you surely don't need to redraw everything in every single frame. I suppose it is only needed when the actor's HP has been changed. So, depending on when the HP can be changed, you can drop the window's refresh method there instead of doing it in the update method.
Changing the font worked xD
Thank you so much^^
One question, is there a way to change the character sprite (current, leader) in map when I press a certain key then turns back to the old sprite when I release the key?
Is there a way to determine the number of that enemy in the troop? For example, I have a troop of 4 slimes. What I wanted to know is if its possible to know who the 4th one is on the troop. I want to have the actor not able to target the 4th ones and above in the troop. They can and only should be able to attack the 1st, 2nd and 3rd enemy on the troop...and once they die, they can then attack the 4th onwards.