Glad it is of use
1). Yeah sorry, I need to work on including clearer instructions!
do_prompt() is used to manually set a prompt, for those that want to string together their own customizations.
Without an argument, do_prompt() should simply return the string that is currently set, or "n/a" if nothing has been set. It may be worth changing the "n/a" to something like "not set - see HELP DISPLAY" ?
Which segues to the missing help information
Code:
PROMPT
Usage: prompt <string>
Manually set a custom prompt. <string> can be made up from the following values:
%h - current hitpoints %H - Max hitpoints %ph - hitpoints as a percentage
%m - current mana points %M - Max mana points %pm - mana as a percentage
%v - current move points %V - Max move points %pv - move as a percentage
%g - gold on hand %G - gold in bank
%q - quest points
%x - current XP %X - XP till next level
%% - show a percentage sign
%_ - new line
All color codes are accepted using the '@' symbol.
Example: prompt %h %m %v @W>@n
See also: DISPLAY TOGGLE COLOUR
DISPLAY
Usage: display <number>
Set your prompt to a preset display.
Typing display by itself will show a list of options.
Example: display 2
See also: PROMPT
2.) I quickly tested this and couldn't reproduce it. Lets discuss on AtBMUD further.
3.) Absolutely! Remember when expanding this code that you lose any data that exceeds MAX_PROMPT_LENGTH, which is why I raised it by another 100 characters. Also there may be better ways to provide some information that players request, like having ROOMFLAGS turned on will show room vnums etc. Just something to consider before adding additional fields.
char *prompt_str(struct char_data *ch) in comm.c is where you make the changes.
Find an unused letter inside the switch statement
Code:
switch (*(++str)) {
Order doesn't matter, but it's nice to keep it alphabetical for next time you look at it.
Then add your new code block, eg:
Code:
case 'z':
if (GET_LEVEL(ch) >= LVL_IMMORT) // add zone number for immortals
snprintf(i, sizeof(i), "%d", zone_table[world[IN_ROOM(ch)].zone].number);
else
snprintf(i, sizeof(i), "z"); // for mortals, just add the letter Z
tmp = i;
break;
Adding room vnums would be very similar, change the case and the zone number for room vnum.