Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Apr 10, 2007 1:16 am   

Timing of onRoomEnter
 
When exactly is the onRoomEnter called. Is it immediately after the prompt (i.e when the direction command is sent), or after the room is tagged and matched (i.e. the #OK is received by the mapper.)

In my testing it is the former, so I end up with something like the following:

Code:
<3866/3866hp 1161/1161m 2153mv 9568752xp DOWN>onRoomEnter first

+---------+   Farm
map first
|    |    |   [ north ]
|    3-   |   You stand in a small run-down farmhouse.  It is but a single
|    |    |   room, with three cots along the walls.  a small rickety table
|    *    |   dominates one wall, and a tiny chicken coop is in one corner,
|         |   though it appears that the chickens have escaped, as two or
|         |   three peck at your feet. 
|         |
+---------+


A male slave is here, searching for weeds.
(Clear) A small runt-like cockatrice is here, searching for food.
A young girl in a plain grey dress is here, cooking.





Is this behavior consistent. The reason I ask is that I'm working on a script that if you are in MapMode it sets the color of the room. I can't really do this onRoomEnter, because since it fires before my room matching triggers then I will be giving my current room the color of my last room.
I supposed I could just tag it at the end of my room matching script, but it seems like it really should be it's own Event, e.g. onRoomEntered. The onRoomWalk command didn't seem to fit either since it applied to rooms that were speedwalked.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Apr 10, 2007 2:55 am   
 
It probably depends upon your Speedwalk "mode". If you are in Safe mode, then the mapper waits until it can verify the room name before it confirms the movement on the map. In Slow mode it waits until an #OK is fired. In Fast mode it should move to the room as soon as you enter the direction command.

Basically, as soon as the mapper knows what room you have moved into, then it fires the onRoomEnter.

When in MapMode to create new rooms, the OnRoomEnter is only fired once the mapper has gathered enough information to create the new room. This can depend upon the specific MUD. With some MUDs it needs to see the Exit information for the room before it can create it. On other MUDs it might need to see the MUD prompt. So there is no really consistent way to handle this.

In either case, onRoomEnter fires as soon as the mapper can display the new room and set it as the current room. And this is very MUD and Mode dependent.

It's currently exactly the same as the old "roomenter" alias in zMUD. So you might find more information about it in some old zMUD posts. All I did in CMUD was convert the alias calls into event calls. Any change in behavior will need to wait until the mapper rewrite when I can figure out exactly how it works again. The mapper is very complex, so I might not be remembering exactly how it works.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net