Stage 5

Introduction

The idea here is to be able to modify the world you’re in, while you (and others) are playing it.

Editing descriptions

> edit description
Launching nano...
Setting room description... done.

>

When a user types “edit description”, the client should launch a text editor, and when they close the editor, take the saved file and set the room’s description to the contents of that file.

Some helpful things:

  • The $EDITOR environment variable tells you what editor to use.
  • The tempfile module lets you create temporary files.

Editing rooms

(you are in the main hall)

> add room Closet
Done.

> link south to Closet
Done.

> south
(you are now in the closet)

> add room Tower

> remove room Tower

You should be able to add rooms with “add room NAME”. This will add a room, but it won’t be linked (have any exits), so you won’t be able to get to it.

However, “link DIRECTION to ROOM” should add a new exit in the current room to ROOM.

Finally, “remove room ROOM” should remove the room, and all exits to it.

Add and remove items

> add item key-2
Type: key
Names (comma separated): key, gold key, shiny key
Description: a very shiny gold key

> remove item key-2
Done.

You should be able to add and remove items. If you add an item, it should be automatically placed in the current room.

Modify the “special” attribute

Lock and unlock doors:

> add special locked-east
Done.

> remove special locked-east
Done.

If you add more things to the “special” attribute in the next stage, this should continue to work.

Table Of Contents

Previous topic

Stage 4

Next topic

Stage 6

This Page