MAPINFO/Cluster definition

From ZDoom Wiki
Jump to navigation Jump to search

A cluster definition begins with the keyword "cluster". For purposes of ZDoom, clusters are used to displays messages when moving between maps, at the beginning or end of episodes and to optionally group different levels into a hub.

Cluster commands

cluster <value> { properties }

<value> is the cluster number that this definition defines. A cluster of 0 is used internally to mean "no cluster" and should be avoided.

Cluster properties

The following properties are supported within a cluster definition:

Property Description
EnterText = "<message>"

EnterText = lookup, "<keyword>"

<message> is a message to be displayed when the player has just finished a level in another cluster and is entering a level in this cluster. To create multi-line messages, quote each line separately and separate them with commas.

Alternatively, you can use the lookup keyword as above to instruct ZDoom to locate a string defined in the LANGUAGE lump by the specified keyword.


ExitText = "<message>"

ExitText = lookup, "<keyword>"

<message> is a message to be displayed when the player has just finished a level in a different cluster from the next one. If the next level's cluster has an enter text defined, then it will be shown instead of this cluster's exit text. To create multi-line messages, quote each line separately and separate them with commas.

Alternatively, you can use the lookup keyword as above to instruct ZDoom to locate a string defined in the LANGUAGE lump by the specified keyword.


ExitTextIsLump Uses the message defined by the ExitText property as a lump name rather than printing its text directly. This is used within ZDoom's MAPINFO for Strife to print the text lumps present within that game rather than defining them within the MAPINFO directly.


Music = "<musiclump>" This is the music to play while either the enter or exit text of this cluster is displayed. For Doom, this is normally D_VICTOR, and for Doom II, this is normally D_READ_M.


Flat = "<flatlump>" This is the name of the flat to use as a background while this cluster's enter or exit text is displayed.


Pic = "<piclump>" This is the pic to use as a background while this cluster's enter or exit text is displayed.


Hub Indicates that this cluster is a hub. When leaving a hub, the game will remember the contents of the level when the player left it and restore the level to that state when the player returns to it. Moving to a different cluster will cause the game to forget the state of the levels in this hub in order to save memory. Each level a player visits in a hub uses memory (about 20k for a typical level), so it is probably a good idea not to have too many levels in a single hub. Just how many is "too many" is arbitrary. Unless you use very large levels, you could probably use 50 levels in a hub, and only about 1 meg would be required to keep track of the state of each level.


AllowIntermission Enables intermission for a hub cluster. Note that Intermission and NoIntermission flags still apply per-level. This command does nothing for non-hub clusters.


Intro { ... }

Outro { ... }

GameOver { ... }

Specifies an intro, outro and gameover cutscene to play at the beginning, end and upon the player's death in this cluster, respectively. The following properties can be used within the Intro, Outro and GameOver blocks:
  • Video = "<videoname>"
Sets the video for the cutscene to play. This must be the full name of the video file, which consists of the path to the file, its name and extension, e.g "graphics/videos/coolvideo.ivf". For a list of supported video formats, see Video format.
  • Function = "<functionname>"
Specifies a ZScript function for the cutscene to run, rather than a video. This ZScript function needs to be static, have no return type, and take a ScreenJobRunner as its sole argument.
  • Sound = "<soundname>"
Specifies the sound that should play during the cutscene. This uses the logical name of a sound. (Verification needed) By default, GZDoom will instead look for an identically named OGG, FLAC, MP3, OPUS, or WAV file in the same directory as the video.
  • SoundID = <id>
Specifies the ID of the sound to play during the cutscene. The default is -1. (Need more info) (Verification needed)
  • FPS = <value>
Sets the framerate to play the cutscene at. This only works with ANM video.
  • Delete
Deletes the cutscenes' function and assigned video. The cutscene will still be defined, but will simply not play anything.
  • Clear
Clears the cutscene definition.

Examples

This example references the E1TEXT section of the LANGUAGE lump

cluster 1
{
   flat = "FLOOR4_8"
   music = "$MUSIC_VICTOR"
   exittext = lookup, "E1TEXT"
}

This example, from Eviternity, has the text directly written into the MAPINFO lump

cluster 5 
{
	flat = OGRATB02
	music = D_READ_M
 	exittext = 
 	"In the farthest reaches, a Light",
	"awoke, and cast his luminous rays",
	"on all around him.",
	" ",
	"He fashioned a world unto his image,",
	"created beasts of his will, and declared",
	"himself eternal, ruler of his domain.",
	" ",
	"But his hubris cast a sickness, and",
	"from distant worlds called forth ",
	"the agent of retribution, drawn ",
	"through the cosmos by his pride.  ",
	" ",
	"It cast down his beasts, it rejected ",
	"his rule, and through lands eternal ",
	"it brought forth his doom."
}