Adding worldmap rooms

From wiki.desolation.org
Jump to: navigation, search

To add rooms to the worldmap you must first be either an admin or a creator with the proper permissions.

The first thing to do is create the base room which has the description of the worldmap room which you wish to implement. This serves as the entrance to the area you wish to put in. A worldmap room is somewhat different from other rooms. Here is some example code.

Worldmap Room[ ]

inherit __DIR__ + "worldmap.c";

void setup(){
   set_monster_chance(0);  // Must be set before calling worldmap setup.
   worldmap::setup();
   set_brief("%^RESET%^%^ORANGE%^Outside an Outpost%^RESET%^");
   set_long("Off in the distance, you see a small settlement. It looks "
     "like there's a good bit of activity there, as you can see an "
     "occasional cloud of dust coming from here and there inside the walls "
     "of the place.");

   set_exits( ([
        "outpost" : "/domains/ranger-outpost/front.c"
            ]) );

   set_exit_msg( "outpost", ({ "$N $vhike towards the outpost in the distance.",
      "$N $vhike towards the outpost in the distance." }) );
}

Once that is done place the room template in

/domains/wastelands/rooms/

Landtype File[ ]

Now that the template is properly named, it needs to be added to the list of files that are registered to be on the worldmap. To do this would to add the file to the landtype.cfg file. This file is located in

/domains/config/wastelands/landtype.cfg

Add the details of your worldmap room to this file. The format is:

id|name|filepath|ascii symbol

So the Ranger Outpost, accordingly, has the format of:

31|Ranger Outpost|outpost.c|o

Colours may be added to the ascii symbol.

Updating Wasteland_D[ ]

The next step is to update all files associated with the landtype.cfg file with the new information. The landtype.cfg file is the file from which the wastelands daemon reads from, and the wastelands daemon is the file which governs the whole worldmap. So, we'll update wasteland_d. Type:

update /domains/config/wastelands/landtype.cfg
update -r /domains/wastelands/wasteland_d.c

It will update a string of files at the same time, so nothing is left out.

Mapmenu[ ]

The final stretch is using mapmenu. Go to the location where you wish to introduce the new location. It must be on the worldmap, otherwise mapmenu will not work. Now type:

mapmenu

And it will open up a long list of locations that can alter the current location. Select the new location that you wish to put in. And there you have it.