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
➜ Thirst/hunger is gone
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
| Posted by
| Taebryn
(58 posts) Bio
|
| Date
| Reply #15 on Mon 23 Feb 2004 07:12 PM (UTC) |
| Message
| | it seems only hunger is working now, not thirst |
Arthurian MUD in development.
Reign of Arthur
http://arthur.vze.com | | Top |
|
| Posted by
| Taebryn
(58 posts) Bio
|
| Date
| Reply #16 on Wed 25 Feb 2004 07:38 PM (UTC) |
| Message
| to remove the auth for gaining conditions, i did so:
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;
(commenting out the NOT_AUTHED part)
it appears after a few hours of testing, that my players now have hunger, but not thirst
this is the gain condition void for all conditions, so why isn't thirst working?
here is what my case COND_THIRST looks like:
case COND_THIRST:
if ( ch->level < LEVEL_AVATAR && ch->class != CLASS_VAMPIRE )
{
set_char_color( AT_THIRSTY, ch );
send_to_char( "You are really thirsty.\n\r", ch );
worsen_mental_state( ch, 1 );
act( AT_THIRSTY, "$n looks a little parched.", ch, NULL, NULL, TO_ROOM);
}
break;
this is in update.c around line 478
what am i missing |
Arthurian MUD in development.
Reign of Arthur
http://arthur.vze.com | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #17 on Wed 25 Feb 2004 09:29 PM (UTC) Amended on Wed 25 Feb 2004 09:31 PM (UTC) by Nick Gammon
|
| Message
| The issue here is also whether the thirst is increasing (or decreasing) - the part you posted just reports when it is low.
I cannot see anything wrong, and in stock SMAUG you get thirsty, it happens to me all the time.
Is your character an imm, or not? What sort of sector are you in? City or what?
What you need to do is put a breakpoint on gain_condition, and see what is happening to the thirst level.
Here is one approach. I used gdb, and put a breakpoint on gain_condition, and then added a small script to see what was happening to it (was it going up or down?). I note the thirst is gradually going down (ie. he is getting thirsty) however it is quite slow. You might need to be patient to get the thirst message. I put in a "bt" into the script to see where the gain_condition was called from.
I typed this:
break gain_condition if iCond == 2
commands
silent
printf "Gain condition for character %s, amount %i\n", ch->name, value
printf " -- current condition is %i\n", ch->pcdata->condition[iCond]
bt
cont
end
Output
Gain condition for character Nick, amount -1
-- current condition is 44
#0 gain_condition(char_data*, int, int) (ch=0x852b830, iCond=2, value=-1)
at update.c:396
#1 0x0811ae39 in char_update() () at update.c:1076
#2 0x0811c956 in update_handler() () at update.c:2037
#3 0x08098eb5 in game_loop() () at comm.c:735
#4 0x08098613 in main (argc=1, argv=0xbfffe240) at comm.c:304
#5 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6
Gain condition for character Nick, amount -1
-- current condition is 43
#0 gain_condition(char_data*, int, int) (ch=0x852b830, iCond=2, value=-1)
at update.c:396
#1 0x0811ae39 in char_update() () at update.c:1076
#2 0x0811c956 in update_handler() () at update.c:2037
#3 0x08098eb5 in game_loop() () at comm.c:735
#4 0x08098613 in main (argc=1, argv=0xbfffe240) at comm.c:304
#5 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6
Gain condition for character Nick, amount -1
-- current condition is 42
#0 gain_condition(char_data*, int, int) (ch=0x852b830, iCond=2, value=-1)
at update.c:396
#1 0x0811ae39 in char_update() () at update.c:1076
#2 0x0811c956 in update_handler() () at update.c:2037
#3 0x08098eb5 in game_loop() () at comm.c:735
#4 0x08098613 in main (argc=1, argv=0xbfffe240) at comm.c:304
#5 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6
Gain condition for character Nick, amount -1
-- current condition is 41
I would do something like that to see if the condition is changing, is it going up or down, and why.
In about 10 minutes he only went from 44 to 41, so he won't be thirsty for quite a while yet.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Nick Cash
USA (626 posts) Bio
|
| Date
| Reply #18 on Thu 26 Feb 2004 12:06 AM (UTC) |
| Message
| Also, make sure the items they are selling *ARE* food. So, say you had an item named bread. Make sure you do:
oset bread type food
oset bread value0 10
That should be alright, I think. Then again, you may have done this already. Just something to be aware of. |
~Nick Cash
http://www.nick-cash.com | | Top |
|
| Posted by
| Taebryn
(58 posts) Bio
|
| Date
| Reply #19 on Tue 02 Mar 2004 01:58 AM (UTC) |
| Message
| both are working fine, and apparently always were
it seems it just takes a really long time to gain condition |
Arthurian MUD in development.
Reign of Arthur
http://arthur.vze.com | | 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.
66,038 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top