Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Google, Yandex

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
621
KellieBusb
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Smaug Snippets » Strange overland problem
Forum Rules | Mark all | Recent Posts

Strange overland problem
< Newer Topic :: Older Topic > Overland "bug"?

Pages:<< prev 1 next >>
Post is unread #1 Jan 7, 2005, 3:17 am
Go to the top of the page
Go to the bottom of the page

Thlundar

GroupMembers
Posts13
JoinedJan 7, 2005

Firstly, hi everyone - Samson.

Alright, I've installed the overland snippet and it all works good and I'm perfectly happy with it. I'm down to one last, super frustrating bug. I've been hacking at it for 5 hours and I'm at my wits end, so here goes.

After I save an area (foldarea) and it saves with the slight changes to the file format as prescribed by the snippet I can no longer reload that area. I get ye olde "BUG: Load_objects: # not found.".

I searched around and noticed a couple of other people had had the same problem before, but noone had ever ACTUALLY solved it (publically anyway). So I get to debugging.

Now as you know, the only serious change to the saved areas is that it adds the x and y coordinates to the exit information so you'd figure it would be something to do with this.. I looked at it for a while and tried many things, but not much success.
So I decided to get some more detailed debugging information out of that Load_objects: # not found.

I made it display a line of the text encountered at the file pointer that was being passed through (where it expected the #), and it was 'heal'. Take a look at the area file (newdark.are) at the relevant point...
---
#OBJECTS
#21000
potion violet glowing~
a glowing violet potion~
A glowing violet potion has been carelessly left here.~
~
10 321 1
25 -1 -1 -1
1 3000 6100
'heal' 'NONE' 'NONE'
E
violet~
---
And tell me that isn't freaky. The file pointer has somehow jumped 10 lines from where it should be pointing when load_objects is called!

I'm lost. The only thing I can imagine it might be at this point is a memory leak somewhere in load_mobiles or in load_area_file that noone's ever noticed. It just behaves so strangely.

Maybe someone's encountered this before and you know of a perfectly simple explanation and solution that I'm missing?

Thanks for having a look at this elongated post people,
Thlundar
       
Post is unread #2 Jan 7, 2005, 4:47 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Given that this is the first object in your objects section, and it's saving stuff which may be version related, what area version is being saved into this file? Could you paste in the entire section from the beginning to the #MOBILES header? That may shed some light. I'm at work right now so I can't be 100% sure but I don't recall the code altering the format of objects in the area files at all. Only in the exit data, which you have yet to reach in this file since that's down in the #ROOMS section.
       
Post is unread #3 Jan 7, 2005, 6:34 pm
Go to the top of the page
Go to the bottom of the page

Thlundar

GroupMembers
Posts13
JoinedJan 7, 2005

Yeah, I pored over the area for hours. I even did a diff on the entire #MOBILES section of the new newdark.are and the original newdark.are and they were completely the same. So no changes there. The only changes to the header information is version (up to 2 from 1), the addition of the spelllimit, and of course the continent information. I checked all these fairly thoroughly and tested various combinations with and without them. No success.
---
#AREA New Darkhaven~



#VERSION 2
#AUTHOR Rennard~

#RANGES
0 60 0 60
$

#SPELLLIMIT 0

#RESETMSG The bells of the cathedral toll the passing of time.~

#FLAGS
0

#ECONOMY 0 199846

#CONTINENT Laniatus~

#CLIMATE 2 2 2

#MOBILES
#21000
kala priestess healer~
---

It really is confusing me no end. Thanks for having a look at it.
       
Post is unread #4 Jan 8, 2005, 9:29 pm
Go to the top of the page
Go to the bottom of the page

Thlundar

GroupMembers
Posts13
JoinedJan 7, 2005

Whee, I figured it out finally. Curse those silly smaug coders. I was having trouble sleeping last night, and started thinking about this problem. Just before falling asleep (as so often seems to happen) I realised that the problem must be caused somewhere else in the file loading routines, and that it must be related to the area version.

After a quick CTRL-F in db.c I found this...
if ( area_version == 1 )
{
switch ( pObjIndex->item_type )
{
case ITEM_PILL:
case ITEM_POTION:
case ITEM_SCROLL:
pObjIndex->value[1] = skill_lookup ( fread_word( fp )) ;
pObjIndex->value[2] = skill_lookup ( fread_word( fp )) ;
pObjIndex->value[3] = skill_lookup ( fread_word( fp )) ;
break;
case ITEM_STAFF:
case ITEM_WAND:
pObjIndex->value[3] = skill_lookup ( fread_word( fp )) ;
break;
case ITEM_SALVE:
pObjIndex->value[4] = skill_lookup ( fread_word( fp )) ;
pObjIndex->value[5] = skill_lookup ( fread_word( fp )) ;
break;
}
}

excuse the indenting...
Now my area version used to be 1, now it is 2. I'm sure most of you can see why that totally screwed it up (and it makes sense why it was on a potion it screwed up now).

The quick, easy, obvious fix... change:
if ( area_version == 1 ) to be if (area_version > 0)

Voila, it works. No problems.

Thanks everyone who thought about this problem at all and read the topic. Now hopefully all those other people I've found who have had the same problem can use this easy fix to solve their headaches too.
       
Post is unread #5 Jan 8, 2005, 11:59 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Nice catch. After I looked at the instructions, I noticed that step was left out. It's been corrected.
       
Pages:<< prev 1 next >>