Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Load_rooms

Load_rooms

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by USER007   (124 posts)  Bio
Date Thu 27 Jan 2005 01:18 AM (UTC)

Amended on Thu 27 Jan 2005 01:27 AM (UTC) by USER007

Message
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?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Thu 27 Jan 2005 04:11 AM (UTC)
Message
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.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by USER007   (124 posts)  Bio
Date Reply #2 on Fri 28 Jan 2005 12:11 AM (UTC)
Message
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?
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #3 on Fri 28 Jan 2005 06:51 AM (UTC)
Message
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.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by USER007   (124 posts)  Bio
Date Reply #4 on Fri 28 Jan 2005 07:33 PM (UTC)

Amended on Fri 28 Jan 2005 08:02 PM (UTC) by USER007

Message
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.
Top

Posted by Nick Cash   USA  (626 posts)  Bio
Date Reply #5 on Fri 28 Jan 2005 10:04 PM (UTC)
Message
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

~Nick Cash
http://www.nick-cash.com
Top

Posted by Mirro   (2 posts)  Bio
Date Reply #6 on Sat 05 Feb 2005 09:01 AM (UTC)
Message
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
Top

Posted by USER007   (124 posts)  Bio
Date Reply #7 on Sat 05 Feb 2005 07:08 PM (UTC)
Message
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.
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.


21,949 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.