You're second method is the right track, imho. I personally have never
like -1 objects, so I have prototypes for just about everything, and a
default vnum for the rest.
How I add procs on the fly, is by creating a new ITEM_ for each one, such as
ITEM_SWITCH. In read_object, I ended it with a switch statement that auto
assigns the procs to the item types as needed. You could also add a few
isnames in there, to specialize a bit more, eg if (GET_OBJ_TYPE(obj) ==
ITEM_FOOD && isname(GET_OBJ_NAME(obj), "waybread") .
Of course I can't add all my procs this way, but the more common ones make
the builders life much simpler.
Erik Madison
ICQ #13940294
www.greyhawk.org
fafhrd@greyhawk.org
-----Original Message-----
From: Patrick Dughi <dughi@IMAXX.NET>
To: CIRCLE@post.queensu.ca <CIRCLE@post.queensu.ca>
Date: Monday, February 01, 1999 10:23 AM
Subject: [_NOT_ Newbie] Assigning Spec procs to generated
objects.
> In a nutshell, I'm trying to think of a good system to adopt so
>that I can assign specprocs to generated items - like corpses, mail, etc.
>
>Currently, they're assigned in the following way;
> obj_index[real_object(obj)].func = fname
>
> However, when real_object(obj) is performed on a unique object, we
>get -1, which of course, won't work. With my current incarnation of
>xap_objs, I ran into this problem, and avoided some crashes, i'm sure,
>which would have been quite wonderful, had I actually started to assign
>spec_procs to these objects.
>
> I wanted to include an oasis olc addon and I know that some people
>(including me) have the ability in their olc to assign specprocs, and
>since the individual object editor mimics the normal oediter, it should be
>an option.... That brings up a related point -
>
> Say I take and instead of making an object unique from 'scratch',
>I make it off a prototype. So, we have oh.. i don't know.. a waybread.
>The vnum is 10. Now, when I iedit (that is, use an individual object
>editor) that object, I can change all its stats, and its saved exactly
>like that on that instance on that object. If I include the ability to set
>a spec proc on it though - now to make that work, I have to alter the
>global table - suddenly all waybreads (and altered instances of waybreads
>- anything with the same rnum) exhibit the property of that specproc.
>
> This wouldn't be the intended behavior of the action - I just want
>that instance to have the proc...
>
> Possibly it would be better to remove the spec_procs from each
>global index, and have their own list (well, three of them to make life
>easy, I suppose).....
>
> This might be easier then, because you'd have an index of
>spec_procs you can use, and upon loading your mob, you set the current mob
>to point at a spec_proc. It would make the process of assigning spec
>procs online a bit easier, since all you have to do is point at an index.
>
> Or, any other ideas?
> PjD
>
>
> +------------------------------------------------------------+
> | Ensure that you have read the CircleMUD Mailing List FAQ: |
> | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
> +------------------------------------------------------------+
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST