Charas-Project
Game Creation => Requests => Tutorials => Topic started by: Roland_Deschain on November 17, 2008, 12:20:53 AM
-
I can get the system to work properly, hits register, enemies don't kill you fast or drain health constantly, but my main problem is the health bar. I'm using a frame to set up the HUD, and using pictures for the different sections of the bar. My problem is, the game lags EXCESSIVELY if I have more than 5 pictures on screen at a time, although they all show up, it's virtually unplayable. Is there an easier way to do this with a frame as the HUD setup?
-
Simple solution, put "wait 0.0s" BEFORE EVERY "show image" command. That should take care of it. Also make sure you erase the previous pic before you put the show next pic, at least thats what works for my abs.
Edit: You don't have to do that last part, it just makes it run a little cleaner I think. But putting a wait always fixes the lag problem. I don't know why...
-
It does that because rpg maker was programmed poorly. If you don't put the wait 0.0 seconds, rpg maker tries displaying the pictures as fast as it can, which slows down the whole program. The wait 0.0 seconds won't be noticable on the users end, but it'll prevent rpg maker from trying to display these pictures rapidly.
Another tip to reduce lag is to limit the amount of parallel process events you use. The less there are the smoother your game will run. There are ways to make an ABS with only 1 parallel process event ;) though that might be a little too over the edge.
-
It only has 2, one for the health setup and one for the CMS teleporting.
-
It only has 2, one for the health setup and one for the CMS teleporting.
Oh, so the enemy events themselves take care of all the attacking and damage stuff?
-
Yeah. It may not be the best way to set it up but the combat works surprisingly well.
-
Nah, its an okay way to set it up, the only problem with that is if you decide to modify the code in those events, you'll have to edit all of the events or start over with new ones.
-
Well I have a template enemy set up, all I need to do in the event of an overhaul is fix it's coding, delete all the other enemies, and repaste template man everywhere, fixing graphic and variables. The bosses would ~SUCK~ to recode though.
-
Sorry to doublepost, but I need a bit more help on this topic. I can't get my pictures to show up anymore. Here's the coding I use now:
(http://i423.photobucket.com/albums/pp311/Roland_Deschain2/Coding.jpg)
It works as far as dying goes, but the health no longer appears on the screen anymore.
-
Maybe instead of using the same 2 pics over in different places, make many pictures representing what health you would have. For example, say you make a box with your transparent color just blank and call that 0. Then put the half heart in the place where it should be, then name it .5, then make the whole heart, name it 1, etc, etc. That way you can keep the same picture number, just change the actual picuture that is show. That way you're not showing a bunch of pics, instead you're always showing 1 pic. I hope that wasn't too confusing, here is what my code looks like that is pretty much what I just described
(http://img.photobucket.com/albums/v349/Macangy/f1751d1a.png)
-
Working now, thanks. And it worked with my last set of code, like displaying the pictures and all, but damage never registered. >_<