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 ➜ Need help with SWR Extended Bitvectors

Need help with SWR Extended Bitvectors

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


Posted by Jason   (109 posts)  Bio
Date Mon 26 Jan 2004 01:02 AM (UTC)
Message
I'm wanting to install extended Bitvectors into my SWR1.0 mud so that i can add in some new things. Problem is I tried the smuag version of this and it just made everything go haywire. If any knows how to convert all of this successfully into SWR1.0 please contact me on here and explain how.
Thanx.
Jason
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #1 on Mon 26 Jan 2004 03:21 AM (UTC)
Message
We can help you with any coding problems, but you need to be alot more specific than "haywire". What compilation errors did you get? if you can post them here we can try to help.

Nobody ever expects the spanish inquisition!

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

Posted by Jason   (109 posts)  Bio
Date Reply #2 on Mon 26 Jan 2004 04:22 AM (UTC)
Message
well i can't bespecific cause when i did it and it was went haywire that was like 2 weeks ago. Mainly i just want to see if some one can help me get the extended bitvectors to work on swr 1.0 I have taken out all that i did before.
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #3 on Mon 26 Jan 2004 06:04 AM (UTC)

Amended on Mon 26 Jan 2004 06:06 AM (UTC) by Meerclar

Message
Put it back in, let us know what errors you get and we can help you fix them. Without the error messages all we're doing is guesswork which might or might not be useful in solving your problem and will probly only lead you to serious frustration. Some errors may be OS or compiler specific so we really do need them to be of any real help to you.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Jason   (109 posts)  Bio
Date Reply #4 on Mon 26 Jan 2004 06:18 AM (UTC)
Message
now you do realize how much work it takes to put them in right?
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #5 on Mon 26 Jan 2004 06:49 AM (UTC)
Message
If you want help, you'll have to put them in. Even if we told you how to do it, you'd have to go through all that trouble anyways, so you might as well do it and let us help you with the errors as they come. If you really don't want to, we might be able to help with general questions, but you would need to describe what you did, what code you put in, and how you were trying to implement it.

Nobody ever expects the spanish inquisition!

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

Posted by Jason   (109 posts)  Bio
Date Reply #6 on Tue 27 Jan 2004 12:33 AM (UTC)
Message
Ok. I got them all put in again.... Although i got a hell of a lot less errors this time.... I'm down to 0 errors and one warning.

Here is the Error:
reset.c: In function `reset_area':
reset.c:1518: warning: assignment from incompatible pointer type



Here is the code for it:
[code]
case BIT_RESET_ROOM:
if ( !(pRoomIndex = get_room_index(pReset->arg1)) )
{
bug( "Reset_area: 'B': room: bad room vnum %d.", pReset->arg1 );
continue;
}
plc = &pRoomIndex->room_flags;
break;

[/code]

The { plc = &pRoomIndex->room_flags; } is line 1518
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #7 on Tue 27 Jan 2004 12:51 AM (UTC)
Message
Yeah, I had the same thing with mine. Unless you convert all of the things that use plc in that function to xbits, then you'll have a problem. What I ended up doing when I converted my SWR was to add EXT_BV *xplc;, and changes:
plc = &pRoomIndex->room_flags;
to
xplc = &pRoomIndex->room_flags;
and then add the extra check at the bottom where the normal plc is is used. Unless you just wanna take out room reset bits, which is what I ended up doing, cause I dunno anyone who uses them.

Nobody ever expects the spanish inquisition!

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

Posted by Jason   (109 posts)  Bio
Date Reply #8 on Tue 27 Jan 2004 01:37 AM (UTC)
Message
So all I really have to do is add EXT_BV *xplc at the top and change plc to xplc on line 1518 and that will work right?
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #9 on Tue 27 Jan 2004 01:43 AM (UTC)
Message
Assuming you don't want room flag resets, yes.

Nobody ever expects the spanish inquisition!

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

Posted by Jason   (109 posts)  Bio
Date Reply #10 on Tue 27 Jan 2004 01:58 AM (UTC)
Message
well i did it how i just said... and well it's like the room flags aren't being recognized and some rooms seem to be marked private even without the flag... And idea why?
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #11 on Tue 27 Jan 2004 02:13 AM (UTC)

Amended on Tue 27 Jan 2004 02:23 AM (UTC) by Greven

Message
The room flags aren't being recognized? Did you convert the bv to numbers, or did you put them in an enum? Also, if you can't set them, it might be because you didn't change the part in build.c that sets them, removing the <<. Here is what mine looks like:
    if ( !str_cmp( arg, "flags" ) )
    {
	if ( !argument || argument[0] == '\0' )
	{
	   send_to_char( "Toggle the room flags.\n\r", ch );
	   send_to_char( "Usage: redit flags <flag> [flag]...\n\r", ch );
           send_to_char( "\n\rPossible Flags: \n\r", ch );
	       send_to_char(show_ext_flag_string(NUMITEMS(r_flags), r_flags), ch);
       return;
	}


	while ( argument[0] != '\0' )
	{
	   argument = one_argument( argument, arg2 );
	   value = get_rflag( arg2 );
	   if ( value < 0 || value > MAX_BITS )
	     ch_printf( ch, "Unknown flag: %s\n\r", arg2 );
	   else if ( value == ROOM_PLR_HOME && get_trust(ch) < LEVEL_SUPREME )
	       send_to_char( "If you want to build a player home use the 'empty_home' flag instead.\n\r", ch );
	   else
	   {
	       xTOGGLE_BIT( location->room_flags, value );
	   }
	}
	return;
    }


I'll give you the function that I use to show the flags as well:

char *show_ext_flag_string( int len, char * const flagarray[] )
{
    static char buf[MAX_STRING_LENGTH];
    int x;
    buf[0] = '\0';
    for ( x = 0; x <  len; x++ )
	{
	    strcat( buf, flagarray[x] );
	    strcat( buf, " " );
	}
    if ( (x=strlen(buf)) > 0 )
	buf[--x] = '\0';
    
    return buf;
}


and put this into mud.h:
#define NUMITEMS(arg) (sizeof (arg) / sizeof (arg [0]))

If your still having problems, post them and I'll see if I can help.

Nobody ever expects the spanish inquisition!

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

Posted by Jason   (109 posts)  Bio
Date Reply #12 on Tue 27 Jan 2004 02:19 AM (UTC)
Message
Well i figured it out... well sorta,

this is how i had it set up:
typedef enum
{
ROOM_DARK, ROOM_DEATH, ROOM_NO_MOB, ROOM_INDOORS, ROOM_LAWFUL,
ROOM_NEUTRAL, ROOM_CHAOTIC, ROOM_NO_MAGIC, ROOM_TUNNEL,
ROOM_PRIVATE, ROOM_SAFE, ROOM_SOLITARY, ROOM_PET_SHOP,
ROOM_NO_RECALL, ROOM_DONATION, ROOM_NODROPALL,
ROOM_SILENCE, ROOM_LOGSPEECH, ROOM_NODROP, ROOM_CLANSTOREROOM,
ROOM_NO_SUMMON, ROOM_NO_ASTRAL, ROOM_TELEPORT, ROOM_TELESHOWDESC,
ROOM_NOFLOOR, ROOM_NOSUPPLICATE, ROOM_ARENA, ROOM_NOMISSILE,
ROOM_PROTOTYPE, ROOM_DND
} roomflags;


so i changed it to look like this:
#define ROOM_DARK 00

And it seems to be working now
Top

Posted by Jason   (109 posts)  Bio
Date Reply #13 on Tue 27 Jan 2004 02:20 AM (UTC)
Message
but thanx for all the help... I really appriciate it.
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.


38,470 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.