Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment Settings

A program reads and writes the world’s environment settings, the ones the game’s environment dialog shows: the time of day, the sky’s color, the fog, the water’s height, the ambience.

Environment.<environment>.<property>            // read
Environment.<environment>.<property> = value    // write
in go: exec
on go {
  let t = Environment.Sky.TimeOfDay
  Environment.Sky.TimeOfDay = t + 1.0
  Environment.Sky.SkyColor = Color(1.0, 0.5, 0.0)
  Environment.Ambience.ReverbEffect = ReverbEffect.LongHallway
}

Contents

Reading and writing

  • Exec only. A read runs the Get Environment Property gate and a write the Set Environment Property gate, so both sit on an exec chain: a read outside a handler is WS007.
  • Names. An environment is named as the dialog labels it, without spaces (Environment.Ground), and a property by its name in the game. The editor completes both after Environment..
  • Types. Each property has its own type, listed below, and a write must fit it (WS003). Colors read and write as color.
  • What the game does with a write. The game converts and clamps a written value as the environment dialog would, and leaves a setting the dialog has locked alone.
  • Enum properties. A property backed by a game enum reads as an int (the member’s value) and takes either an int or a member of its enum when written. The members are listed at the end of this page.
  • Not every property is available. A property that holds an asset reference, an array or a structure with no Wirescript type is listed with the reason; reading or writing one is WS003.
  • Errors. An environment or property that does not exist is WS110, and Environment.Sky with no property is an error naming the properties it has.
  • Shadowing. A binding of the program’s own named Environment hides the builtin.

The list below is generated from the game build the compiler was built against (just doc-environment), so it changes with the game.

Reference

Environment.Ambience

The game’s Ambience environment.

PropertyReads and writes as
SelectedAmbienceTypenot available: an asset reference (class), which a property gate cannot carry yet
AmbienceVolumefloat
ReverbEffectint, or a ReverbEffect member

Environment.Ground

The game’s Ground environment (stored as GroundPlate).

PropertyReads and writes as
Variancefloat
VarianceBrickSizefloat
GroundColorcolor
GroundAccentColorcolor
IsVisiblebool
bUseStudTexturebool

Environment.Sky

The game’s Sky environment.

PropertyReads and writes as
TimeOfDayfloat
AnimateTimeOfDaybool
DayLengthfloat
NightLengthfloat
SunAnglefloat
SunScalefloat
SunHorizonScaleMultiplierfloat
SunlightColorcolor
SkyIntensityfloat
SkyColorcolor
MoonPhasefloat
MoonScalefloat
MoonlightIntensityfloat
MoonlightColorcolor
StarsIntensityfloat
StarsColorcolor
AuroraIntensityfloat
CloudCoveragefloat
Rainfloat
Snowfloat
Dustfloat
Thunderfloat
Windfloat
WindDirectionfloat
bCloseLightningbool
RainVolumefloat
CloseThunderVolumefloat
DistantThunderVolumefloat
WindVolumefloat
ClearFogDensityfloat
CloudyFogDensityfloat
ClearFogHeightFallofffloat
CloudyFogHeightFallofffloat
FogColorcolor

Environment.Lighting

The game’s Lighting environment (stored as Studio).

PropertyReads and writes as
Scenariosnot available: an array, which a property gate cannot carry

Environment.Universe

The game’s Universe environment.

PropertyReads and writes as
UniverseRotationrotator
UniverseLightColorcolor
UniverseLightIntensityfloat
UniverseAmbientColorcolor
UniverseAmbientIntensityfloat
UniverseGravityScalefloat
bUniverseFloorEnabledbool
NebulaTexturenot available: an asset reference (object), which a property gate cannot carry yet
NebulaColorcolor
NebulaRedBlueSwapfloat
NebulaSaturationfloat
NebulaPowerfloat
NebulaBrightnessfloat
NearStarsTexturenot available: an asset reference (object), which a property gate cannot carry yet
NearStarsPowerfloat
NearStarsBrightnessfloat
FarStarsTexturenot available: an asset reference (object), which a property gate cannot carry yet
FarStarsPowerfloat
FarStarsBrightnessfloat

Environment.Water

The game’s Water environment.

PropertyReads and writes as
WaterHeightfloat
WaterAbsorptionvector
WaterScatteringvector
WaterFogIntensityfloat
WaterFogAmbientColorcolor
WaterFogAmbientScalefloat
WaterFogScatteringColorcolor
WaterFogScatteringScalefloat

Enum members

ReverbEffect

Default (0), SmallRoom (1), LongHallway (2), ExteriorEcho (3)