logo

TheoWorlds Builder SDK v2 Documentation

Maps (rooms)

1. Creating and Editing maps

In order to create a new map:
  1. Run Theo MapEditor, create a new map, and export its XML into a file. Place it into the "/maps" folder.
  2. Open SmartFox Server config.xml file (located in the main SF folder). Locate this section in the code:

        <Zone name="TheoChat">
            <Room name="The Dance Room" maxUsers="10" isPrivate="false" isTemp="false" autoJoin="false">
              <Vars>
                      <Var name="MapPath" type="s" private="false">maps/dance.xml</Var>
              </Vars>
    </Room>

    Add a new <room> block (you can duplicate an existing one and then edit it, or you can edit an existing one in order to replace one room with another) and edit the fields marked in bold above (the room name and the map XML file name/location - point it to your new map XML file).

    Note!Do not change or remove the following room in SF's config file:
             <Room name="Lobby" maxUsers="10" isPrivate="false" isTemp="false" autoJoin="false" />
    This is the room that is used internally by TheoChat to login the users.


  3. Restart the SmartFox Server and run TheoChat - you should see your new room there.
  4. In order to be able to edit this room later in the Map Editor, also make sure to add it to the catalogue.xml file. Add your room to this file, as shown below in bold:
         <maps>
              <map url="maps/ground.xml"/>
              <map url="maps/chat_levee.xml"/>
              <map url="maps/chat_dance_club.xml"/>
              <map url="maps/chat_apartment.xml"/>
              <map url="maps/new_room_name.xml"/>
         </maps>

2. Connecting maps ("teleporters")

Teleports

You can connect the maps between each other using "teleporters" - furniture objects on the map that, when stepped on, "transport" the character to another map. In TheoChat we use animated arrows as "teleporters".

In order to add "teleports" to your own map, you have to place the "teleport" furniture on the map in Map Editor. You can use our arrows or any other furniture. After you save the XML file with your map, open it and locate that furniture's line in the code. You can locate the arrows using it's ID (libItemID="66"):

<f col="4" row="4" libID="2" libItemID="66" libFrame="8" oWalkable="teleport" destRoom="12" destTile="7,14"/>

Here is the list of parameters you have to add/modify:

  • * libFrame="8" - indicates the frame of the furniture object (in the case when you use multi-frame furniture). With our arrows those frames are used for different directions. "8" corresponds to the Constants.DIR_UP_LEFT (upper left corner) direction.
  • oWalkable="teleport" (or oWalkable="10") - (mandatory) the most important parameter that transforms the furniture into a "teleport".
  • destRoom="roomName" - the destination room name (make sure you use unique names)
  • destTile="7,14" - (optional) indicated the destination tile on the new map on which the character will land on (or somewhere around it, if that tile is taken). If you skip this parameter the character will be placed on a random available tile.
Last updated: September 16, 2009