This page has moved to https://0xdstn.site/projects/traveler. Please update your link to view the latest version.
~dustin hello writing thoughts reading feeds
..

💻 The Traveler

A flat-file interactive fiction system that runs in the browser. It is a spiritual successor to tilde world.

If you have created world with the traveler, I'd love to see it! I could even include it in the game source for others to play if you're interested in that.

I will probably create my own worlds at some point, which will be available to load and play.

Source code: https://github.com/0xdstn/traveler

Live version: https://tilde.town/~dustin/traveler/

  1. Description
  2. Game commands
  3. World creation
  4. Release notes

Description

The traveler is run from a browser using flat files. By default it'll load demo.txt, which includes examples of all available functionality.

You can move around from room to room, pick up objects, and interact with the NPCs and objects in the room or your inventory.

You can also create new rooms, objects, and NPCs directly within the traveler, allowing you to create a world while inhabiting it.

The only things you can't do from within the game is create actions or variables.

There is a very basic variable and action system which allows a more rich interaction with NPCs and objects.

The world, inventory, and current location are constantly saved to local storage, so when you come back the state persists.

You can export the current world to a txt file, and you can import from a text file (local or remote URL). World files do not include inventory or current location, those reset upon import.

A world can be auto imported from url by adding the ?load=URL query parameter.

Game commands

As a user of the game you can run the following commands:

World creation

Worlds are stored in a txt file. Each element (room, object, npc) are represented by multiple lines, and all are separated by an empty line. You can view an example with all available functionality at demo.txt.

Attributes

You can set the following attributes on an element, using a specific starting glyph for each:

+ Name
& Description
@ (object key) - Room only
# (npc key) - Room only
% (dir):(object key) - Room only, a lock with a required item for an exit (ex: % w:west-key)
> (dir):(x),(y) - Room only, overrides an exit with the specified coordinates (ex: > n:10,10)
! (action) - Object and NPC only, creates an action with the provided key. Action code can be seen below
$ (variable) = (value) - Object only, a variable for the object and it's value (ex: $ opened = false)

Action code

When you set an action on an object or NPC, you can include additonal lines after it with action code that runs when the user calls the action (user example: open chest)

The following commands are available:

This is an example of a chest's open action. It gives the user items if it's been opened, and displays a message that it's empty when it's been opened already:

@ chest
+ wooden chest
& A wooden chest in questionable condition
$ opened = false
! open
IF $opened = true
ECHO The chest is empty
ELSE
SET $opened = true
GRAB sword
GRAB shield
GRAB west-key
ENDIF

Here is another example of a lamp the user can turn on and off. The description can include variables that will display the value as well.

@ lamp
+ lamp
& An ordinary lamp with a switch. It is currently $power.
^ false
$ power = on
! switch
IF $power = on
SET $power = off
ECHO You turned off the lamp
ELSE
SET $power = on
ECHO You turned on the lamp
ENDIF

Rooms

Rooms are denoted by a ~ followed by coordinates.

Here is an example room with an item and a NPC. It also has a key required to go west and an override to 10,10 for the north:

You can mention objects in the description with a leading @, and NPCs with a leading #.

+ Landing Room
& An ordinary room with a @lamp and a #ghost.
@ lamp
# ghost
% w:west-key
> n:10,10

Objects

Objects are denoted by a @ followed by an object key

Here is an example with no actions or variables:

@ nintendo
+ Nintendo
& An original Nintendo system hooked up to a CRT television.

NPCs

NPCs are denoted by a # followed by an NPC key

here is an example with a simple talk action:

# ghost
+ Ghost
& A spooky ghost
! talk
ECHO OOooooooooOoOoOoooohhhhhhhhh...

Release notes

👋 Hey! Thanks for reading! If you have any comments or questions about this post, or anything else, I'd love to chat! You can find the best way to contact me on my hello page or send me an email.