This article's documentation is for anything that uses the Source engine. Click here for more information.

worldspawn

From Valve Developer Community
(Redirected from World)
Jump to navigation Jump to search
English (en)Deutsch (de)Русский (ru)中文 (zh)Translate (Translate)
Class hierarchy
CWorld
CBaseEntity
world.cpp

worldspawn is an entity available in all Source Source games. It (or just "the world") is the single entity that stores the noninteractive parts of a map, alongside some global configuration options. In other words:

Some other notes:

  • There can be only one. (Since Hammer doesn't allow worldspawn to be created directly, it's very difficult for this rule to be broken.)
Icon-Bug.pngBug:Related to this, do not clone any part of your world after selecting it via map properties. This will duplicate worldspawn, causing crashes. Deselecting after this however and cloning after deselecting will behave as normal.  [todo tested in?]
  • Damage from the environment and suicide is ordinarily attributed to the world.
  • Constraints can be assigned to worldspawn by not specifying a name for their subject/target.

Keyvalues

Tip.pngTip:Access these properties in Hammer with Main menu > Map > Map properties...

All Source Source Games

Map Description / Title (message) <string>
Usually unused in-game (leftover from Quake Quake I). Typically used for author credits.
Skybox Name (skyname) <string>
Skybox material. See Sky List.
Chapter Title Message (chaptertitle) <string>
Chapter Title that appears on-screen when this level starts.
Level Fade In (startdark) <boolean>
Fade in when the map loads.
Icon-Bug.pngBug:The fade is carried out every time the map loads, including when loading from a saved game. Use env_fade instead.  [todo tested in?]
Display Game Title (gametitle) <boolean>
Should the game's title appear on-screen when the map starts?
Icon-Bug.pngBug:Crashes the game when enabled if the game tries to draw the title but does not include title_half and title_life entries in 🖿/scripts/hud_textures.txt.
Half-Life: Source is one of the games that does have them, for example.
Confirm:Which other games have them, or don't use this method in the first place?
  [todo tested in?]
Note.pngFix:Add title_half and title_life entries to hud_textures.txt.
Example from HL:S 
"title_half"
{
     "file" "sprites/640hud4"
     "x" "0"
     "y" "226"
     "width" "256"
     "height" "30"
}
"title_life"
{
     "file" "sprites/640hud5"
     "x" "0"
     "y" "226"
     "width" "220"
     "height" "30"
}

A proper fix in the code for your mod would be to edit 🖿/game/client/message.cpp's Paint() function, to check m_iconTitleHalf and m_iconTitleLife not being NULL.

New Level Unit (newunit) <boolean>
Used to clear out savegame data of previous levels to keep the savegame size as small as possible. Only set it to Yes if the player cannot return to any previous levels.
Note.pngNote:Portal 2 Portal 2 forces this to be enabled in code, so two-way transitions will not work correctly. (One-way HL2 style transitions work fine though.)
  • 0 : No, keep current
  • 1 : Yes, clear previous levels
Max occludee area (maxoccludeearea) <float>
[Used on PC] Prevents occlusion testing for entities that take up more than X% of the screen.
Min occluder area (minoccludeearea) <float>
[Used on PC] Prevents occluders from being used if they take up less than X% of the screen.
Max occludee area (Xbox) (maxoccludeearea_x360) <float>
[Used on 360] Prevents occlusion testing for entities that take up more than X% of the screen.
Min occluder area (Xbox) (minoccludeearea_x360) <float>
[Used on 360] Prevents occluders from being used if they take up less than X% of the screen.
Start Fade Pixels (maxpropscreenwidth) <float>
Number of pixels wide at which all props in the level start to fade (<0 = use fademaxdist). This number is ignored if the prop has a specific fade distance specified.
End Fade Pixels (minpropscreenwidth) <float>
Minimum number of pixels wide at which the prop is visible (0 = don't fade out). This number is ignored if the prop has a specific fade distance specified.
Detail.vbsp file (detailvbsp) <string>
Detail.vbsp file to use for emitting detail props (found in directory <root>/modname)
Detail material file (detailmaterial) <string>
Material for detail sprites to use for drawing detail props
World is cold (coldworld) <boolean>
If set, Day of Defeat: Source Day of Defeat: Source player models will emit breath particles from their mouth attachments. No effect elsewhere.
Minimum light level (_minlight) <float> !FGD
The minimum level of ambient light that hits the world. It does not affect any entities, including props!
ResponseContext:
Response Contexts (ResponseContext) <string>
Pre-defined response system context{s} for this entity. Format is key:value,key:value,... When this entity speaks, the list of keys & values will be passed to the response rules system.

Left 4 Dead 2 Left 4 Dead 2

Time of day (timeofday) <integer choices>
Common infected will aggro from a further distance if set to "Dawn" through "Dusk" and will sit or lie down if set to "Midnight" or "Evening". Witches will wander if set to "Afternoon".
Note.pngNote:Doesn't influence lighting or environment in any way. You still need to configure the light_environment so the sun/moon has the appropriate light color and brightness.
  • 0 : Midnight
  • 1 : Dawn
  • 2 : Morning
  • 3 : Afternoon
  • 4 : Dusk
  • 5 : Evening
Start Music Type (startmusictype) <boolean>
Music type of the safe room.
  • 0 : Mission Start
  • 1 : Check Point
Music Post-Fix String (musicpostfix) <string>
The musical theme of the map.

Portal 2 Portal 2

Paint in map (paintinmap) <boolean>
Allow paint to cover surfaces? Set to No to save resources for maps that don't use paint.
Max number of blobs (maxblobcount) <integer>
Maximum number of paint blobs. Should NOT exceed 250.
Note.pngNote:These two parameters might not appear if you have propper.fgd in Hammer.

Black Mesa Black Mesa

Under Water Particles (underwaterparticle) <string choices>
  • underwater_default : Rubbish
  • underwater_ion : Blue ions
  • underwater_tentacle_water : Tentacle feces water

Strata Source Strata Source

Maximum Projected Textures (maxprojectedtextures) <integer>
Maximum number of env_projectedtexture entities that can be enabled at once. Default 8; set lower to improve performance if necessary.
Warning.pngWarning:While this can be set higher than 8, doing so can be detrimental to performance.

SiN Episodes SiN Episodes

Arena Mode Time Limit ([todo internal name (i)]) <integer>
The number of seconds an arena mode map should last. (default: 900s (15 min))

Inputs

SetChapterTitle <string> (only in Mapbase)
Change the Chapter Title
ResponseContext:
AddContext <string>
Adds to the entity's list of response contexts. Format is <key>:<value>.
RemoveContext <string>
Remove a context from this entity's list. The name should match the key of an existing context.
ClearContext
Removes all contexts from this entity's list.


See also