Module Overview
Module Overview

Module Overview

A module in TAME is comprised of elements. Each element has a conceptual purpose. How these elements are defined determine how they are interacted with and what happens when users interact with it.

Modules hold the entirety of a game's world: its Objects, Rooms, Player Viewpoints, abstract Containers, and the World itself. All of these elements hold a context and a set of variable values.

Modules also hold Actions, which determine the means that a user interacts with objects and the world.

4.1 Objects

The most-used element in a module are objects. These can be moved between all of the object containers (world, player, room, container) and is the common element that is targeted by actions.

Where objects are contained dictate their accessibility, as well as the current player or room. The currently accessible objects also affect how user input is interpreted.

4.2 World

Every module contains one world. The world is the main abstraction of the concept of everything.

The world can also hold objects. Objects owned by the world are always accessible, especially to all players (even if no player is set). While nothing is specifically connected to it, it is a primary context that you can count on existing, and contains entry points that are executed every request, or after the module initializes every element's context. All actions and failure to execute actions fall through to this for handling.

4.3 Players

Not to be confused with users, the ones typing the input, the player is the representation of the current viewpoint in the world. The purpose of the player is to define or constrain what is currently visible in terms of actions or objects.

Players can also hold objects. The objects held by a player are accessible so long as that player is current. Players also handle failed actions and other input errors before they are passed onto the world.

Players also can have a current room, which further controls what the player can both do and interact with. A TAME module is not required to have a player, but without players, you cannot set the current room.

4.4 Rooms

Rooms are little abstractions of environment between which players are moved.

Rooms can contain objects. Objects in a room are accessible as long as the room they are in is current on the current player.

4.5 Containers

Containers, much like rooms and players and the world, can contain objects and variable context. However, nothing in a container is accessible.

Containers are useful for containing objects that need to be tagged or bulk-moved to other containers, or keeping track of other object-like things that could be useful, like objective lists or the like, since they can be browsed like any other thing that can contain objects.

4.6 Actions

The way that the user is able to make stuff happen is through Actions. Each action has a set of names, and there are different types of actions that influence how they get interpreted or how a command is expected to be completed.

There are 5 action types: General, Transitive, Ditransitive, Modal, and Open.

General

General actions are actions that do not require any additional references to objects or other things in the world in order to do things. General actions are things like:

	look around
	yell
	inventory

...stuff that can just be done to nothing in particular ("yell" is general. "yell at bob" is transitive).

Transitive

Transitive actions are actions that require an object in order to perform it. The object just needs to be accessible to the current player (or in the world if no player).

	pick up key
	look at lamp
	open door

...where key, lamp, and door are names of objects in the module.

Ditransitive

Ditransitive actions are actions that require two objects in order to perform it. The objects need to be accessible to the current player (or in the world if no player). Ditransitive actions are treated as normal transitive actions if only one object is used, though. The words or phrases that separate the two objects are called "conjunctions," and are declared with the action.

	use key with door
	give bottle to hermit
	stab monster with sword

...where with and to are conjunctions, and key, bottle, sword, hermit, monster, and door are names of objects in the module.

Modal

Modal actions are actions that require a mode, or rather, take specific parameters (called "modes") that are not related to anything in the world. Things like:

	go west
	look up
	walk east

...where west, up, and east do not refer to objects in the world, but are specific enough for TAME to check the validity of.

Open

Here's where things can get tricky - Open actions are actions that, after it is parsed, accept EVERYTHING after it. The stuff that is typed in is saved to a local variable of the module writer's choosing, where it can be parsed for specific phrases or tokens.

	say open sesame

...where say is the action and open sesame is the target. WARNING: Text that is passed along is sanitized, so what the user literally inputs may not be the exact same thing as what is parsed!

Module Overview

Module Overview

×

Modal Header