Re: Spec Procs

From: Ron Poulton (ron@res.com)
Date: 09/03/95


> Ok I am coding right now on circle30bpl8 and just started to look at special 
> procs when I noticed that there is no documenation on how to do them.  I really
> don't have time to stare at the code to try to figure it out so could someone.
> please give me a breief description of what is needed for spec procs and 
> an explination on how to implement them.

Chanting to self.. "trial and error... trial and error...". <grin>.

Two files require looking at when adding or altering spec_procs.  
"spec_assign.c" deals with assignments to special procedures; it's here 
you can assign procedure labels to mobiles, objects, and/or if I'm not 
mistaken, also to rooms.  ASSIGNMOB and ASSIGNOBJ are available, at 
least; usage for either: ASSIGNMOB (mob_vnum,SPECIAL(fname)) or 
ASSIGNOBJ(obj_vnum,SPECIAL(fname));.  (fname) is the function name.

"spec_procs.c" holds the specific procedures.  To define a special 
procedure, use:

SPECIAL(fname) 
{
  /* your routine as you would write any 'normal' function */
}

Look at some sample specials to see what variables and prototypes are
used.  I started out by altering the beastly fido and adding new actions
to him, and afterwards endeavoured to write up a Barney The Purple
Dinosaur routine (who is happily annoying people.. <grin>).

Essentially, before any automatic actions are performed on the
mobile/object (maintenance duties such as moving non-sentinels around
randomly), these routines are called first.  Return TRUE if you don't 
want the routines to execute for this particular procedure, FALSE if you 
do want it activated.

Other than that, definition for a mobile or an object is relatively easy 
if you forget that it's easy. <heh>.  Just like writing a new function.



This archive was generated by hypermail 2b30 : 12/07/00 PST