how to add a line

Posted by Ithildin on Fri 19 Mar 2004 02:11 AM — 5 posts, 17,186 views.

USA #0
i know this is probably elementary, but i still need to know. that way i won't have to ask you guys again. :)

i want my prompt to look like this:

<100hp 100m 100 mv>
< >

my original is like this:

<100hp 100m 100 mv>

i want those extra brackets below.

here's the code:


char *default_prompt( CHAR_DATA *ch )
{
  static char buf[60];

  strcpy(buf, "&w<&Y%hhp ");
  if ( IS_VAMPIRE(ch) )
    strcat(buf, "&R%bbp");
  else
    strcat(buf, "&C%mm");
  strcat(buf, " &G%vmv&w> ");
  if ( IS_NPC(ch) || IS_IMMORTAL(ch) )
    strcat(buf, "%i%R");
  return buf;
}


what's the command to add a line underneath it. i feel stupid for asking this. i've probably messed with it before, just forgot.

Thanks,
Ithildin
Amended on Fri 19 Mar 2004 03:04 AM by Ithildin
Canada #1
Try this:

char *default_prompt( CHAR_DATA *ch )
{
  static char buf[60];

  strncpy(buf, "&w<&Y%hhp ", 60);
  if ( IS_VAMPIRE(ch) )
    strncat(buf, "&R%bbp", 60);
  else
    strncat(buf, "&C%mm",60);
  strncat(buf, " &G%vmv&w> ",60);
  if ( IS_NPC(ch) || IS_IMMORTAL(ch) )
    strncat(buf, "%i%R",60);
  strncat(buf, "\n\r< > ",60);
  return buf;
}


That should work...
USA #2
Be careful- that's the default prompt, not the prompt function. If someone changes their prompt they won't have that new line anymore...
Canada #3
Quite true, you may want to add something like this into the function that parses player prompts, I think its display_prompt:
                        case '_':
                                strcpy(pbuf, "\n\r");
                                break;
Then people could use %_ to force a new line in their prompt.
USA #4
so the \n\r thing will put another space. i haven't been able to mess with it. i've been really busy with school and work. i'll try it later on tonite. thanks

Ithildin