WeatherEffect Definition

From Space Engineers Wiki
Jump to navigation Jump to search

Player info: Weather

Can spawn automatically through planet's <WeatherGenerators> or manually from chat commands.

Uses <Id>, <DisplayName> and <Public> from the common section. DisplayName being used by the weather LCD app and Public can be set to false to ignore the definition.

When a weather is requested, the SubtypeId is not case sensitive!
This means if a mod adds snowlight (vanilla adds a SnowLight first), then when something requests "snowlight" it will use the first one it finds that matches the letters without caring about letter case, which would be the vanilla SnowLight.

Sounds

AmbientSound

<AmbientSound>
Type: StringDefaultnull
Plays continuously during the weather.
SubtypeId (without Arc or Real prefix) of an audio definition (Audio_*.sbc).

AmbientVolume

<AmbientVolume>
Type: SingleDefault0
Maximum volume ratio (0 to 1) for <AmbientSound>.
The actual volume is affected by proximity to weather, its intensity progress, dimmed if inside a closed cockpit, dimmed depending on how much you're surrounded by grids. Then dimmed some more by closed helmet (only for realistic sound).

Fog

FogColor

<FogColor>
Type: Vector3DefaultX:0 Y:0 Z:0
Color of the fog.
Example syntax:
<SunColor>
  <X>0.0</X>
  <Y>0.0</Y>
  <Z>0.0</Z>
</SunColor>
Where X/Y/Z = R/G/B, values from 0.0 to 1.0.

FogDensity

<FogDensity>
Type: SingleDefault0
Affects multiple things on the fog. Start from very tiny values.

FogMultiplier

<FogMultiplier>
Type: SingleDefault0

FogAtmoMultiplier

<FogAtmoMultiplier>
Type: SingleDefault0
How much the fog affects the atmospheric fog.
Requires <FogDensity> to not be 0.

FogSkyboxMultiplier

<FogSkyboxMultiplier>
Type: SingleDefault0
How much the fog affects the space background image.

Hazards

LightningIntervalMin

<LightningIntervalMin>
Type: SingleDefault0
Minimum seconds between visual-only lightning strikes.

LightningIntervalMax

<LightningIntervalMax>
Type: SingleDefault0
Maximum seconds between visual-only lightning strikes.

LightningCharacterHitIntervalMin

<LightningCharacterHitIntervalMin>
Type: SingleDefault0
Minimum seconds between lightning strikes that target players (ignores animals/bots).

LightningCharacterHitIntervalMax

<LightningCharacterHitIntervalMax>
Type: SingleDefault0
Maximum seconds between lightning strikes that target players (ignores animals/bots).

LightningGridHitIntervalMin

<LightningGridHitIntervalMin>
Type: SingleDefault0
Minimum seconds between lightning strikes that target grids.
See <LightningGridHitIntervalMax> for more details.

LightningGridHitIntervalMax

<LightningGridHitIntervalMax>
Type: SingleDefault0
Maximum seconds between lightning strikes that target grids.

Valid targets are searched at the weather position within the weather radius, and ignores respawn ships, immune and projections.

Then a single random grid is picked and then a single random block is picked as the target position.

Lightning

<Lightning>
Type: WeatherLightningDefaultnull
The settings for each lightning strike.

Each lightning strike regardless of targeted or not will be checking for nearby trees (hardcoded 20m), decoys or antennas in that order. Decoys and antennas have radius in their own definitions.

If a targeted lightning can't find its type of target, it will fall back to random anywhere in the weather radius and will deal no damage.

Then once the final target is picked, a raycast from 50m above goes down to hit anything else on the way, then repeats the process above with checking nearby trees/decoys/antennas.

Finally, if the position is under the original voxel surface it will cancel the lightning strike.

<Damage>Type: Int32Default0
The amount of explosive damage the lightning strike deals, but only if it was a player-targetting or grid-targetting one which found its target. If it was a visual one that stumbled on a tree/decoy/antenna then it still won't use the damage.
Requires <ExplosionRadius> to be not 0.
<ExplosionRadius>Type: SingleDefault1
The explosion at the strike location regardless of damage (it can have no damage if it's not meant to damage).
Explosion completely disabled if this is 0.
<BoltImpulseMultiplier>Type: SingleDefault1
Impulse multiplier for the explosion pushing objects outwards.
<Sound>Type: StringDefaultWM_Lightning
Played at the target position.

SubtypeId (without Arc or Real prefix) of an audio definition (Audio_*.sbc).

Volume varies based on surrounding grids.
<MaxLife>Type: Int16Default7
Visual only; How long an individual strike lasts, in game ticks (60 ticks per second).
<BoltLength>Type: SingleDefault5000
Visual only; Total length in meters.
<BoltParts>Type: byteDefault50
Visual only; How many individual segments it has.
<BoltVariation>Type: Int16Default100
Visual only; How far away each bolt segment can randomly go, maximum in meters.
<BoltRadius>Type: SingleDefault30
Visual only; Maximum segment thickness (meters) at the very top, it gets thinner the more it reaches the target, all the way down to 1/<BoltParts> as a multiplier.
<Color>Type: Vector4Default100,100,100,1000
Color of the lightning bolt.
Usage:
<Color>
  <X>0.5</X>
  <Y>0.2</Y>
  <Z>1.0</Z>
  <W>0.25</W>
</Color>
Where X/Y/Z/W = Red/Green/Blue/Alpha.
Example:
<Lightning>
  <Damage>0</Damage>
  <ExplosionRadius>1</ExplosionRadius>
  <BoltImpulseMultiplier>1</BoltImpulseMultiplier>
  <Sound>WM_Lightning</Sound>
  <MaxLife>7</MaxLife>
  <BoltLength>5000</BoltLength>
  <BoltParts>50</BoltParts>
  <BoltVariation>100</BoltVariation>
  <BoltRadius>30</BoltRadius>
  <Color>
    <Y>100</Y>
    <Z>100</Z>
    <W>1000</W>
  </Color>
</Lightning>

HealthHazard

<HealthHazard>
Type: HealthHazardSourceDefaultnull
Optional. Damage over time to players standing in this weather.

Contains more elements:

<MinWeatherIntensity>Type: SingleDefault0.5
Minimum weather intensity at which the player starts to get damage.
Intensity varies based on player distance and altitude from the weather, as well as weather lifespan.
<DamageIntervalMin>Type: SingleDefault1
Seconds chosen randomly between this and <DamageIntervalMax> to wait between damage events.
<DamageIntervalMax>Type: SingleDefault60
Seconds chosen randomly between <DamageIntervalMin> and this to wait between damage events.
<DamageAmountMin>Type: SingleDefault1
Damage chosen randomly between this and <DamageAmountMax> to deal on every damage event.
Negative does not heal the player.
<DamageAmountMax>Type: SingleDefault10
Damage chosen randomly between <DamageAmountMin> and this to deal on every damage event.
Negative does not heal the player.
<DamageSoundOverride>Type: StringDefaultnull
Optional. Overrides the character's pain sound with this sound when taking damage from this weather. SubtypeId (without Arc or Real prefix) of an audio definition (Audio_*.sbc).
<ShowNotification>Type: BooleanDefaulttrue
Determines if <HazardNotification> is used.
Example:
<HealthHazard>
  <MinWeatherIntensity>0.5</MinWeatherIntensity>
  <DamageIntervalMin>10</DamageIntervalMin>
  <DamageIntervalMax>120</DamageIntervalMax>
  <DamageAmountMin>5</DamageAmountMin>
  <DamageAmountMax>40</DamageAmountMax>
  <DamageSoundOverride>ImpHail</DamageSoundOverride>
  <ShowNotification>true</ShowNotification>
</HealthHazard>

HazardNotification

<HazardNotification>
Type: HazardNotificationDataDefaultnull
Optional. HUD notification to be shown to players being damaged by <HealthHazard> only.

Contains more elements:

<Text>Type: StringDefaultNotification_WeatherDamage
Text to be shown. Can be raw text, can be localization key or can contain text variables too.
<Font>Type: StringDefaultRed
Text font style and color, can only be: White, Red, Green.
<Duration>Type: StringDefault5
Seconds to keep the notification on screen.
<Cooldown>Type: StringDefault120
Seconds to prevent this notification from showing up again.
Example:
<HazardNotification>
  <Text>Notification_WeatherDamage_HailImpact</Text>
  <Font>Red</Font>
  <Duration>5</Duration>
  <Cooldown>10</Cooldown>
</HazardNotification>

RadiationHazard

<RadiationHazard>
Type: RadiationHazardSourceDefaultnull
Optional. Radiation over time to players standing in this weather.

Contains more elements:

<MinWeatherIntensity>Type: SingleDefault0.1
Minimum weather intensity required (0 to 1) before starting to apply <RadiationGain>.
Weather intensity varies based on player distance and altitude from the weather.
<RadiationGain>Type: SingleDefault0
Radiation per second. Default radiation stat goes up to 100.

Negative value will cleanse radiation instead.

The final value is reduced if weather intensity is not full at the player position (multiplied by weather intensity).
Example:
<RadiationHazard>
  <MinWeatherIntensity>0.5</MinWeatherIntensity>
  <RadiationGain>0.3</RadiationGain>
</RadiationHazard>

Atmosphere Multipliers

WindOutputModifier

<WindOutputModifier>
Type: SingleDefault1
Wind multiplier for blocks that require it (wind turbines, etc).

FoliageWindModifier

<FoliageWindModifier>
Type: SingleDefault1
Wind multiplier for foliage (grass, bushes, trees and any other material that uses the wind properties).

SolarOutputModifier

<SolarOutputModifier>
Type: SingleDefault1
Sunlight multiplier for blocks that require it (solar panels, oxygen farms, etc).

OxygenLevelModifier

<OxygenLevelModifier>
Type: SingleDefault1
Oxygen multiplier to planet's <OxygenDensity>.

TemperatureModifier

<TemperatureModifier>
Type: SingleDefault1
Temperature multiplier. Visit the Temperature reference page for details on how the temperature is calculated.

SunColor

<SunColor>
Type: Vector3DefaultX:0 Y:0 Z:0
Weak additive Sun light and Sun sprite color.

For example if planet's <SunColor> were 0,1,0, this would need 3,0,0 to make it yellow.

Example syntax:
<SunColor>
  <X>0.0</X>
  <Y>0.0</Y>
  <Z>0.0</Z>
</SunColor>
Where X/Y/Z = R/G/B.

SunIntensity

<SunIntensity>
Type: SingleDefault150
Sets the Sun light and Sun sprite intensity, same unit as environment's <SunIntensity>.

SunSpecularColor

<SunSpecularColor>
Type: Vector3DefaultX:0 Y:0 Z:0
Supposedly Sun's color when reflecting off surfaces, but does not seem to function even at high values.

Does not affect the Sun sprite.

Example syntax:
<SunSpecularColor>
  <X>0.0</X>
  <Y>0.0</Y>
  <Z>0.0</Z>
</SunSpecularColor>
Where X/Y/Z = R/G/B.

Particle Effects

ParticleCount

<ParticleCount>
Type: Int32Default0
How many of the particle effects (<EffectName>) to have at one time.
0 to not use any particles.

EffectName

<EffectName>
Type: StringDefaultnull
The particle effect that spawns around the camera.

SubtypeId of a ParticleEffect definition (Particles_*.sbc).

The particles's "Soft particle distance scale" and "Camera Soft Radius" properties will be multiplied by the weather when the player is inside grids or cockpits, to reduce the particle's perceived leaking.

ParticleRadius

<ParticleRadius>
Type: SingleDefault0
Maximum radius around the camera (offset by velocity) where to spawn the particles.

ParticleScale

<ParticleScale>
Type: SingleDefault0
Scale multiplier for the particle effect (UserScale).

(Top) | From DefinitionBase:

Common

Id

<Id>
Type: SerializableDefinitionIdDefault(invalid)
The type and subtype combined make up a unique identifier for this definition.

If two definitions use the same Type+Subtype (Subtypes are only unique per Type), then the last to load will override the first one(s). For more details see Things to know about SBC.

<TypeId>Type: stringDefault(invalid)
Must be an existing type with or without the "MyObjectBuilder_" prefix.

Some types require an xsi:type, refer to the vanilla files for the exact pairing.

TypeId vs xsi:type
<SubtypeId>Type: stringDefault(empty)
This can be invented and only needs to be unique per TypeId.

Vanilla game re-uses some subtypes over multiple types (e.g. Iron is used for Ore type and Ingot type).

An empty value is also a valid subtype (which vanilla also uses on at least 5 blocks).
Type (attribute[1])Type: stringDefault(invalid)
Same behavior as <TypeId>, do not define both.
Subtype (attribute[1])Type: stringDefault(empty)
Same behavior as <SubtypeId>, do not define both.
Example:
<Id>
  <TypeId>CubeBlock</TypeId>
  <SubtypeId>FancyTable</SubtypeId>
</Id>

Because it has attribute alternatives it can also be declared as:

<Id Type="CubeBlock" Subtype="FancyTable" />

DisplayName

<DisplayName>
Type: StringDefaultnull
If the object defined here is visible anywhere in the game GUI, this would be the name shown for it. In cases where it is used, it is very much required.

Can be plain-text.
If the text contains DisplayName_ then:

Description

<Description>
Type: StringDefaultnull
Optional. If the object defined here is shown with a description in the game GUI (Hotbar/G-menu, HUD, etc) then this is the place to write it.

Can be plain-text.
If the text contains Description_ then:

If the final text (plain, localized or variable-replaced) contains {0}, {1}, etc, then they will replaced by kb&m control binds defined in <DescriptionArgs>.

DescriptionArgs

<DescriptionArgs>
Type: StringDefaultnull
Optional. A comma-separated list of control IDs which are referenced in <Description> by {number} tags, which then get replaced by the keyboard or mouse bind that the viewer has for those controls.
Example:
<Description>Press {0} to fire, {1} to change color, {2} to interact.</description>
<DescriptionArgs>PRIMARY_TOOL_ACTION,CUBE_COLOR_CHANGE,USE</DescriptionArgs>

And each player will see their current binds for those actions.

The control IDs can be found in your %appdata%/SpaceEngineers/SpaceEngineers.cfg at the ControlsButtons section.

Icon

<Icon>
Type: String[]Defaultnull
Icon(s) for the definition which may or may not be used depending on the definition type.

Path to a .dds or .png file relative to current mod's folder. Falls back to game folder if not found in current mod. Referencing assets in other mods

Can be declared multiple times which will stack icons on top of eachother, however it will not work for all definitions.

Known definitions to work or not work with multiple icons
  • Working: Blocks, BlockVariantGroups and component items seen in G-menu, BlockInfo (HUD right side) and toolbars; Blueprints in terminal production tab; Blocks and PhysicalItems in gamepad HUD.
  • Partial: Blocks seen in terminal.
  • Not working: HandItems (uses PhysicalItem's icon instead); Blocks and BlockVariantGroups seen in build planner, radial menu and some economy GUIs; PhysicalItems in economy GUIs and stores; Prefabs in stores; BlueprintClass (tabs) in terminal production tab; BankingSystemDefinition (Game\BankingSystem.sbc); Emotes (both kinds of definitions) in gamepad HUD; Block skins; RespawnShips.
  • Special cases: Economy contracts, FactionIcons Definition.

DLC

<DLC>
Type: String[]Defaultnull
Optional. The DLC subtypeId that this definition will require.

For the IDs, refer to <SE>\Content\Data\Game\DLCs.sbc.
Can be declared multiple times to require multiple DLCs.

Most definition types won't check for this, the ones that do: blocks, emotes and possibly anything else that can be placed in the toolbar.

AvailableInSurvival

<AvailableInSurvival>
Type: BooleanDefaulttrue
Depends on the definition if it uses this, and if it does then this determines whether it can be accessible in survival game mode.

Currently known definitions that do use this:

Public

<Public>
Type: BooleanDefaulttrue
If the definition is visible or accessible in some cases.
For blocks, this only hides them and they can still be built using projectors and other means.

Enabled

Enabled (attribute[1])
Type: BooleanDefaulttrue
If set to false it will remove the definition after it's been loaded.
Example usage:
<Definition Enabled="false">

The "Definition" above is the opening element that for the entire definition, not an inner node like <DisplayName> is.
The opening node can have a different name for other definitions, some examples <Component>, <Blueprint>, etc.

Note: One known case where it doesn't "fully" remove a definition is removing another mod's blocks only for one size, leaving the other size referencing the removed definition. The solution to that is to append something to the <BlockPairName> to make it unique and not link itself with the other size anymore. The block is otherwise removed from other systems: cannot be found in blocks menu and pasting a blueprint that had the block spawns without it (which is good).

xsi:type

xsi:type (attribute[1])
Type: stringDefaultnull

Name of an object that this definition will be deserialized as.
Sometimes required, depends on the definition. The wiki page for any given definition will mention at the top what xsi:type it requires, if any. The game's sbc files are also a reference on what xsi:types are required for a given definition.

This attribute is available on all elements and comes from the XML specification. This game relies on this attribute to change which sub-definition object is used to deserialize that element's contents. It's what allows, for example, a thruster to have unique elements (such as <MinPlanetaryInfluence>) that no other block definitions have.

For more details on how this relates to the TypeId, and usage examples, see: Things to know about SBC - TypeId vs xsi:type.

Obsolete Elements

Elements that exist in the game code or vanilla SBC, but do nothing

Note: this list only contains root-level from this definition only, nothing from inherited ones.

<ShadowFadeout>Type: SingleDefault0
Not used.
<ParticleAlphaMultiplier>Type: SingleDefault0
Not used.
<LightningColor>Type: -Default-
Found in SBC but does not exist in game code, therefore it's not used.
The color can however be set at <Lightning>'s <Color>.
<LightningRodSafetyRadius>Type: -Default-
Found in SBC but does not exist in game code, therefore it's not used.
This functionality is however configurable per-block: RadioAntenna Definition (section LightningRodRadiusLarge) and Decoy Definition (section LightningRodRadiusLarge).