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

Gammon Software Solutions 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]  Need help with SWR Extended Bitvectors
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Need help with SWR Extended Bitvectors

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Jason   (109 posts)  [Biography] bio
Date Mon 26 Jan 2004 01:02 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #1 on Mon 26 Jan 2004 03:21 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Jason   (109 posts)  [Biography] bio
Date Reply #2 on Mon 26 Jan 2004 04:22 AM (UTC)  quote  ]
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.
[Go to top] top

Posted by Meerclar   USA  (569 posts)  [Biography] bio
Date Reply #3 on Mon 26 Jan 2004 06:04 AM (UTC)  quote  ]

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
[Go to top] top

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

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #5 on Mon 26 Jan 2004 06:49 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Jason   (109 posts)  [Biography] bio
Date Reply #6 on Tue 27 Jan 2004 12:33 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #7 on Tue 27 Jan 2004 12:51 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Jason   (109 posts)  [Biography] bio
Date Reply #8 on Tue 27 Jan 2004 01:37 AM (UTC)  quote  ]
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?
[Go to top] top

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

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Jason   (109 posts)  [Biography] bio
Date Reply #10 on Tue 27 Jan 2004 01:58 AM (UTC)  quote  ]
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?
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #11 on Tue 27 Jan 2004 02:13 AM (UTC)  quote  ]

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
[Go to top] top

Posted by Jason   (109 posts)  [Biography] bio
Date Reply #12 on Tue 27 Jan 2004 02:19 AM (UTC)  quote  ]
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
[Go to top] top

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


3,913 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]