Creating a Room

From Meridian 59 - Open Source Wiki
Jump to: navigation, search

1. Create a roo file and place it in ./resources/rooms. Room files in this directory are copied to the appropriate client/server locations when the resources directory is built in the build process.

2. Create a kod file to go with the roo file, see the sample below. (place this in ./kod/object/active/holder/room), add the new kod to the makefile (./kod/object/active/holder/room/makefile)

3. Add a new RID to blakston.khd (./kod/include/blakston.khd)

4. add a line to the section in system.kod (./kod/util/system.kod) where the rooms are created (several CreateOneRoomIfNew Calls)

5. Run nmake (Server and client should not be running)

6. Start server and send the command "send o 0 RecreateAll" in the console

7. Now you can start your client and go to the room by typeing "go RID_YOURROOM" in the chat box

Note: Make sure the teleport coordinates in the room kod file are actually inside your room and not outside or the client won't fully load the room.

Working on your roo file

At this point you will be able to work on the room file by:

1. Edit your roo file (in ./resources/rooms/).

2. Build the resources project (run nmake from ./resources/ or right-click project in VS and click build). Server and client can be running during this build, as the client will reload all the room files if connected to the server when it is reloaded.

3. Click the reload button in the server interface.

Sample KOD File for a Room

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TestRoom is Room


constants:

   include blakston.khd

resources:

   room_test = jixaba.roo
   room_name_test = "Test Room"

classvars:

   vrName = room_name_test

   viTeleport_row = 4
   viTeleport_col = 3

   viTerrain_type = TERRAIN_CITY | TERRAIN_RESIDENCE

properties:

   prRoom = room_test
   piRoom_num = RID_TEST

   piBaseLight = LIGHT_NICE
   piOutside_factor = 3


messages:

   CreateStandardExits()
   {
      plExits = $;

      plEdge_exits = Cons([ LEAVE_SOUTH, RID_EAST5, 35, 74, ROTATE_NONE, ROW_IS_GREATER_THAN, 28 ],plEdge_exits);

      propagate;
   }

end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%