BP_Coala_Weather_System

Description:

This blueprint regulates the weather, the sun and the moon.

It needs a "BP_Sky_Sphere_Coala" and a "DirectionalLight". Both must be referenced in the setup (see Weather Configuration).

Sun and moon always align themselves opposite to the "DirectionalLight".

This blueprint handles the adjustment of the SkySphere. Warning: Values set in the SkySphere will be overwritten!

Variables:

Setup:

SkySphere:

Reference of a "BK_Sky_Sphere_Coala" actor. This must be in the scene.

SunDirectionalLight:

Reference of a "DirectionalLight" actor. This must be in the scene.


Dev:

Hours:

Adjustment for the current hours. This will be overwritten by BeginPlayer, if "UseDevmode" is not activated.

Minutes:

Adjustment for the current minutes. This will be overwritten by BeginPlayer, if "UseDevmode" is not activated

UseDevmode:

Will ignore the system time and use the adjusted time instead.

DevMoonPhase:

Adjustment for the current moon phase. This will be overwritten by BeginPlayer, if "UseDevmode" is not activated


Sun:

UseSunMesh:

Use a sun mesh or show a sun from "BP_Sky_Sphere_Coala". This is a material.

CoalaSunScale:

Scale the size of the mesh sun.

CoalaSunBrightness:

Set the brightness of the sun material.

CoalaSunDistance:

Set the distance of the sun mesh.

CoalaSunIntensity:

Reference for the sun intensity curve. Should be between 0 and 24.

CoalaSunColor:

Reference for the sun color curve. Should be between 0 and 24.


Night:

StarBightness:

Set the star brightness.


Moon:

Because mobile devices only provide one light source, there is a moment when the light switches from the sun to the moon.

This moment should be chosen in a way that the user does not notice it.

UseMoonMesh:

Use a moon mesh.

CoalaMoonScale:

Scales the size of the moon mesh.

CoalaMoonDistance:

Sets the distance of the moon mesh.

CoalaMoonStartPostion:

Sets the starting position of the moon. The moon is static.

MoonHoursFrom:

Start time of the moon in hours.

MoonMinutesFrom:

Start time of the moon in minutes.

MoonHoursTo:

End time of the moon in hours.

MoonMinutesTo:

End time of the moon in minutes.


Distance Fog:

To mask far away objects, the project settings have to be changed to “Custom Depth-Stencil Pass” - > “Enabled with Stencil."

Also the mesh has to own a custom pass. theBitMask value can be changed in "MPC-> FogBitMask".

Use Fog:

A bool to turn the fog on/off.

Fog Color:

Reference to the fog color curve. values should range from 0 to 24.

Fog Height:

Height of the fog

Fog Start Distance:

Start distance of the fog

FogHorizon Falloff:

Strength of the horizon fading.

Fog DensityDistance:

Distance of the fog

CoalaHorizontColor:

Reference for the horizon color curve. Should be between 0 and 24.

CoalaZenithColor:

Reference for the zenith color curve. Should be between 0 and 24.

HorizonFalloffFrom:

Start of horizon.

HorizonFalloffTo:

End of horizon.


Clouds:

CoalaCloudColor:

Reference for the cloud color curve. Should be between 0 and 24.

CoalaCloudSpeed:

Cloud speed.

CoalaCloudOpacity:

Cloud opacity.


Snow:

ParticleSystem:

Particle system for snow.

OverrideParticleColor:

Override for particle color of snow.

ParticleColor:

Particle color for snow.

ParameterColorName:

Parameter Name to recolor the particle effect. Is only used if "OverrideParticleColor" is true.

Fog:

ParticleSystem:

Particle system for fog.

OverrideParticleColor:

Particlefarbe ĂĽberschreiben.

ParticleColor:

Particle color for Fog.

ParameterColorName:

Parameter Name to recolor the particle effect. Is only used if "OverrideParticleColor" is true.

Rain:

ParticleSystem:

Particlesystem fĂĽr Regen.

OverrideParticleColorSnow:

Particlefarbe ĂĽberschreiben.

ParticleColor:

Particle color for Rain.

ParameterColorName:

Parameter Name to recolor the particle effect. Is only used if "OverrideParticleColor" is true.

Intern:

CurrentWeather:

Current weather.

WeatherIsChanging:

The weather is currently changing

Coala_Bp:

Reference for BP_coala

DayNightCycleIsRunning:

Day/night cycle is currently running.


Functions:

ConstructionScript (default):

The construction script is handling the scaling and the updating of the sun/moon SkySphere.

SetDirectionLightPostion:

Sets the rotation of the directional light according to time.

Input :

Hours:Intenger

Minutes:Intenger

SetupSkySphere:

Prepares the SkySphere.

SetSunMoonIntensity:

Update of the DirectionalLight intensity and color.

Input :

DirectionalLight:DirectionalLight

IntensityCurve:CurveFloat

ColorCurve:CurveFloat

Hours:Integer

SetSunMoonIntensity:

Input :

Selection:Weathertype

SetFogColor:

Sets the color of the Fog.

SetFog:

Sets the settings.

GetMoonPostion:

Gives back the moon position.

Input :

Hours:Integer

Minutes:Integer

Output :

InMoonPhase:Boolean

MoonRotation:Rotator

SetMoonOpacity:

Sets the opacity of the moon. Is needed to simulate the rise and decline of the moon. As the moon is only at one position, it "fades" in this way.

Input :

Hours:Integer

Minutes:Integer

IsMoonArise:

Shows, if the moon is rising or declining.

Input :

Hours:Integer

Output :

Arise:Boolean

IsMoonShowing:

Shows, if the moon is showing or not.

Input :

Hours:Integer

Minutes:Integer

Output :

Arise:Boolean

SetMoonPhaseFn:

Function to set the moon phase.

Input :

MoonPhase:MoonPhase

Events:

BeginPlay (default):

Attaches the SkySphere to the Player.

Tick(default):

Updates the weather system every 30sec.

SetMoonPhase:

Event to set the MoonPhase

ToChangeWeather:

Event to change the weather.

Input :

Selection:WetterType

CallDayNightCycle (Editor):

Starts a day/night transition.

UpdateSunManually(Editor):

Updates the weather system manually. Should be clicked, after the curves are adjusted. The camera should also be moved, so the frame can updated itself. Should only be used in playmode, when outside of the player ("Eject").

StartRain(Editor):

To start rain.

StartSnow(Editor):

To start snow.

StartMist(Editor):

To start fog.