NavigationUser login |
RoomsMuds have rooms where a player moves from room to room by typing a direction such as 'east'. The mud client, since it is connecting to a mud does the same thing and given the position of exits in a 3D room, the mud client will send a direction command (eg east) to the mud so that the player moves to a new room. The following is a scenario where a player using the mud client is in room number 1: In the scenario the player is a in a large 3D room in room 1. To the south is a doorway and to the east there is second mud room but in 3D there is no seperation of the rooms. When a player walks across an imaginary line to the east the 3D mud client will send an 'east' command to the mud and the player will move to 'room 2'. Also if the player was in room 1 and walked through the doorway to the south then once he walked past the doorway the mud client will send a 'south' command to the mud and the player moves to 'room 3'. The above diagram shows different ways in which the mud client can allow a player to move to different exits. The mud can tell the mud client the positions of exits (though doesnt have to) using the room 3d tags. 3dtags for rooms start with 'r' character. For example: {rpx253.00y295.00,en0.2} to specify the the room centre is 253,295 and there is an north exit 0.2 units north of the room centre. Room Centre {rpx253.00y295.00} Objects can be specifed relative to the room centre such as {uprx0.1} means you are at position 0.1 east of the room centre. {odog,prx0.1,+} means a dog appears 0.1 mud units east of the room centre ie 253.1,295 if the above room centre is used. Exit distance When a player moves past this imaginary line the player moves to the new room. The mud can specify the exit distance with the sub tag 'e' followed by the direction ('e') then follow by the distance (0.5) as specified in room 3d tags For example: {rpx253.00y295.00,ee0.50} is 0.5 units east of the room centre which 253.00, 295.00 This exit distance is calculated by default in SWLPC as halfway between two linked rooms. Room 2 is 1 unit east of room 1 thus the exit distance is 0.5. The exit distance can by overridden in SWLPC using the 'set_exitdist' roomlpc] function. For example 'set_exitdist("east",0.4)' will make the exit 0.4 units east of room 1 instead of 0.5. Doorways A doorway uses the sub tag 'd', followed by the exit direction (s) then the coordinate of the door: {rpx253.00y295.00,dsx252.5y294.7} Here there is a door to the south of the room at 252.5,294.7 The position of the door is specified in SWLPC using the 'set_doorxy' function. For example 'set_doorxy("south",252.5,294.7);' A doorway has door width. Therefore in the above figure if the door width is 0.1 then if a player walks south between the points 252.45,294.7 and 252.55,294.7 then the player will go to the southern room. The default door width is specified in the config file room attribute 'doorwidth'. It can be overridden on SWLPC by adding a forth parameter to the set_doorxy function. For example: set_doorxy("south",252.5,294.7,0.2); will set the door width to 0.2 instead of 0.1; Displaying Room centre and exits
Distance a player can move from the room centre When a player moves to a new room you can stop the player until you get a response back from the mud. Depending on latency this can take around 300ms leading to a player stopping as he moves between rooms. To stop this an attribute can be specified called 'rollgap' that is the distance a player can move outside of the room he has exited before waiting for a response from the mud. This can allow a player to keep moving in a room he hasn't yet arrived in on the mud itself. Room Sound {rpx253.00y295.00,sstreet} The volume of the sound of a room can be specified in the config file room 'volume' attribute. Room scripting in SWLPC c:\program files\mudclient\mudmapper\mlib\room\sanom\armourer253.820,300.120,0.lpc This allows for the position of the room to be determined without needing to load the room. It allows SWLPC to estimate the exit distance of exits without needing the load the room at the other side of the exit. The following is an example of a set of functions related to a room in a room script: set_dest_dir ( ({ set_dest_dir is an array of room files with the corresponding room exit |