Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, DotBot, Google

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » CalareyMud Coding Help
Forum Rules | Mark all | Recent Posts

CalareyMud Coding Help
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2, 3, 4, 5 next >>
Post is unread #41 Aug 26, 2013, 5:30 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

sure can

here is whats in the house file


void load_homedata()
{
   FILE *fpList;
   char *filename;
   char list[256];
   char buf[MAX_STRING_LENGTH];
    
    first_home	= NULL;
    last_home	= NULL;

    sprintf( list, "%s%s", HOUSE_DIR, HOUSE_LIST );
	

	if ( ( fpList = fopen ( list, "r" ) ) == NULL )
	{
		log_string ( "Cannot open house.lst for reading. Home loading aborted.";);
		return;
    }

	for ( ; ; )
	{
		filename = feof( fpList ) ? "$" : fread_word( fpList );
	
		if ( filename[0] == '$' )
			break;

		if ( !load_house_file( filename ) )
		{
			sprintf( buf, "Cannot load house file: %s", filename );
			bug( buf, 0 );
		}

    }

    fclose( fpList );
	fpList = NULL;
    return;

}




frame 1 of GDB

(gdb) frame 1
#1  0x00000000005afe74 in load_homedata () at house.c:1958
1958                    if ( !load_house_file( filename ) )
(gdb) list
1953                    filename = feof( fpList ) ? "$" : fread_word( fpList );
1954
1955                    if ( filename[0] == '$' )
1956                            break;
1957
1958                    if ( !load_house_file( filename ) )
1959                    {
1960                            sprintf( buf, "Cannot load house file: %s", filename );
1961                            bug( buf, 0 );
1962                    }
(gdb) print supermob
$1 = (CHAR_DATA *) 0x0
       
Post is unread #42 Aug 26, 2013, 5:36 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

well i mean the house file it is trying to load :) hmm no supermob lol that would explain the crash...
       
Post is unread #43 Aug 26, 2013, 5:42 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

(gdb) list
389        log_string( "Loading books" );
390        load_books(  );
391
392        log_string("Loading Housing System, Home Accessories Data,"
393                            " and Home Auctioning System";);
394                 load_homedata();
395                 load_accessories();
396                 load_homebuy();
397
398        fBootDb = TRUE;

ok now looking at this i can tell why it is crashing :) It hasn't gotten to load the area stuff. move the loading of the housing stuff down to after
   /*
    *   initialize supermob.
    *    must be done before reset_area!
    *
    */
   init_supermob(  );

and that is in the boot_db function in db.c
       
Post is unread #44 Aug 26, 2013, 5:49 pm   Last edited Aug 26, 2013, 5:59 pm by mystickdreamer
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

That makes a whole lot of sense


and it would have been what I had done that borked it up lol


thank you once again

Remcon you are a gentleman and a scholar
       
Post is unread #45 Aug 26, 2013, 6:03 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

you're welcome :)
       
Post is unread #46 Aug 27, 2013, 7:56 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

OK so I'm working on importing OasisOLC into my mud


I'm going through fixing errors and things like that, but there is just one error that pops up in multiple places that I can't seem to figure out


void oedit_disp_wear_menu( DESCRIPTOR_DATA *d )
{
    OBJ_DATA *obj = d->character->dest_buf;
    char buf[MAX_STRING_LENGTH];
    int counter, col = 0;

    write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 );
    for ( counter = 0; counter <= ITEM_WEAR_MAX; counter++ )
    {
	//if ( 1 << counter == ITEM_DUAL_WIELD )
	  //  continue;

	sprintf( buf, "&g%2d&w) %-20.20s ", counter+1, capitalize(w_flags[counter]) );
	if ( ++col % 2 == 0 )
	    strcat( buf, "\n\r" );
	send_to_char_color( buf, d->character );
    }
    sprintf( buf, "\n\rWear flags: &c%s&w\n\rEnter wear flag, 0 to quit:  ",
	flag_string( obj->wear_flags, w_flags ) );
    send_to_char_color( buf, d->character );

    return;
}



It has to do with this line
	flag_string( obj->wear_flags, w_flags ) );



and I know the wear flags were changed to parts and looking in mud.h I see that the parts array is named part_flags


so I would assume (correct me if I'm wrong please) that the part_flags would take the place of the wear_flags

but when I try and compile is says
oedit.c:811: error: âOBJ_DATAâ has no member named âpart_flagsâ


but even before I changed it it said the same thing about the wear_flags


some help would be greatly appreciated
       
Post is unread #47 Aug 27, 2013, 8:13 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

would be
ext_flag_string( &obj->parts, bp_flags ) );

It uses parts which is an EXT_BV instead of an int so thats why it has to be ext_flag_string and it uses bp_flags instead of w_flags
       
Post is unread #48 Aug 27, 2013, 8:18 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

Ah I had saw ext_flag_string in mud.h


and I remember the bp_flags now too


what is the & before obj?
       
Post is unread #49 Aug 27, 2013, 8:43 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

try it without it just so you know what kind of error message that causes :)
       
Post is unread #50 Aug 28, 2013, 6:08 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

Ah good idea just in case I see it again




now I'm having a problem in medit.c

with listing defense flags

    write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 );
    for ( i = 0; i < MAX_DEFENSE_TYPE; i++ )
    {
	sprintf( buf, "&g%2d&w) %-20.20s\n\r", i+1,	defense_flags[i] );
	send_to_char_color( buf, d->character );
    }



it is saying defense_flags is undeclared

and I'm having problems finding any references to what should be there

please help again
       
Post is unread #51 Aug 28, 2013, 8:13 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

around the top of the file after the includes (that it is complaining in) add
extern char *const defense_flags[];

it is in build.c around line 257
       
Post is unread #52 Aug 29, 2013, 4:02 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

Ah duh thanks very much


so I had the same thing with race_table and I added the same thing but for race_table

and I have this error
medit.c:702: error: request for member ârace_nameâ in something not a structure or union



is this code

void medit_disp_races( DESCRIPTOR_DATA *d )
{
    CHAR_DATA *victim = d->character->dest_buf;
    int iRace, columns = 0;
	
    write_to_buffer( d, "50\x1B[;H\x1B[2J", 0 );
    if ( IS_NPC(victim) )
    {
	for ( iRace = 0; iRace < MAX_NPC_RACE; iRace++ )
	{
	    ch_printf_color( d->character, "&g%2d&w) %-20.20s  ", iRace, npc_race[iRace] );
	    if ( ++columns % 3 == 0 )
		send_to_char( "\n\r", d->character );
	}
    }
    else
    {
	for ( iRace = 0; iRace < MAX_RACE; iRace++ )
	{
	    ch_printf_color( d->character, "&g%2d&w) %-20.20s     \n\r", iRace, race_table[iRace]->race_name );
	    /* if ( ++columns % 2 == 0 )
		send_to_char( "\n\r", d->character ); */
	}
    }
    send_to_char( "\n\rEnter race: ", d->character );
}
       
Post is unread #53 Aug 29, 2013, 8:29 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

I'll look some more tomorrow. So far it seems it might need modified for species and nations maybe lol.
       
Post is unread #54 Aug 30, 2013, 8:30 am   Last edited Aug 30, 2013, 8:42 am by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

Ok so when setting race on players it is only used for skill_set which it gets from species->skill_set.

You already have a species in mset which will set the species and nation
   if( !str_cmp( arg2, "species" ) )
   {
      victim->nation = find_nation( arg3 );
      if( victim->nation )
      {
         STRFREE( victim->species );
         victim->species = STRALLOC( arg3 );
      }
      return;
   }

although i suggest not using arg3 for setting the victim->species
change it to
   if( !str_cmp( arg2, "species" ) )
   {
      victim->nation = find_nation( arg3 );
      if( victim->nation )
      {
         STRFREE( victim->species );
         victim->species = STRALLOC( victim->nation->name );
      }
      return;
   }

And really after that is done it is probably good to toss them through set_race to set the ch->race to the species->skill_set and change the rest of them to match the new species lol.
       
Post is unread #55 Aug 30, 2013, 11:38 am   Last edited Aug 30, 2013, 11:52 am by mystickdreamer
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

OK that just confused me lol

so I'm going to make sure I didn't goof up my question


The code I presented before was in the medit.c file for editing mobs

the code is supposed to list the mob races which even with mset is set as a race not as a nation or species




although I don't what a problem would be with modifying it so that mobs had nations and species




and oh boy I had a really huge brain fart.... lol the part it's complaining about is trying to use medit.c to change a players race, which of course would deal with nation or species

       
Post is unread #56 Aug 30, 2013, 11:50 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

Lol nod. Ok since it doesn't come with that olc added you kind of have to use the stuff that is in to figure out what you need to do. You would have to rewrite that code to show you the species (which still has nothing to do with showing the races). There isn't anything to show for players race since it is only for the skill_set. For example you can have 20 different species that all get the same skill_set (set of skills). I would actually suggest making it so you can't use that to set the race on a player.
       
Post is unread #57 Aug 30, 2013, 11:55 am
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

LOL I was editing my post while you were making yours



I must have been tired or something, but now I realize the part it's complaining about is the part with the PCs


if I want to continue to just use mset to set players race if I need to then I can just remove the if else statement


and as I reread your post lol you suggested I do just what I'm suggesting to do lol
       
Post is unread #58 Aug 30, 2013, 12:30 pm
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

Ok so I've gotten past those errors


now I have a part of the code

    if ( !can_omodify( ch, obj ) )
	return;


in mud.h
I have
bool can_omodify args( ( CHAR_DATA * ch, OBJ_DATA * obj ) );



and I'm getting the error

oedit.c:108: undefined reference to `can_omodify'
       
Post is unread #59 Aug 30, 2013, 1:41 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

While there is one for that in mud.h there isn't an actual function anywhere in the code for that.
       
Post is unread #60 Aug 30, 2013, 8:13 pm   Last edited Aug 30, 2013, 8:32 pm by mystickdreamer
Go to the top of the page
Go to the bottom of the page

mystickdreamer
Magician
GroupMembers
Posts128
JoinedApr 9, 2010

yay

:sad:


I tried just commenting those lines out, and I'm testing and "seemingly" everything is working fine.



But I have to say with Remcon's help it is coming along fabulously!

you have turned a bad day into a good one. thank you very much
       
Pages:<< prev 1, 2, 3, 4, 5 next >>