Skip to content

ShelterVolume ​

Inherits: SpaceVolume < Area3D

A place that keeps the weather off: a cabin, a cave, a tent, a porch. Put it in a world scene (Add Object > Volumes > Shelter volume), give its CollisionShape3D the shape of the place and set what the shelter is in the Unique Object panel: how much of the weather it keeps off, whether it stops the exposed effects of the weather, how it changes the sound and which sound plays inside for each kind of weather. The panel has a menu of presets (Wooden cabin, Cave, Tent, and yours) that copy these settings into the volume. While the camera is inside, the weather weakens on the screen, the sound of the weather on the roof plays and the audio profile muffles the world; while an entity is inside it does not get the exposed effects of the weather (if the shelter stops them). See docs: World > Shelter.

Description ​

It only measures: rain stays off a roof by itself (the weather's particles land on any solid mesh). It does not touch anyone.

Properties ​

floatshelter_amount1.0
boolstops_effectstrue
AudioProfileaudio_profilenull
Array[ShelterWeatherSound]weather_sounds[]

Methods ​

floatget_amount()
boolprotects_from_effects()
ShelterWeatherSoundget_weather_sound( kind: String )
ShelterWeatherSoundfind_weather_sound( kinds: PackedStringArray )
PackedStringArrayvalidate()

Constants ​

  • float CHECK_INTERVAL = 0.1 - How often (seconds) the camera is checked, for the audio profile of the shelter
  • StringName GROUP = &"shelter_volumes" - The group every shelter volume is in (Shelter looks them up there)

Property descriptions ​

Shelter

float shelter_amount = 1.0 ​

How much of the weather it keeps off (0 to 1): the screen look of the weather is weakened by this much (a tent 0.6, a porch 0.8, a cabin or a cave 1)

bool stops_effects = true ​

Do the exposed effects of the weather (a burn, a Wet debuff) stop for whoever is inside? Off for a tent that only keeps the rain off

Sound

AudioProfile audio_profile = null ​

How the sound changes while the camera is inside: the muffle of the weather outside, echo. Empty = it does not change

Array[ShelterWeatherSound] weather_sounds = [] ​

The weather sounds of this shelter: a track for each kind of weather (the rain on the roof). A weather lists its kinds in its Sound group; the shelter plays the track of the first kind it has one for

Method descriptions ​

float get_amount() ​

How much of the weather this shelter keeps off (0 to 1)

bool protects_from_effects() ​

Does it stop the exposed effects of the weather for whoever is inside?

ShelterWeatherSound get_weather_sound( kind: String ) ​

The line for a kind of weather (null when the shelter has none)

ShelterWeatherSound find_weather_sound( kinds: PackedStringArray ) ​

The line for the first of these kinds that the shelter has a line for (a weather lists its kinds in order: sleet may list rain, then snow)

PackedStringArray validate() ​

The warnings of the settings of this shelter (the editor shows them)