Hey..well as the subject says I was wondering how do I kill the need for mortals to eat and drink.
How to stop the need for food and water
Posted by Rob Harper on Thu 26 Jun 2003 06:23 AM — 7 posts, 30,141 views.
This was asked before, see this post:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=812
If that doesn't give enough detail, post again.
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=812
If that doesn't give enough detail, post again.
...ahh thanks for the help..but do you mind leading me a little more in the right direction for hunger, and thirst...and apprearently sleep.
For a start, in update.c is a function gain_condition which seems to control getting hungry, thirsty etc.:
It appears that immortals, mobs, and unauthorised characters do not suffer from these conditions. You could simply replace the conditional test with a simple "return". ie.
Change the "if ( blah blah) return" to just "return";
void gain_condition( CHAR_DATA *ch, int iCond, int value )
{
int condition;
ch_ret retcode = rNONE;
if ( value == 0 || IS_NPC(ch) || ch->level >=
LEVEL_IMMORTAL || NOT_AUTHED(ch))
return;
...
It appears that immortals, mobs, and unauthorised characters do not suffer from these conditions. You could simply replace the conditional test with a simple "return". ie.
Change the "if ( blah blah) return" to just "return";
Hunger, again. Heh
In gain_condition, I see this snippet referred to in your post Nick, but looking into it further, I also see that recovery from being drunk is included as part of gain hunger/thirst.
So, if I am reading it correctly, ending the if call at level would cease you from getting hungry, but it would also prevent you from a natural recovery from being drunk.
It kind of works both ways, removes 1 on a tick for hunger/thirst, adds 1 on the same tick to make you less drunk.
This seems to be a recurring question for Smaug as well as some time functions, but noone has laid out a clear cut answer to either. I have looked at this code fourty seven different ways, and tried many different combinations of tweaking to reach some type of balance. My best solution to it was to edit the race files to reflect thresholds for hunger/thirst by race, making them all never hungry/thirsty. The best fix for Smaug 1.4a seems to be removing all of the gain function except for drunken state gains. IE; if drunk do x, and leave out all the hunger/thirst probablities altogether.
A reminder however, is to adjust potion/pills/food/drink so they do not add to the characters stomach contents.
If anyone has come up with a better way to address this, I would sure be interested in hearing it.
Gregar
In gain_condition, I see this snippet referred to in your post Nick, but looking into it further, I also see that recovery from being drunk is included as part of gain hunger/thirst.
So, if I am reading it correctly, ending the if call at level would cease you from getting hungry, but it would also prevent you from a natural recovery from being drunk.
It kind of works both ways, removes 1 on a tick for hunger/thirst, adds 1 on the same tick to make you less drunk.
This seems to be a recurring question for Smaug as well as some time functions, but noone has laid out a clear cut answer to either. I have looked at this code fourty seven different ways, and tried many different combinations of tweaking to reach some type of balance. My best solution to it was to edit the race files to reflect thresholds for hunger/thirst by race, making them all never hungry/thirsty. The best fix for Smaug 1.4a seems to be removing all of the gain function except for drunken state gains. IE; if drunk do x, and leave out all the hunger/thirst probablities altogether.
A reminder however, is to adjust potion/pills/food/drink so they do not add to the characters stomach contents.
If anyone has come up with a better way to address this, I would sure be interested in hearing it.
Gregar
So here's how I solved the problem completely.
In update.c find
void char_update( void )
gain_condition( ch, COND_FULL, -1 + race_table[ch->race]- >hunger_mod );
And changed it to
gain_condition( ch, COND_FULL, +2 + race_table[ch->race]->hunger_mod );
The original called for a -1 plus race mods, causing the character to get hungry, where my adjustment makes the character get full based on race mods. Similiar changes to COND_THIRST also. There are also some condition changes depending on the climate of your areas, so those need to be checked also, as long as you are showing a consistent gain, you can play with these numbers to get your desired results.
Removed the messaging for being full, sloshing stomach ect, and made our potions/pills not add to hunger and it works great. You could clean up your code by removing the calls for dying of thirst/starvation ect entirely, or leave them intact in case you decide to go back to force feeding in the future.
So, I am done with hunger/thirst, I am sure I will be back with something else soon.
In update.c find
void char_update( void )
gain_condition( ch, COND_FULL, -1 + race_table[ch->race]- >hunger_mod );
And changed it to
gain_condition( ch, COND_FULL, +2 + race_table[ch->race]->hunger_mod );
The original called for a -1 plus race mods, causing the character to get hungry, where my adjustment makes the character get full based on race mods. Similiar changes to COND_THIRST also. There are also some condition changes depending on the climate of your areas, so those need to be checked also, as long as you are showing a consistent gain, you can play with these numbers to get your desired results.
Removed the messaging for being full, sloshing stomach ect, and made our potions/pills not add to hunger and it works great. You could clean up your code by removing the calls for dying of thirst/starvation ect entirely, or leave them intact in case you decide to go back to force feeding in the future.
So, I am done with hunger/thirst, I am sure I will be back with something else soon.
easist way.
void gain_condition( CHAR_DATA *ch, int iCond, int value )
{
if (iCond == COND_THIRST || iCond == COND_HUNGER) {
if (ch->pcdata)
{
ch->pcdata->condition[iCond] = 100;
return;
}
....
Best way would simply be to go through update.c and remove all the gain_conditions. remove the eat and drink stuff..
But if you were todo that. why would you care about the drunkness? just remove it all.
void gain_condition( CHAR_DATA *ch, int iCond, int value )
{
if (iCond == COND_THIRST || iCond == COND_HUNGER) {
if (ch->pcdata)
{
ch->pcdata->condition[iCond] = 100;
return;
}
....
Best way would simply be to go through update.c and remove all the gain_conditions. remove the eat and drink stuff..
But if you were todo that. why would you care about the drunkness? just remove it all.