11 Oct, 2008, Igabod wrote in the 1st comment:
Votes: 0
i'm trying to add an area into a rom derivative called KeggerMUD and i get this error message:

Sat Oct 11 00:58:46 2008 :: Loading area animal.are
Sat Oct 11 00:58:46 2008 :: [*****] FILE: animal.are LINE: 903
Sat Oct 11 00:58:46 2008 :: [*****] BUG: CHECK_POS : liq_lookup == -1 < 0
Sat Oct 11 00:58:46 2008 :: [*****] FILE: animal.are LINE: 911
Sat Oct 11 00:58:46 2008 :: [*****] BUG: CHECK_POS : liq_lookup == -1 < 0
Sat Oct 11 00:58:46 2008 :: [*****] FILE: animal.are LINE: 1866
Sat Oct 11 00:58:46 2008 :: [*****] BUG: CHECK_POS : item_type == -1 < 0
Sat Oct 11 00:58:46 2008 :: [*****] FILE: animal.are LINE: 3078
Sat Oct 11 00:58:46 2008 :: [*****] BUG: Fread_string: MAX_STRING 1413120 exceed
ed.


i'm not really sure what the problem is here, but here are the lines mentioned in the bug messages.

903
#5632
vodka~
a shot-glass of vodka~
A shot-glass of vodka sits here. ~
nothingness~
drink 0 AO
1 1 'chill touch' 0 0
-4 1 -400 P

911
#5633
wine~
a glass of wine~
A glass of wine- a fine chianti- sits here. ~
nothingness~
drink 0 AO
1 1 'wine' 0 0
-4 2 -400 P

1866
#5728
brick~
a brick~
Someone has left a brick here. ***>!OUCH!<*** You stub your toe! ~
nothingness~
'ale' 0 ANO
0 0 0 0 0
-4 5 -400 P

3078
#5686
Stairway~
These steps lead up into the merloned tower you saw outside the castle. A sign $
0 D 0
D0
guard room~
~
0 -1 5680
D2
heifer's room~
~
0 -1 5682
D4
stairwell~
~
0 -1 5698
E
sign~
The sign reads- This Tower is the home of Wizard Owl. Visitors welcome, but ple$
S

i'm definately not very knowledgeable when it comes to the setup of area files so if someone more knowledgeable could help that'd be great.
11 Oct, 2008, quixadhal wrote in the 2nd comment:
Votes: 0
No idea on that particular derivative, but the lookups being -1 means it failed to find a result for the lookup attempt. So whatever liquid type you're trying to add in the area file doesn't exist in the code. MAX_STRING exceeded means exactly that, you've used more string memory than the internal shared string system can handle. I believe there's a constant you can raise if you need to. 1.4M used to be a lot of memory. :)
11 Oct, 2008, Igabod wrote in the 3rd comment:
Votes: 0
ok so which part of the object points to the liquid type? i'll just switch it out for a similar liquid type. as for the MAX_STRING, where do i change this? i did a search in merc.h and found several mentions of MAX_STRING_LENGTH, one of which is #define MAX_STRING_LENGTH 4608 is this what i need to change or is it something else?

[edit] nevermind the max_string thing, found the define for that in db.c but when i changed it to 2 million i get this message:

Sat Oct 11 03:04:34 2008 :: [*****] BUG: Fread_number: bad format.


what should i change it to for it to be good format?
11 Oct, 2008, The_Fury wrote in the 4th comment:
Votes: 0
Igabod said:
ok so which part of the object points to the liquid type? i'll just switch it out for a similar liquid type. as for the MAX_STRING, where do i change this? i did a search in merc.h and found several mentions of MAX_STRING_LENGTH, one of which is #define MAX_STRING_LENGTH 4608 is this what i need to change or is it something else?

[edit] nevermind the max_string thing, found the define for that in db.c but when i changed it to 2 million i get this message:

Sat Oct 11 03:04:34 2008 :: [*****] BUG: Fread_number: bad format.


what should i change it to for it to be good format?


MAX_STRING_LENGTH should be in multiples of 1024 setting it to 2million will mean that every time memory is allocated to store a string is will reserve 2Megs of memory, anything over 8K is really not needed.

The Fread_number bug, do you understand what is happening here? fread_number means file read number, IE: it is a function that is used to read a number into memory from a file. If you are getting bad formats bugs from it, generally there is an error in your area file and it is attempting to read a character in instead of a number.
11 Oct, 2008, Igabod wrote in the 5th comment:
Votes: 0
i set the MAX_STRING define in db.c to 2000000, it was originally set to 1413120 there should be no characters it's trying to read as numbers. i changed the MAX_STRING to 2 mil because i was getting the error message saying MAX_STRING was exceeded. i just need to know what the 2 mil needs to be changed into for it to work correctly.
11 Oct, 2008, MacGregor wrote in the 6th comment:
Votes: 0
Okay, something is wrong with animal.are. The error on line 903 is because 'chill touch' is not a valid liquid type.
I'm not sure what the problem is with #5633, the glass of vodka.
The problem with the brick is that 'ale' is not a valid object type.

I suggest taking animal.are and trying to load it into whatever codebase it originally came from, just to ensure the area file didn't get scrambled somehow, because it sure looks like it may have. Where did it come from, by the way?

As for your last error, fread_number: bad format, that means the mud is expecting to read a number and is finding something other than a number. This usually means that the area file is out of sync with what the mud is expecting; the area file has an extra field somewhere or is missing a field that the mud expects. Another cause of this is that a string is missing a tilde at the end.

One suggestion is to run the mud under gdb, set a breakpoint on bug(), go to the stack frame where the error is being detected (or possibly the one above that), inspect what was actually read versus what the mud was expecting to read and take it from there. Another, more tedious way, is to read through load_objects() line by line, with the area file in front of you, matching the fields in the area file as they're read by the function.
11 Oct, 2008, Igabod wrote in the 7th comment:
Votes: 0
thank you for the info, i'm probably just gonna forego the installation of this area and skip all the extra work. thanks for educating me though.
11 Oct, 2008, MacGregor wrote in the 8th comment:
Votes: 0
Let's not confuse MAX_STRING with MAX_STRING_LENGTH here. MAX_STRING is the total amount of string space to be set aside for all strings to be read into at boot time. MAX_STRING_LENGTH is the maximum length that any single string may be (not strictly true but close enough). Incidentally there's no particular reason why MAX_STRING_LENGTH should be a multiple of 1024.

The "proper" setting for MAX_STRING is whatever value is sufficiently large enough to allow the mud to boot, yet not be so large that you have to pay your mud hosting provider to increase your RAM allotment. The 'memory' command will tell you how much string space you're using and what the max is, but you (should) already know what the max is set to; if current usage is close to the max it's time to set the max higher (or rewrite your string allocation stuff so as not to need it). As a practical matter, setting it to 4 or 5 meg should be way more than enough for any mud reasonably close to stock area-wise. Stock ROM cuts it pretty close:
Strings 17058 strings of 1314667 bytes (max 1413120).
11 Oct, 2008, Igabod wrote in the 9th comment:
Votes: 0
ok then why was i getting a bad format error when i switched that number to 2 million? it only gave me that message when i switched the number and tried to boot the mud with that area in the area.lst file. when the MAX_STRING is set to 1413120 and that area is not on area.lst the mud starts up with no problem. when max_string is set to 1413120 and that area IS in area.lst i get the BUG: Fread_string: MAX_STRING 1413120 exceeded message. i'm not gonna use that area after all but i'd still like to know the answer for future reference.
11 Oct, 2008, MacGregor wrote in the 10th comment:
Votes: 0
One explanation for this would be because with MAX_STRING set to 2000000 (or more) the mud is now happy with whatever was causing it to exceed 1413120 before but now is barfing on reading a non-numeric where it was expecting a number. You had been getting the "MAX_STRING exceeded" before he reached the bad number in the file. Try setting MAX_STRING to 2000000, recompile, take animal.are out of area.lst, and see if the mud boots; I'd be very very surprised if it did not.
12 Oct, 2008, Igabod wrote in the 11th comment:
Votes: 0
ok that makes sense to me now, thank you for clearing that up for me. it did work by the way, thanks.
0.0/11