Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ How to stop the need for food and water
How to stop the need for food and water
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Rob Harper
(108 posts) Bio
|
Date
| Thu 26 Jun 2003 06:23 AM (UTC) |
Message
| Hey..well as the subject says I was wondering how do I kill the need for mortals to eat and drink. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Thu 26 Jun 2003 07:29 AM (UTC) |
Message
| |
Posted by
| Rob Harper
(108 posts) Bio
|
Date
| Reply #2 on Thu 26 Jun 2003 07:43 AM (UTC) |
Message
| ...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. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #3 on Fri 27 Jun 2003 01:06 AM (UTC) Amended on Fri 27 Jun 2003 01:07 AM (UTC) by Nick Gammon
|
Message
| For a start, in update.c is a function gain_condition which seems to control getting hungry, thirsty etc.:
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";
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Gregar
(20 posts) Bio
|
Date
| Reply #4 on Sun 21 Dec 2003 06:46 AM (UTC) |
Message
| 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 | Top |
|
Posted by
| Gregar
(20 posts) Bio
|
Date
| Reply #5 on Sun 21 Dec 2003 09:07 AM (UTC) |
Message
| 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. | Top |
|
Posted by
| halkeye
Canada (28 posts) Bio
|
Date
| Reply #6 on Sun 21 Dec 2003 09:11 AM (UTC) |
Message
| 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.
|
Gavin
Dark Warriors - Coder
http://darkwars.wolfpaw.net
telnet://darkwars.wolfpaw.net:4848 | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
22,890 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top