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, confirm your email, resolve issues, 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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ add new sector type

add new sector type

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


Pages: 1 2  

Posted by De Martino   Italy  (54 posts)  Bio
Date Thu 15 Jul 2004 11:49 PM (UTC)
Message
Hi!
I desire to add new sector type in my smaugfuss
I desire to insert up to 39 sectors type. How can do it ?
Thanks

:)

De Martino
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 16 Jul 2004 03:19 AM (UTC)
Message
Do you really need that many?

At present sector_type is a sh_int, which is 16 bits, and 15 are used. So, you would need to make it a long int to get 32 bits, which is still short of 39 (but close).

If you really want more than 32 you would need to use the extended bitvectors to fit more bits in.

eg. Change:

sh_int sector_type;

to

EXT_BV sector_type;

However then you would need to change the places that refer to sector types, change the load/save routines and so on.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by De Martino   Italy  (54 posts)  Bio
Date Reply #2 on Fri 16 Jul 2004 08:43 AM (UTC)

Amended on Fri 16 Jul 2004 08:48 AM (UTC) by De Martino

Message
Nick I have not understood, can you tell me even more?'
I don't find this string: sh_int sector_type

"change the load/save" as?
Would I need an explanation footstep footstep, possible?

De Martino
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #3 on Fri 16 Jul 2004 12:30 PM (UTC)
Message
Why would he need to change the load/save types? sector_type is only a valid field in ROOM_INDEX_DATA and is not treated as a bitvector in the code. So a sh_int is plenty of room to hold up to 32767 sectors. 39 will be no problem whatsoever.

The BV_SECT_ values are only defined in mud.h and are not referenced anywhere in the 1.4a code. The intention was apparent, but it hasn't been followed through on and likely won't ever be officially since Smaug 2.0 has been shelved.
Top

Posted by De Martino   Italy  (54 posts)  Bio
Date Reply #4 on Fri 16 Jul 2004 01:41 PM (UTC)

Amended on Fri 16 Jul 2004 01:49 PM (UTC) by De Martino

Message
Samson I don't use smaug 1.4a but smaugfuss, in my code I don't find
BV_SECT.

:\

De Martino
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #5 on Fri 16 Jul 2004 03:40 PM (UTC)
Message
The values are there, but that's not what you need anyway. The list where SECT_INSIDE is located is what you want to edit.
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #6 on Fri 16 Jul 2004 05:24 PM (UTC)
Message
You also need to change 3 arrays in act_move.c. They are near the top:

char * const sect_names[SECT_MAX][2]
const int sent_total[SECT_MAX]
char * const room_sents[SECT_MAX][25]

Nobody ever expects the spanish inquisition!

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

Posted by De Martino   Italy  (54 posts)  Bio
Date Reply #7 on Fri 16 Jul 2004 05:57 PM (UTC)
Message
I desire at least to have 32 sectors type
as I have to change these arrayses:

char * const sect_names[SECT_MAX][2]
const int sent_total[SECT_MAX]
char * const room_sents[SECT_MAX][25]

As?
Thanks Greven

De Martino
Top

Posted by Mike Scherling   USA  (20 posts)  Bio
Date Reply #8 on Fri 16 Jul 2004 07:39 PM (UTC)
Message
you have to adjust those 2 numbers, [2] and [25] to what you need them to be, count up your sectors your adding and replace the total number over those two

The source is all around us...
in the food you eat...
in the air you breath...
in your tooth... yes, your tooth...
any questions?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #9 on Fri 16 Jul 2004 10:18 PM (UTC)
Message
Sorry, I got confused by this code:


/*
 * New bit values for sector types.  Code by Mystaric
 */
 #define BVSECT_INSIDE 			BV00
 #define BVSECT_CITY 			BV01
 #define BVSECT_FIELD 			BV02
 #define BVSECT_FOREST 			BV03

... and so on


Of course, something cannot be inside and also outside, so the bits are not being used in that way.

Perhaps get rid of that, Samson, it is just confusing?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #10 on Sat 17 Jul 2004 04:35 AM (UTC)
Message
Yeah. As I said, those BV_SECT values are never even used, so I guess they may as well be taken out to avoid confusion.
Top

Posted by De Martino   Italy  (54 posts)  Bio
Date Reply #11 on Sat 17 Jul 2004 09:11 AM (UTC)

Amended on Sat 17 Jul 2004 02:51 PM (UTC) by De Martino

Message
Quote:
Mike Scherling

writes:
you have to adjust those 2 numbers, [2] and [25]


Dear Mike I desire to have 39 sectors type, change
the two numbers [2] and [25]--> in [2] and [39]?
How do I have to do?

De Martino
Top

Posted by De Martino   Italy  (54 posts)  Bio
Date Reply #12 on Sat 17 Jul 2004 02:40 PM (UTC)
Message
i've defined the sector in "typedef enum {..} sector_types;", in mud.h, but i get the same error when i start the server: "[*****] BUG: Fread_rooms: vnum 230 has bad sector_type 28."
I must define the sector in others files?

De Martino
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #13 on Sat 17 Jul 2004 04:38 PM (UTC)

Amended on Sat 17 Jul 2004 04:41 PM (UTC) by Greven

Message
That code is here in load_rooms:
	if (pRoomIndex->sector_type < 0 || pRoomIndex->sector_type >= SECT_MAX)
	{
	  bug( "Fread_rooms: vnum %d has bad sector_type %d.", vnum ,
	      pRoomIndex->sector_type);
	  pRoomIndex->sector_type = 1;
	}
Damned inconsistencies. Any ways, how did you define the enum list? Did you add to the very end of the list, like this:
typedef enum
{
  SECT_INSIDE, SECT_CITY, SECT_FIELD, SECT_FOREST, SECT_HILLS, SECT_MOUNTAIN,
  SECT_WATER_SWIM, SECT_WATER_NOSWIM, SECT_UNDERWATER, SECT_AIR, SECT_DESERT,
  SECT_DUNNO, SECT_OCEANFLOOR, SECT_UNDERGROUND, SECT_LAVA, SECT_SWAMP,
  SECT_MAX, SECT_MOON, SECT_MARS
} sector_types;
? If so, move SECT_MAX to the end of the list instead, like this:
typedef enum
{
  SECT_INSIDE, SECT_CITY, SECT_FIELD, SECT_FOREST, SECT_HILLS, SECT_MOUNTAIN,
  SECT_WATER_SWIM, SECT_WATER_NOSWIM, SECT_UNDERWATER, SECT_AIR, SECT_DESERT,
  SECT_DUNNO, SECT_OCEANFLOOR, SECT_UNDERGROUND, SECT_LAVA, SECT_SWAMP, SECT_MOON, SECT_MARS
  SECT_MAX
} sector_types;
. Or if SECT_MAX is the last one, did you make clean when you recompiled?

Nobody ever expects the spanish inquisition!

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

Posted by Mike Scherling   USA  (20 posts)  Bio
Date Reply #14 on Sat 17 Jul 2004 06:05 PM (UTC)
Message
on those sector splits up there ^^^^^



If im correct, isnt there also a #define or something that says how many there are, youd have to change the number.. and i -think- that in one of the files (cant remember which one) it said something baout not addin ganymore then 36 sectors... I might have been confusing somethign else with that though, if i was looking at y code i could confirm this.. but also, I am running the C++ version with smaugwiz, so it could be different

The source is all around us...
in the food you eat...
in the air you breath...
in your tooth... yes, your tooth...
any questions?
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.


56,435 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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.