On Sun, 30 Sep 2001, Mike Breuer wrote: >----- Original Message ----- >From: "George Greer" <greerga@CIRCLEMUD.ORG> > >> Wouldn't people be happier with an "on_room_enter" event trigger? I know >> mobile aggression would prefer that anyway. Probably then go for >> "on_room_exit" to be consistent. Maybe "on_item_get", "on_item_drop", >> "on_item_give", etc. Shouldn't take up much extra RAM since it'd be stored >> in the prototypes and not each object/mobile. Calling convention would be >> SPECIAL() as usual, likely. > >What I ended up doing is similar to what you are suggesting, but not >quite the same. I modified all of my spec procs by adding a parameter >that indicates how the proc was triggered, and then in each SPECIAL I use >a macro to test/indicate which triggers the proc will handle. So, I can >put calls to SPECIAL's in the char_to_room code (or wherever), and it >would go ahead and call procs for mobs, or items in inventory, or the >room itself regardless. The procs themselves register an interest in the >"on room enter" trigger; those that are not interested return and do >nothing. Two methods would be: 1) Each trigger is a list of functions to call. Each trigger function in the list is a generic, shareable SPECIAL. (e.g.: an aggressive mobile on_room_enter trigger and guard shout at criminal on_room_enter trigger) 2) Each trigger type calls a single special procedure with an argument that it uses to decide what to do. Each special procedure then can call smaller, generic "helper" procedures for stuff like the shared aggressive mobile handling. >> A late reply, but check the date and you'll understand. > >Understood. In fact, one of the reasons I posted that day was that I was >having trouble focusing on work. :-( I had to go reboot a box 30 minutes away at work that hadn't come back up the night before. sigh, no rest for the administrators. -- George Greer greerga@circlemud.org -- +---------------------------------------------------------------+ | 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/06/01 PST