| Tutorial: | Anti-Lag HUD |
| Difficulty: | Beginner |
| RPG Maker: | 2000/2003 |
| Author: | kdb424 |
ANTI LAG HUD SYSTEM!
MADE BY KDB424
Ok. Almost EVERY hud tutorial told you how to make a hud. Some better than others. Some hard to make, some easy. But the problem was, that they all lagged! I am going to explain gow to make a simple, yet very effective anti lag hud with hearts. This can be transfered very easily to anything else, but hearts is my example.
We will need 2 variables. Hero hearts \v[0001], and hearts check \v[0002]
Make a common event, parallel process, no trigger switch, Name it "Hearts update"
Fork condition
If \v[0001] hero health not = \v[0002] hearts check then
call event: Update HUD
end
The event update is a common event, parallel process, that updates the pictures. The common event that I will now show, is the only part most tutorials have, the hud system itself.
Make a common event, CALL EVENT (not parallel process like most tuts), Name it "Update HUD"
Fork Condition
If \v[0001] Hero hearts = 3
Show picture 3 hearts (I suggest X=100, Y=30)
Variable operations: Set hearts check = hero hearts
else
If \v[0001] Hero hearts = 2
Show picture 2 hearts (I suggest X=100, Y=30)
Variable operations: Set hearts check = hero hearts
else
If \v[0001] Hero hearts = 1
Show picture 1 hearts (I suggest X=100, Y=30)
Variable operations: Set hearts check = hero hearts
end
wait 0.0
That's it! You are done. Now I will explain why it does not lag! One common event checks to see if your hearts have changed, if not, it does not call the hud update, which lags if placed on it's own without a small wait command at the end of the code! The first event keeps the second from lagging the game if the second event can't prevent its own lag. It's that simple. Hearts can go up to whatever number. I just used 3 for this tut! You could even break the hearts into quarter heart damage with some thinking!
Click to Return to the Tutorials Page