Load_rooms

Posted by USER007 on Thu 27 Jan 2005 01:18 AM — 8 posts, 31,561 views.

#0
After adding a new set of rooms flags I've been having some loading problems when I use hotboot/reboot.

In 'load_rooms'

	int x1, x2, x3, x4, x5, x6, x7;

More below...

	ln = fread_line( fp );
	x1=x2=x3=x4=x5=x6=x7=0;
	sscanf( ln, "%d %d %d %d %d %d %d",
	      &x1, &x2, &x3, &x4, &x5, &x6, &x7 );

	pRoomIndex->room_flags		= x2;
	pRoomIndex->sector_type		= x3;
	pRoomIndex->room_flags2 	= x4;
	pRoomIndex->tele_delay		= x5;
	pRoomIndex->tele_vnum		= x6;
	pRoomIndex->tunnel		= x7;


At first "pRoomIndex->room_flags2 = x4;" was x7, it would save, but it wouldn't load so I switched it with tunnel, so now room_flags2 load/save but tunnel load doesn't. I've looked at the area files and it does save pRoomIndex->tunnel

Here's what I've been doing:

Build: Anavel: redit tunnel 5
Done.

rstat
Vnum: 10300 Sector: 0 (Inside) Light: 0 Tunnel: 5
Room flags: nomob indoors teleshowdesc
Room flags2:

Area file:
incase you get below
20% of your health. To the north is a low level mob for you to kill and gain some XP.
~
0 1048588 0 0 1 5 0
D0
Exit description

I found Zeno's thread about his similiar problem, but it didn't help me. Any other help?
Amended on Thu 27 Jan 2005 01:27 AM by USER007
USA #1
You'll have to use the AREA_VERSION resolution to solve this. The area has no section for the new flags, and they don't "update" like pfiles. My old thread should work.
#2
I tried the area version way, but I still doesn't load the flags even though it saves them still. Heres what I have in load_rooms:

if( AREA_VERSION_WRITE >= 5 )
	{
	 ln = fread_line( fp );
	 x1=x2=x3=x4=x5=x6=x7=0;
	 sscanf( ln, "%d %d %d %d %d %d %d",
	       &x1, &x2, &x3, &x4, &x5, &x6, &x7 );

	  pRoomIndex->room_flags	= x2;
	  pRoomIndex->sector_type	= x3;
	  pRoomIndex->tele_delay	= x4;
	  pRoomIndex->tunnel		= x5;
	  pRoomIndex->tele_vnum		= x6;
	  pRoomIndex->room_flags2 	= x7;
         }
         else
         {
	  ln = fread_line( fp );
	  x1=x2=x3=x4=x5=x6=0;
	  sscanf( ln, "%d %d %d %d %d %d",
	        &x1, &x2, &x3, &x4, &x5, &x6 );

	  pRoomIndex->room_flags	= x2;
	  pRoomIndex->sector_type	= x3;
	  pRoomIndex->tele_delay	= x4;
	  pRoomIndex->tunnel		= x5;
	  pRoomIndex->tele_vnum		= x6;
	}


Area file:
#VERSION 5
#AUTHOR Anavel~

I changed the order of "pRoomIndex->" to how it was originally, so now room_flags2 saves, but doesn't load; the rest save/load with hotboot/reboot. What am I doing wrong?
Canada #3
Are room flags defined as integers, or are they EXT_BV? Either way, its probably easies to make room_flags EXT_BV and have 4 fields work in one than to add another field.
#4
Yeah their in integer form, I'll try and see if I can convert them to EXT_BV.

=EDIT= Nvm, I found 3 room_flags being unused and since I only needed 2 extra slots I removed those.
Amended on Fri 28 Jan 2005 08:02 PM by USER007
USA #5
I think the best solution would be to undo the changes and try again. This can be an adaquete solution for elusive problems like this. I know when I was doing stuff like this, the best thing was to modify the save code, load and save all of the areas to the new format, then add the loading code. Doing it all at once tends to screw some things up. :P
#6
First what kinda of error are you getting is the mud crashing when trying to load the room or is it just not loading the flags and are you sure it's saving the flags i.e. have you checked the area files for the area you tested it in ?

ln = fread_line( fp );
x1=x2=x3=x4=x5=x6=x7=0;
sscanf( ln, "%d %d %d %d %d %d %d ",
      &x1, &x2, &x3, &x4, &x5, &x6, &x7);

	pRoomIndex->room_flags		= x2;
	pRoomIndex->sector_type		= x3;
	pRoomIndex->extra_room_flags = x4;
	pRoomIndex->tele_delay		= x5;
	pRoomIndex->tele_vnum		= x6;
	pRoomIndex->tunnel		= x7;


That's part of what I did.. but, I however had issues with the versioning So, I didn't.

-Mirro
#7
At first it would save, but not load. I tryed building but the MUD would crash when I would use goto my area. It gave me an error something about this: build.c around line 300, something about flag arrays. So I took out the room_flags2 out and removed 3 room flags that weren't being used.