Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
AhrefsBot, Google, DotBot

Members: 0
Guests: 43
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » 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 7: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 7:36 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
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 7:42 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
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 7:49 pm   Last edited Aug 26, 2013 7: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 8:03 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
JoinedJul 26, 2005

 
you're welcome :)

Post is unread #46 Aug 27, 2013 9: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 10:13 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
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 10: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 10:43 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
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 8: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 10:13 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
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 6: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 10:29 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
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 10:30 am   Last edited Aug 30, 2013 10:42 am by Remcon
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
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 1:38 pm   Last edited Aug 30, 2013 1:52 pm 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 1:50 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
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 1:55 pm   
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 2: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 3:41 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,914
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 10:13 pm   Last edited Aug 30, 2013 10: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 >>