Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Timer bar

Hi everyone!
  I was wondering if anyone could help me come up with a script that creates a timer bar? Let me elaborate; I want to make a bar that overtime it diminishes, so its like a health bar only it constantly drops. I need it so that certain items will replenish it or even pause it for a short time. So for instance im making a hunger meter, so the hero has to from time to time hunt or purchase food. Any help will be appreciated.

Oh btw im not too keen with this RMXP scripting but im not totally retarded, i do have lots of experience with actionscript, and C++; so feel free to explain where i would put this code, but im sure i'd kno the basics from experience.

Thanks guys!  :thumb:
 

khmp

Sponsor

I think he's asking for code design advice. I would add the hunger functionality to Game_Battler only because that seems to be where items are used and if you have certain items that restore hunger that would be the place to go. On Game_Battler3 near the bottom is the use an item method. You would keep some kind of Constant data to hold the ids of the items that restore hunger and the amount restored like a Hash. I would create a class that derives from Sprite, this will become my hunger meter. Then I would alias main and update of Scene_Map so that my meter is shown and updated every frame.

Good luck with it Thermalburn! :thumb:
 
Thanks khmp! Imma get home and see what i can do. In the meantime, has anyone ever done this? If so, could i maybe barrow your script just to reverse engineer it or implement it into my own? Ill give credit.

Oh ya btw, is there some form of book/publication/internet resource that can help me out with RMXP scripting basics?
 

khmp

Sponsor

I would create a script request for that. I know I helped Kav create one a while ago. But I don't feel right just handing you the script. I wouldn't want Kav angry at me. If there are any particular areas of interest you need help with in creating this script feel free to ask. Otherwise I'd ask for a well documented/commented script in Script Requests.

Good luck with it Thermalburn! :thumb:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top