Re: Open/Closing/Unlocking/Locking Doors/Objects Message to player.

From: Welcor (welcor@dune.net)
Date: 01/30/02


----- Original Message -----
From: "Abraham Dizon" <soldier2003@HOTMAIL.COM>
> Okay I got a problem right now. Its with open/closing/unlocking/locking
> door/objects message to the player that does all this ^. I can't seem to
get
> it to work right. The message to the player when they
open/close/unlock/lock
> a door or an object. This is what I did in act.movement.c:
>

Here's a clue:
  char outbuf[200];

  sprintf(outbuf, "You %s %%s\r\n", cmd_door[scmd],
    ((obj) ? "" : "the "), (obj) ? obj->short_desc :
    (EXIT(ch, door)->keyword ? EXIT(ch, door)->keyword : "door");
  send_to_char(outbuf, ch);

In other words:
  First write to a buffer.
  THEN send to char.
because
  send_to_char() doesn't (yet)[1] support variable arguments.

>     send_to_char("You open the $\r\n", ch);
The $ sign is only used in act(), not in send_to_char.

Welcor

[1] I can't recall having read that it ever will, but since it
    already has been changed to look like the sprintf call, it
    doesn't seem too far fetched.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT