[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Load_rooms
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Load_rooms

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


Posted by USER007   (124 posts)  [Biography] 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?
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] 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
[Go to top] top

Posted by USER007   (124 posts)  [Biography] 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?
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] 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
[Go to top] top

Posted by USER007   (124 posts)  [Biography] 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.
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] 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
[Go to top] top

Posted by Mirro   (2 posts)  [Biography] 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
[Go to top] top

Posted by USER007   (124 posts)  [Biography] 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.
[Go to top] 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.


5,440 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]