Re: [Newbie] Question about Puff

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 06/09/01


On Sat, 9 Jun 2001, SeaShaman T. Delphin wrote:

> I might be answering my own Question by stating spec_assign.c and
> spec_procs.c but are there any other files I've missed?  Any help
> would be appreciated.. and if I missed a resource somewere that
> explains this fully, please be sure to point me out to it.

Learn to use your operating system's text search facility.  On Unix
systems, this is grep.  You can answer your own question without needing
to know anything more about CircleMUD than you do if you know how to use
the facilities that your computer system gives you.

Since you know the name of the special procedures ("puff" and
"mayor" specifically) a reasonable thing to do would be to scan through
the source code for other places that use these words.

  > grep "mayor" *.[ch]
  spec_assign.c:SPECIAL(mayor);
  spec_assign.c:  ASSIGNMOB(3105, mayor);
  spec_procs.c:SPECIAL(mayor);
  spec_procs.c:SPECIAL(mayor)

Doing the like for 'puff' turns up a handful of strings that include puff
in their body (which aren't relevant matches) and

  spec_assign.c:SPECIAL(puff);
  spec_assign.c:  ASSIGNMOB(1, puff);
  spec_procs.c:SPECIAL(puff);
  spec_procs.c:SPECIAL(puff)

In fact, you can do this for every special procedure and you'll soon see
that, with the exception of the ones assigned in castle.c, they're all
assigned in spec_assign.c (and, even for the ones assigned in castle.c,
the function to assign them is called from spec_assign.c).  Since we're
using C and C doesn't care where functions are defined in the nominal
case, where the special procedures are defined is irrelevant so long as
they're linked in.  Where they're assigned, of course, is also irrelevant
so long as the code to assign them is called at the appropriate time.  As
it happens, spec_assign.c's various functions are called at the
appropriate time already, so you might as well put your spec proc
assignment code there.


--
Daniel A. Koepke (dak), dkoepke@circlemud.org
Caveat emptor: I say what I mean and mean what I say.  Listen well.
Caveat venditor: Say what you mean, mean what you say.  Say it well.

--
   +---------------------------------------------------------------+
   | 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 : 12/05/01 PST