[code] Prompt changing snippet

From: Griffin Hernandez (griffent@SOFTCOM.NET)
Date: 12/19/00


Prompt changing tutorial/snippet

This Tutorial so to speak will tell you how to edit your prompt to many
degrees.
My prompt on my game is set like this

50/50H 50/50M 50/50V Gold: 50 (50)
current/total                                gold on hand   gold in bank

I used 50 as a generic number.

Well anyway the changes to make your prompt like this include:

1st :
Editing the structs.h file and searching for PRF_DISPHP and going to the
end of the list and adding
#define PRF_DISPGOLD    (1 << #)  // Shows Gold on Display thingy
#define PRF_DISPBANKGOLD (1 << #) // Shows Bank gold on Display
# is the next number in the list lets say the previous one was
#define PRF_CLS  (1 << 22) /* Clear screen in OasisOLC  */
then #define PRF_DISPGOLD    (1 << #)  // Shows Gold on Display thingy
The # would be 23. And PRF_DISPBANKGOLD would be 24.

2nd: In comm.c
search for
if (PRF_FLAGGED(d->character, PRF_DISPHP))

Comment out from that to
count += sprintf(prompt + count, "%dV ", GET_MOVE(d->character));

then add below the commented out section :

if (PRF_FLAGGED(d->character, PRF_DISPHP))
      count += sprintf(prompt + count, "%d/%dH ", GET_HIT(d->character),
GET_MAX_HIT(d->character));

    if (PRF_FLAGGED(d->character, PRF_DISPMANA))
      count += sprintf(prompt + count, "%d/%dM ", GET_MANA(d->character),
GET_MAX_MANA(d->character));

    if (PRF_FLAGGED(d->character, PRF_DISPMOVE))
      count += sprintf(prompt + count, "%d/%dV ", GET_MOVE(d->character),
GET_MAX_MOVE(d->character));

 if (PRF_FLAGGED(d->character, PRF_DISPGOLD))
      count += sprintf(prompt + count, "Gold: %d ", GET_GOLD(d->character));

 if (PRF_FLAGGED(d->character, PRF_DISPBANKGOLD))
      count += sprintf(prompt + count, "(%d) ", GET_BANK_GOLD(d-
>character));

3rd and final stage is setting up the prompt to be displayed:

open act.other.c and search for prompt

change
SET_BIT(PRF_FLAGS(ch), PRF_DISPHP | PRF_DISPMANA | PRF_DISPMOVE);
to:
SET_BIT(PRF_FLAGS(ch), PRF_DISPHP | PRF_DISPMANA | PRF_DISPMOVE |
PRF_DISPGOLD | PRF_DISPBANKGOLD);
and all reference of
SET_BIT(PRF_FLAGS(ch), PRF_DISPHP | PRF_DISPMANA | PRF_DISPMOVE);
to
SET_BIT(PRF_FLAGS(ch), PRF_DISPHP | PRF_DISPMANA | PRF_DISPMOVE |
PRF_DISPGOLD | PRF_DISPBANKGOLD);

that is al that needs to be done. On my ver of circlemud there is a glitch
with the output and it will start a second line like 2 words out. If you
have that problem go to structs.h and find:
#define MAX_INPUT_LENGTH and change it to a bigger number, I think that
will fix that.

If you need any help with the following code I will help you to my extent
of knowledge, which isn’t very much. I would like some help writing a named
exit code bit for my mud, if anyone can help me I would much appreciate it.

Griffin H.
    Hawk, Implementer  and Only coder for Forgotten Memories Mud.
griffent@softcom.net

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT