Author Topic: [XP] Hunger/Thirst  (Read 15556 times)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
[XP] Hunger/Thirst
« on: May 14, 2010, 11:54:10 PM »
Hunger & Thirst
Authors: ForeverZer0
Version: 1.1
Type: Party/Actor Add-On
Key Term: Actor Add-on

Introduction

Basically the title says it all. This script will add a Hunger/Thirst dynamic to your game. Actor's hunger/thirst will decrease over time or by stepcount. Has configuration for food/drink items and for states that will be added to actors whose hunger/thirst falls within specified ranges.

Features

  • Easy to use
  • Hunger/Thirst can decrease by time, stepcount, or both.
  • Can have the player's max hunger/thirst capacity increase with levels
  • Easy script offer complet manipulation of system and actors' hunger/thirst
  • Automatically applies states (configurable)
  • Hunger/Thirst recovery can be by either percent or by absolute value

Screenshots

None.

Demo

None.

Script

Click here for the script.
(click to show/hide)

Here is also an Add-On I made for the system. It is a HUD that displays hunger/thirst rates using gradient bars for the party. There are a few instructions in the script, but most are self-explanatory. As of the moment, there are only two styles of bars, but both have fully configurable width, height, gradient colors, etc. I may end up doing more with the Gradient Bars script in the future, but for the moment, it is what it is.

(click to show/hide)


Instructions

Place below default scripts, and above Main.
If Zer0 Add-On Collection is present, place below it.

Compatibility

There is an issue with the Chemist Class Script within Zer0 Add-Ons, but placing this script below it will solve the problem.

Credits and Thanks

  • ForeverZer0, for writing the script.
  • Jragyn, for fixing some issues with the HUD
  • kukusu, for requesting the script.
  • SBR*, for pointing out an error I made.
  • swick, for requesting the HUD.

Author's Notes

Please report any bug/issues you may find, and I'll be happy to fix them.
Enjoy!
« Last Edit: May 31, 2011, 03:34:19 AM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Jragyn

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 20
  • Gender: Male
  • A prodigy... maybe? Hoo hah.
    • View Profile
    • facenbooken.
Re: [XP] Hunger/Thirst
« Reply #1 on: May 15, 2010, 05:24:47 AM »
I feel like I've seen a lot of requests for a script of this nature, so I'm glad to be able to point people in this direction.

Good job, yo.
A bright light can either illuminate or blind, but how will you know which until you open your eyes?

kukusu

  • Guest
Re: [XP] Hunger/Thirst
« Reply #2 on: May 15, 2010, 03:15:33 PM »
Thank you again for making it. It turned out much better than I expected. It's perfect!

And, You put me in the credits!! Thank you!  :D

Offline Magus

  • Astral Trancist
  • *****
  • Posts: 544
  • LV: -21
  • Gender: Male
  • Writer of Destiny
    • View Profile
Re: [XP] Hunger/Thirst
« Reply #3 on: May 20, 2010, 04:09:56 AM »
Hmm... want to try this out so bad :D
Will this thing show like a visual way (for example a bar) that will show us his hunger level eventually.
I'm about to try this thing out.
LEVEL ME DOWN. THE ANTI-BLIZZ GROUP IS AMONG YOU... Do it for the chick below...She watches..<br />

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Hunger/Thirst
« Reply #4 on: May 20, 2010, 04:27:47 AM »
Hmm... want to try this out so bad :D
Will this thing show like a visual way (for example a bar) that will show us his hunger level eventually.
I'm about to try this thing out.

Go here: http://forum.chaos-project.com/index.php/topic,6047.0.html

This was the original post that made me write the script. There is a spoiler in there that uses the bars from Tons to display the hunger/thirst on the menu. You may have to change the x and y of where it displays on the screen.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Holyrapid

  • Astral Trancist
  • *****
  • Posts: 749
  • LV: 0
  • Gender: Male
  • Credit to FreshL on Deviantart
    • View Profile
    • My new Youtube channel!
Re: [XP] Hunger/Thirst
« Reply #5 on: August 30, 2010, 09:12:10 PM »
Sorry for necroing, but i just want to say, that i've been looking for something like this.
Would it be possible to add hunger and thirst indicators to BABS hud? That would be very useful.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Hunger/Thirst
« Reply #6 on: December 12, 2010, 10:42:06 AM »
I added a custom HUD to display the hunger/thirst for party on the map, as per request.

And yes I necro-posted in my own thread. I will do it again, too. I'm just that much of a bad-ass.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

acknowledge101

  • Guest
Re: [XP] Hunger/Thirst
« Reply #7 on: January 20, 2011, 03:30:40 PM »
hi, total noob here to rgss scripting, been working with rm2k3 for years however.  i'm a noob to this board too obviously.

i'm using this hunger/thirst script for my new rmxp project and am very happy with it.  don't worry, giving credit where credit is due of course.

anyway, i'm wondering what the script call would be to disable the hud for cutscenes/etc purely for aesthetic reasons.  i'm thinking it's some kind of true/false call much like toggling the actual system itself, but since i'm a noob and all i don't even know where to begin.

thanks for any and all answers, and thanks for making the script, foreverzero.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Hunger/Thirst
« Reply #8 on: January 20, 2011, 07:10:54 PM »
Actually, you made me realize that not being able to disable the HUD is an oversight of mine.
Here is a fix for it, just place this code below the script anywhere:

Code: [Select]
class Scene_Map
  attr_accessor :hunger_hud
end

You can now change the opacity of the HUD (Scene_Map only) with this script call:
Code: [Select]
$scene.hunger_hud.opacity = 0To turn it back on:
Code: [Select]
$scene.hunger_hud.opacity = 255This is a cheap temporary fix. I will update it sometime here with a built in edit. Thanks for pointing that out, though. I'm glad you like it!  ;)
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

acknowledge101

  • Guest
Re: [XP] Hunger/Thirst
« Reply #9 on: January 22, 2011, 12:14:36 AM »
thanks, but it's not working.  i tried several different methods but i still can't get it to disappear.  even went and tried to learn the basics of ruby to maybe figure out how to do it myself, but nope.  i did figure out how to do a few other things in the process however.  at least the code's not looking like a foreign language like it was before.

anyway, don't worry about it for now though, i'll just wait till you update the script with the permanent fix.

Offline megaman30796

  • Transcended Spirit
  • ***
  • Posts: 227
  • LV: -60
  • Gender: Male
  • BEST TOILET EVER!!!!
    • View Profile
    • 99% Loading
Re: [XP] Hunger/Thirst
« Reply #10 on: January 28, 2011, 05:23:22 PM »
do the hunger/thirst hud work with custom huds?
"You know the world is going crazy," Chris Rock declared in 2003, "when the best rapper [Eminem] is a white guy, the best golfer [Tiger Woods] is a black guy, the tallest guy in the NBA [Yao Ming] is Chinese, the Swiss hold the America's Cup, France is accusing the U.S. of arrogance, Germany doesn't want to go to war, and the three most powerful men in America are named 'Bush,' 'Dick,' and 'Colon.' Need I say more?"

wethefallen

  • Guest
Re: [XP] Hunger/Thirst
« Reply #11 on: June 04, 2012, 01:34:32 AM »
Im having a glitch when using atoas acbs (with atb) with the hunger thirst plugin, ( http://www.hbgames.org/forums/viewtopic.php?f=11&t=62914 ), It seems to fight it out with the Atoa Game_Battler class, If the hunger script is above it, I can remove the states normally, but not add to regen the hunger counter, if below, i can add hunger but not remove states via items. Used Items not called out via that script work fine. Since ive already put a lot of work into using the battle system it is much higher priority, i was trying to figure out how to make the hunger script compliant with set_item_state_change in atoa, but im having trouble figuring it out on my own. Any suggestions?

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Hunger/Thirst
« Reply #12 on: June 04, 2012, 04:10:35 AM »
Sounds like you have IDs for states conflicting with one another.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline kmart002

  • Trained Member
  • *
  • Posts: 13
  • LV: 0
    • View Profile
Re: [XP] Hunger/Thirst
« Reply #13 on: November 08, 2012, 02:09:45 AM »
Hey I love your script, but I don't know where to put the HUD cause I already have a different HUD. Could it maybe be a stat instead of a bar? I have this script that allows switching on the party leader, could you make the hunger/thirst bar for only the party leader instead of the whole party? Either way works.