Advanced Descriptions:Description Modifiers
Descriptions can be modified by circumstances. For instance, an asset's look description can be modified if the player is looking at it through a particular viewport, such as a lens or a window; or by looking at it with a particular light source, such as a candle or a flashlight; or by looking at it from a particular place, such as a chair or a raised platform. You can use this feature to hide things in plain sight. For instance, a room's description might reveal spectral objects only if the player is wearing a set of x-ray specs; or, you could set an invisible ink that is only visible under the light of a blacklight; or, you could place a hint on a desk that is not revealed until the player sits at the desk.
Descriptions apply primarily to subclasses of Tangible, which is to say Entity and Substance and all of their child classes.
Entities
Entities are the physical things in the game world, from lamps to swords to gems to dragons.
MyGame.createAsset({
class: "Entity",
name: "crystal ball",
descriptions: {
// look descriptions are also returned for examine
look: {
default: "The crystal ball appears to pulse gently. ",
// response to "carefully examine crystal ball"
carefully: "Careful examination reveals a fine crack running through the glass of the ball. ",
// response to "carefully examine crystal ball" if the occult candle is present
"carefully, with occult candle":
"Careful examination of the crystal ball under the light of the occult candle reveals a thin rift that follows the line of a fracture in the glass. ",
},
through: {
// response to "look through crystal ball"
default: "Seen through the crystal ball, the room appears appears to shimmer. ",
// response to "look through crystal ball" if the occult candle is present
"with occult candle":
"Seen through the crystal ball by the light of the occult candle, the room appears as a negative image of itself. ",
}
});
MyGame.createAsset({
class: "",
name: "",
descriptions: {
look: {
default: " ",
},
});
Substances
Substances special in that they are technically global assets – meaning, that the water in one container is the same asset as the water in another container. However, you might want the water in a bottle to be described differently from the water in a lake, and you can do that with description modifiers.
MyGame.createAsset({
class: "Liquid",
name: "water",
descriptions: {
// this applies to water in any container
feel: "It's a bit oily. ",
// we've commented this,
// but it would also apply to water in any container
// look: "It's a bit watery. ",
// instead, we're going to use look:{}
// so we can add some description modifiers
look: {
// this will be used if no modifiers apply
default: "It's a bit watery. ",
// response to "look in water", regardless of container
in: "You look in the water. ",
// we can describe water in specific containers
"in chalice": "The water in the chalice glows and shimmers. ",
// response to "look at water through eyeglasses"
// handled automatically if player inputs "look at water"
// while wearing eyeglasses
// applies to all water
"through eyeglasses": "The water is in focus now. ",
// response to "look at water through binoculars"
// applies to all water
"through pair of binoculars": "The water looks big! ",
// response to "look at water through microscope"
"through microscope": "Microscopic critters frolic in the water. ",
// we can combine looking at water in a particular container
// through a particular viewport
"in chalice, through pair of eyeglasses":
"Seen through the pair of eyeglasses, the water in the chalice glows and shimmers. ",
// we can desribe water seen from a particular nest
// however, this applies to water in any container
"from beach chair":
"{We} see the water from the beach chair. ",
// we can describe water in a particular container
// seen from a particular nest
"in lake, from beach chair":
"{We} see the water in the lake from the beach chair. ",
// we can combine all of these to describe water
// in a particular container, seen from a particular nest,
// through a particular viewport
"in lake, from beach chair, through eyeglasses":
"Seen from the beach chair through the eyeglasses, the lake water seems crystal clear."
},
},
});