|
CHAPTER 1
Exits:
Our example room is only reachable by wizards at the moment and from it
you can't get anywhere. In room2 exits can be set with the function
set_exits(). Add the following lines to your simple room right after the
set_weather function:
set_exits( ({
"players/<insert your name here>/workroom", "out"
}) );
Now reload the room and look at the changes. The set_exits function takes
only a single argument, an array. An array is a set of values enclosed by
({ }). We will need arrays more often in this tutorial. The first argument
in our example is the filename (without leading "/" AND without trailing
".c") where the exit leads, the second is the exit direction.
Now create a second simple room (perhaps call it simple2.c) and set the
exits of both rooms so that you can walk from one room into the other.
Of course you can add more exits by just adding them to the array. Note
that the number of array elements must be a multiple of 2.
Changed/modified in August 2016!
See also: |
|