Re: [CODE] Glist

From: Aragorn (root@federation.osp.nl)
Date: 01/27/97


Hi there,

>On Sun, 26 Jan 1997, John Evans wrote:

>> 	I am trying to get a random string to echo to a certain room via a special 
>> procedure for that room.  Here is a shorter version of what I have:
>> 
>>         act("The squeaking of rats can be heard echoing through the sewers.",
>>             TRUE, ch, 0, 0, TO_ROOM);
>> 
>> This method works great for mobs, but not for rooms. :(
>> This snippet of code will compile and won't crash the mud, but it just won't do 
>> anything, and I've sat in the room for a good 10 minutes waiting for SOMETHING 
>> to happen. :)
>> 
>> I didn't think that it would work, but it was all that I could think of. 
>> Perhaps, if I went to bed and came back to it, I'd think of a different way of 
>> doing it. :)
>
>Perhaps I'm wrong here, but your problem might be that you don't have
>a 'ch' when someone doesn't directly initiate the special procedure.
>There's two things that come to me.  This seems like it'll be forced
>to do something whenever a person types a command in the room because
>it lacks a 'if (cmd) return FALSE;'.  Secondly, your act() calls should
>be something like:
>
>  act("Whatever", FALSE, 0, 0, 0, TO_ROOM);

How true ;) But there remains one more thing. Only mob-spec-procs are called
once in a while (from mobact.c) Thats why only mobs have that SPEC flag.
Rooms and objects are not called because of (i think) performance reasons.
Running through all rooms and objects every tic could get quite cpu-intensive.
A solution to this is to make a linked-list with all rooms to call and one
for all objects to call. So brush off that editor and start coding ;)

>
>Now, I wouldn't suggest using any of the act codes in that, as it
>would (quite obviously) cause problems, since you aren't passing any
>pointers for act() to use to replace the codes.
>
>I think the latter part is why the act()'s aren't working.  The former
>might be worthless precautions or disillusionment upon my part.
>
>

Hopes this helps out ;)

Aragorn
-- 
-----------------------------------------------
[         ^         .sig            ^         ]
[        /0\  Under Construction   /0\        ]
[        ---                       ---        ]
[           root@federation.osp.nl            ]
[ I'm as confused as a baby in a topless bar! ]
-----------------------------------------------
|Try:    telnet imagica.rijnhaave.nl 4000     |
-----------------------------------------------
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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