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 ➜ ROM ➜ Compiling the server ➜ Problems compiling after adding in immtitle

Problems compiling after adding in immtitle

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


Posted by Kanzeil   (6 posts)  Bio
Date Fri 28 May 2004 09:25 AM (UTC)
Message
act_info.c:2059: structure has no member named `immtitle'
act_info.c:2061: warning: implicit declaration of function `strlen_color'
act_info.c:2061: structure has no member named `immtitle'
act_info.c:2062: structure has no member named `immtitle'
act_info.c:2063: structure has no member named `immtitle'
act_info.c:2064: structure has no member named `immtitle'
act_info.c:2067: structure has no member named `immtitle'
act_info.c:2068: structure has no member named `immtitle'
act_info.c:2069: structure has no member named `immtitle'
act_info.c:2097: warning: too many arguments for format
act_info.c: In function `do_report':
act_info.c:2525: warning: too many arguments for format
act_info.c:2533: warning: too many arguments for format
act_info.c: In function `do_who':
act_info.c:2782: syntax error at end of input
make: *** [act_info.o] Error 1


Now heres where I would need to know more of the language to actually get it to work.. the guy who created the snippet wasnt too indepth with instructions on how to add it in so im left with guessing at this point.. i can past what my file looks like originally and hopefully someone can point out what needs to be done..

Copied from the immtitle readme..
/* act.info.c */
In the do_who function, declare:

char buf3[MAX_STRING_LENGTH];
int half, sechalf;

Find these lines:

case MAX_LEVEL - 7 : class = "ANG"; break;
case MAX_LEVEL - 8 : class = "AVA"; break;
}
}
Add after them:

if (wch->level >= LVL_IMMORTAL && wch->immtitle != NULL)
{
if (strlen_color(wch->immtitle) == 16)
sprintf(buf3, "[%s]", wch->immtitle);
else if (strlen_color(wch->immtitle) == 15)
sprintf(buf3, "[%s ]", wch->immtitle);
else
{
half = ((16 - strlen_color(wch->immtitle)) / 2);
sechalf = (16 - (half + strlen_color(wch->immtitle)));
sprintf(buf3, "[%*c%s%*c]", half, ' ', wch->immtitle, sechalf,
' ');
}
}
else
sprintf( buf3, "[%3d %8s %s]", wch->level,
wch->race < MAX_PC_RACE ?
pc_race_table[wch->race].who_name : " ", class);

Then find the lines:

/*
* Format it up
*/

This is where you'll have to do some changing, simply remove all
race/class/level stuff, and instead of having something like:

sprintf(buf, "[%2d %s %s] %s"...)

You'd remove everything within the brackets, including the brackets,
and make it:

sprintf(buf, "%s %s", buf3, wch->name...);

Then also remove the first 3 declarations for wch->race, wch->level,
and class. This is all being handled up top now.

I cant begin to understand what hes talking about really.. :P

this is what it looked like originally in my act_info.c (well modified a tiny bit ofcourse, note color)

case MAX_LEVEL - 7 : class = " Leader"; break;
case MAX_LEVEL - 8 : class = " Recrutr"; break;
}
}

/*
* Format it up.
*/
sprintf( buf, "[%2d %6s %s] %s%s%s%s%s%s%s%s\n\r",
wch->level,
wch->race < MAX_PC_RACE ? pc_race_table[wch->race].who_name
: " ",
class,
wch->incog_level >= LEVEL_HERO ? "(Incog) " : "",
wch->invis_level >= LEVEL_HERO ? "({cWizi{x) " : "",
clan_table[wch->clan].who_name,
IS_SET(wch->comm, COMM_AFK) ? "[A] " : "",
IS_SET(wch->act, PLR_KILLER) ? "{R(K){x " : "",
IS_SET(wch->act, PLR_THIEF) ? "{Y(T){x " : "",
wch->name,
IS_NPC(wch) ? "" : wch->pcdata->title );
add_buf(output,buf);
}

Im not a coder as of yet, im slowly picking up on it though and I will be going to college to learn programming soon enough hopefully this next fall, and thanks for the help if anyone is able to do this for me.. and heres a link to the immtitle snippet for more direct insight..
http://www.mudmagic.com/codes/reviews/449.html
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #1 on Fri 28 May 2004 05:57 PM (UTC)
Message
The "act_info.c:2059: structure has no member named `immtitle'" means that "immtitle" wasn't added to the char_data structure in mud.h. The reveiws even notice this:
Quote:
You will need to add the "char * immtitle;" to two structure lists in the file merc.h
The "act_info.c:2533: warning: too many arguments for format" means that your probably missing a %s in a printf line. The "act_info.c:2061: warning: implicit declaration of function `strlen_color'" means that your missing something like "int strlen_color args(( char *string ));" in your file. And lastly, the "act_info.c:2782: syntax error at end of input" looks like your missing an closing } or two.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
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.


10,550 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.