I saw that it looks like there's actually some code in place to put extra descriptions into a mob. It would be cool to put it to use, in my case making an ask chain system that can provide more story to players. Problem is, I'm not exactly sure how to go about making use of what is there.
I'm trying, at first, to just see if I can create the menu I would use for inputting new topics and dialog for each topics. If this is using extra descriptions, I tried plugging in some code used to input object extra descriptions.
Code:
case 'u':
case 'U':
/* If extra descriptions don't exist. */
if (OLC_MOB(d)->ex_description == NULL) {
CREATE(OLC_MOB(d)->ex_description, struct extra_descr_data, 1);
OLC_MOB(d)->ex_description->next = NULL;
}
OLC_DESC(d) = OLC_MOB(d)->ex_description;
medit_disp_extradesc_menu(d);
break;
This is located in medit.c, in the medit_parse function. It is under the MEDIT_MAIN_MENU case in the OLC_MODE(d) switch. I've added in the #defines for OLC_MODE in a separate function that displays the extra_desc menu.
Code:
/* For extra descriptions. */
static void medit_disp_extradesc_menu(struct descriptor_data *d)
{
struct extra_descr_data *extra_desc = OLC_DESC(d);
clear_screen(d);
write_to_output(d,
"%s1%s) Keywords: %s%s\r\n"
"%s2%s) Dialog:\r\n%s%s\r\n"
"%s3%s) Goto next topic: ",
grn, nrm, yel, extra_desc->keyword ? extra_desc->keyword : "<NONE>",
grn, nrm, yel, extra_desc->description ? extra_desc->description : "<NONE>",
grn, nrm
);
write_to_output(d, !extra_desc->next ? "Not Set.\r\n" : "Set.\r\n");
write_to_output(d, "Enter choice (0 to quit) : ");
OLC_MODE(d) = MEDIT_EXTRADESC_MENU;
}
Mind you, all the work so far has, indeed, compiled just fine. I can even boot up the mud and medit a mob. However, when I choose to mess with these ex_descs, this is the result:
Code:
-- Mob Number: [1]
1) Sex: male 2) Keywords: old man
3) S-Desc: an old man
4) L-Desc:-
Sitting on a small stool is an old man, who mumbles to himself quietly.
5) D-Desc:-
Dressed in old grey robes, this old man has only a few wisps of spindly white
hair left on his head. His beard, though it reaches his chest, is thin and can
be seen through. Wrinkles form creases on his face, and his eyes look like they
are shut at first glance. However, they're just barely open, and he mumbles to
himself in an incoherent manner. He slowly rocks back and forth on the stool,
as if constantly shifting his weight to get more comfortable.
6) Position : Standing
7) Default : Standing
8) Attack : hit
9) Stats Menu...
A) NPC Flags : SENTINEL ISNPC NO_KILL
B) AFF Flags : NOBITS
S) Script : Set.
T) Talk Text...
U) Ask Chain :
W) Copy mob
X) Delete mob
Q) Quit
Enter choice :
u
1) Keywords: <NONE>
2) Dialog:
<NONE>
3) Goto next topic: Not Set.
Enter choice (0 to quit) : -- Mob Number: [1]
1) Sex: male 2) Keywords: old man
3) S-Desc: an old man
4) L-Desc:-
Sitting on a small stool is an old man, who mumbles to himself quietly.
5) D-Desc:-
Dressed in old grey robes, this old man has only a few wisps of spindly white
hair left on his head. His beard, though it reaches his chest, is thin and can
be seen through. Wrinkles form creases on his face, and his eyes look like they
are shut at first glance. However, they're just barely open, and he mumbles to
himself in an incoherent manner. He slowly rocks back and forth on the stool,
as if constantly shifting his weight to get more comfortable.
6) Position : Standing
7) Default : Standing
8) Attack : hit
9) Stats Menu...
A) NPC Flags : SENTINEL ISNPC NO_KILL
B) AFF Flags : NOBITS
S) Script : Set.
T) Talk Text...
U) Ask Chain :
W) Copy mob
X) Delete mob
Q) Quit
Enter choice :
It prints out the display menu, but then kicks me right back out into the medit main menu. It might just be that I'm really tired and haven't had a real chance to take a look at this without having some kind of distraction, but I'm having a hard time seeing why this is happening.
Once I can get this to work, I'll try to figure out how to save those ex_descs to file. Which, at a glance, looks like a whole new headache that I am no where near familiar with to tackle (most likely). Once again, however, I'm pretty tired atm and walking away sometimes helps me approach with a fresh look.
Has anyone else tried implementing ex_descs for mobs? Any pointers or guidance would be greatly appreciated.