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 ➜ SMAUG ➜ SMAUG coding ➜ how to add a line

how to add a line

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


Posted by Ithildin   USA  (262 posts)  Bio
Date Fri 19 Mar 2004 02:11 AM (UTC)

Amended on Fri 19 Mar 2004 03:04 AM (UTC) by Ithildin

Message
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
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #1 on Fri 19 Mar 2004 04:30 AM (UTC)
Message
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...

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #2 on Fri 19 Mar 2004 05:36 AM (UTC)
Message
Be careful- that's the default prompt, not the prompt function. If someone changes their prompt they won't have that new line anymore...

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #3 on Fri 19 Mar 2004 05:51 AM (UTC)
Message
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.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #4 on Fri 19 Mar 2004 11:52 PM (UTC)
Message
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
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.


15,360 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.