Level Header

From SRB2 Wiki

Jump to: navigation, search
Image:ToDoIcon.png To Do
Add section explaining how to add to WADs natively.

A Level Header, commonly called a map header, is a type of configuration that defines the properties of a particular map. Although, technically, they're actually a SOC block, level headers are more commonly considered an entity of their own kind. Whatever the case, level headers are what give the official levels, like Greenflower Zone Act 1, as well as almost every custom level their specific characteristics. They can control elements such as level name, sky picture, and music.

Level headers are stored in single level header lumps within the same wadfile as the map, or they can be stored in the wadfile's MAINCFG. When they're stored in their own lump, the lump is named MAPxxD, where xx is the double-digit map number. There's a difference between choosing either method: storing the level header in the MAINCFG takes into account the values that are explicitly set in the level header, but also keeps intact the default values that the original level taking the slot would have. For example, if one doesn't set the music for MAP01, MAP01 will have GFZ1's music. Storing the level header in MAPxxD starts all the values on a "blank slate", so there are no defaults.

Sample

This level header gives Greenflower Zone Act 1 its characteristics:

Level 1
LevelName = GREENFLOWER
Act = 1
MusicSlot = 1
NextLevel = 2
TypeOfLevel = 4099
SkyNum = 1

LEVEL n

This statement begins the block. n is the integer map number (NOT the double-digit number), without leading zeros. So, if you want to set the properties of MAP09, you would write LEVEL 9. Note that n is an integer, and hence the extended map numbers must be converted to such to be used here.

Example: LEVEL 1

LevelName

The name of the level that appears in the title card, level select, and other places. SRB2 will automatically add "Zone" to the end of the name, unless the NoZone parameter is set to 1. You cannot make the name too long or the letters will fold over some of the others when the game tries to load it.

Example: LevelName = Green Hill

MapCredits

A ShufflarB2-only feature that shows the maker of level at the start of the level.

Example: MapCredits = Mike

Act

This sets the act number, which goes along with the levelname. If you don't want an act number, set it to 0.

Example: Act = 0

MusicSlot

See also: MusicSlot

This sets the music that's used in the level. SRB2 comes with a wide selection of musicslots to choose from, from its own level music, to less exclusive gems such as Green Hill Zone, Mario, and Metal Harbor. You can also supply your own custom music by storing it in a lump O_MAPxxM, with xx being the musicslot number. After that, set the MusicSlot for the level to the same number.

Example: MusicSlot = 108

SkyNum

This sets the sky that's used in the level. SRB2 comes with a wide selection of skies, and most of the time, the levels use this selection. However, you can also supply your own, but the way to store them is a little complex. What SkyNum does is search for a texture SKYxx, xx being the double-digit number specified. If it's found, it displays that texture as the sky picture. If not, it displays REDWALL. To supply a custom sky, just add an entry to the TEXTURE1 lump as such.

The below is a listing of skies that come with SRB2:

Skynum Zone
1 Greenflower Zone
4 Techno Hill Zone
7 Castle Eggman Zone
8 Starry Sky
29 Spring Hill Zone
30 Mario Koopa Blast 1
40 Christmas Hunt/Old Christmas Demo
54 Wood Zone
56 Blackness (Xtreme Sky)
60 Special Stage 1
61 Special Stage 2
62 Special Stage 3
63 Special Stage 4
64 Special Stage 5
65 Special Stage 6
66 Special Stage 7
94 Starry Sky
96 Starry Sky with Planet
97 Zim's Base
Example: SkyNum = 94

TimeOfDay

This is a ShufflarB2/SRB2CB level heading feature. It allows the level to have and night cycle used with any computers internal clock. 1 enables the feature; 0 disables it.

ShufflarB2 Example: timeofday = 1
SRB2CB Example: Daytonight = 0

Weather

Sets the weather:

Value Effect
0 None
1 Thunder Storm
2 Snow
3 Rain only
4 Preloaded Rain
5 Lightning (No rain)
Example: Weather = 2

TypeOfLevel

This sets the gametype(s) that the level plays under. Usually, more than one is specified.

Value Mode
1 Cooperative
2 Race
4 Match
8 Tag
16 Capture the Flag
32 Chaos (defunct)
64 NiGHTS
128 Sonic Adventure
256 Mario
512 2D
1024 Xmas
4096 Singleplayer

To combine modes, you must add up the numbers for each mode the level supports. If you wanted a Match and Tag level, for instance, add 4 + 8 to get 12. You would then put 12 as the TypeOfLevel.

Example: TypeOfLevel = 12

NextLevel

This sets the level that follows after this one ends. Specify an integer map number, here. For example, if you want the next level to be MAP02, specify 2.

The following values have special meanings:

  • 1100 takes you to the title screen.
  • 1101 takes you to the evaluation screen (the one which shows you which secrets have you unlocked, how many emeralds you have collected, etc.) Single player/co-op only.
  • 1102 ends the game, taking you to the credits.
Example: NextLevel = 2

Hidden

If set to 1, the level will not appear in the list of maps presented when creating a server. Useful for secret maps. For secret maps, it's usually necessary to set both this and LevelSelect.

Example: Hidden = 1

LevelSelect

If set to 1, the level is shown on the unlockable level select. This only works in WADs that would show the level select in the first place.

Example: LevelSelect = 1

TimeAttack

If set to 1, this level is counted in totaling up Time Attack data. Use this in mods to create a Time Attack unlockable.

Example: TimeAttack = 1

CutsceneNum

Specifies which Cutscene to display after the level. Set to 0 to disable.

Example: CutsceneNum = 1

PreCutsceneNum

Specifies which Cutscene to display before the level. Set to 0 to disable.

Example: PreCutsceneNum = 1

ForceCharacter

This forces the player to a certain character in the level. This is only enforced at the beginning of the level, and players can change the skin at any time afterwards. In netgames, the server or an admin can still change the character everyone is forced to use.

Value Character
0 Sonic
1 Tails
2 Knuckles
255 Disabled

4 and up will force the characters in the order they were added to the game.

Example: ForceCharacter = 1

Countdown

Specifies the time, in seconds, that the player has to complete the level. If this time expires, the player will receive a Time Over and lose a life. Setting this variable to 0 will disable the time-limit. This works much like the 10-minute time limit in classic Sonic games.

Example: Countdown = 600

NoZone

If set to 1, "Zone" is not added to the level's name.

Example: NoZone = 1

InterPic

Specifies the lumpname of the image to draw as the background in the intermission screen (that is, the 'level complete' screen in single-player and co-op, and the score screen in match, tag, and CTF.) This allows custom images to be used as the background.

Example: InterPic = INTPIC01

NoReload

When set to 1, the level is not reset when a player dies. So, for example, collectible items will not reappear and linedef executors will not be reset. This is useful for switches, for instance. Mystic Realm, in particular, uses this parameter.

Example: NoReload = 1

NoSSMusic

If set to 1 rather than 0, this will prevent the Super Sonic music from playing when it would otherwise. Super Sneakers music is also suppressed.

Example: NoSSMusic = 1

ScriptName

Loads and runs a script on level load. If ScriptIsLump is set to 0, this is assumed to be the name of an external file. If scriptislump is 1, it's a lump name in the wadfile itself.

Example: ScriptName = SCRIPT01

ScriptIsLump

Use with ScriptName. If it is set to 0, the script name is the name of an external file to load the script from. If it is 1, the script name is a lump name in the wadfile.

Example: ScriptIsLump = 1

Making Level Headers

Open up a text editor such as Notepad. Write the attributes in a format like this:

Level 1
levelname = YOUR MAPNAME HERE
act = 0
musicslot = 1
skynum = 1
weather = 0
typeoflevel = 4096
nextlevel = 2

At a minimum, you should at least include those attributes, though all values which are left out have reasonable default values. Also, an extra line is needed at the end; otherwise, it won't work.

To insert level headers, one can use a lump editor. Save the file as mapxxd.txt and use any lump editor, including XWE or SLumpEd to insert the header into the wad.

External Links

Personal tools