DIFF

class ScriptedLightBaseSource

ScriptedLightBase EntityLightSource Entity ObjectTyped Object IEntity Managed

All members, including inherited

Constructors 2

void ScriptedLightBase()

Constructor. Everything here is executed before the constructor of all children.

void ~ScriptedLightBase()

Members 27

float m_LifetimeStart
Referenced by EOnFrame(), and ScriptedLightBase()
float m_LifetimeEnd = -1

-1 makes this light permanent

Referenced by AddLifetime(), CheckFadeOut(), CheckLifetime()
Show 1 more, SetLifetime()
float m_FadeOutTime = -1
float m_Radius
Referenced by EOnFrame(), FadeRadiusTo(), HandleRadiusFadeing()
Show 1 more, SetRadiusTo()
float m_RadiusTarget
float m_BrightnessPulse

flicker effect

float m_BrightnessPulseSpeed
float m_BrightnessPulseAmplitudeMax
float m_BrightnessPulseAmplitudeMin
float m_BrightnessSpeedOfChange = 1
float m_RadiusSpeedOfChange = 1
float m_OptimizeShadowsRadius = 0

Within this range between the light source and camera the shadows will be automatically disabled to save on performance

float m_BlinkingSpeed
protected int m_HiddenSelectionID
bool m_IsDebugEnabled = false
vector m_LocalPos

Local position to my attachment parent

vector m_LocalOri

Local orientation to my attachment parent

vector m_DancingShadowsLocalPos
ref Timer m_DeleteTimer
protected ref LightDimming m_LightDimming
static ref set<ScriptedLightBase> m_NightTimeOnlyLights = new set<ScriptedLightBase>()

Methods 55

override bool IsScriptedLight()
private void UpdateLightMode(string slotName)
Referenced by UpdateMode()
private void DeleteLightWithDelay()

Correct way of deleting light from memory. It is necesarry to have this delay due to hierarchy.

References DetachFromParent(), Timer.Run(), new Timer()
Show 1 more, m_DeleteTimer
Referenced by Destroy()
private void DeleteLightNow()
Referenced by Destroy()
void AttachOnObject(Object parent, vector local_pos = "0 0 0", vector local_ori = "0 0 0")

Attaches this light on the parent entity, with optional position and orientation offset.

Object GetAttachmentParent()

Returns attachment parent

References m_Parent
static ScriptedLightBase CreateLight(typename name, vector global_pos = "0 0 0", float fade_in_time_in_s = 0)

Creates an instance of light on the given position. Optionally, use fade_in_time_in_s parameter to make the light fade into existence.

void SetBrightnessTo(float value)

Sets the brightness of the light

Referenced by AlarmLight.AlarmLight(), AnniversaryBoxLight.AnniversaryBoxLight(), AnniversaryMainLight.AnniversaryMainLight()
Show 42 more, BlowtorchLight.BlowtorchLight(), BonfireLight.BonfireLight(), BrightnessTestLight.BrightnessTestLight(), BrightnessTestLight.OnFrameLightSource(), BuoyLight.BuoyLight(), CarLightBase.AggregateLight(), CarLightBase.SegregateLight(), CarRearLightBase.SetAsSegregatedBrakeLight(), CarRearLightBase.SetAsSegregatedReverseLight(), ChemlightLight.ChemlightLight(), EntranceLight.EntranceLight(), EntranceLightStairs1.EntranceLightStairs1(), ExplosionLight.ExplosionLight(), ExplosiveLight.ExplosiveLight(), FireplaceLight.FireplaceLight(), FlareLight.FlareLight(), FlashGrenadeLight.FlashGrenadeLight(), FlashlightLight.FlashlightLight(), GoatLight.GoatLight(), HeadtorchLight.HeadtorchLight(), LightDimming.SetDimmingVal(), MooringBuoyLight.MooringBuoyLight(), MuzzleFlashLight.MuzzleFlashLight(), MuzzleFlashLight_1.MuzzleFlashLight_1(), MuzzleFlashLight_2.MuzzleFlashLight_2(), PartyLight.PartyLight(), PersonalLight.PersonalLight(), PistollightLight.PistollightLight(), PortableGasLampLight.PortableGasLampLight(), Roadblock_Light.Roadblock_Light(), RoadflareLight.RoadflareLight(), FadeIn(), ShellLight.ShellLight(), SpotlightLight.SpotlightLight(), StoveLight.StoveLight(), TirePileLight.TirePileLight(), TorchLight.TorchLight(), UniversallightLight.UniversallightLight(), WarheadStorageLight.WarheadStorageLight(), XmasSleighLight.XmasSleighLight(), XmasTreeLight.XmasTreeLight(), and ZombieMummyLight.ZombieMummyLight()
void CorrectLightPulseDuringDaylight()

Call this after using SetBrightness(...) to fix light's intensity during daytime

void SetRadiusTo(float value)

Sets the radius of the light

Referenced by AlarmLight.AlarmLight(), AnniversaryBoxLight.AnniversaryBoxLight(), AnniversaryMainLight.AnniversaryMainLight()
Show 41 more, BlowtorchLight.BlowtorchLight(), BonfireLight.BonfireLight(), BrightnessTestLight.BrightnessTestLight(), BuoyLight.BuoyLight(), CarLightBase.AggregateLight(), CarLightBase.SegregateLight(), CarRearLightBase.SetAsSegregatedBrakeLight(), CarRearLightBase.SetAsSegregatedReverseLight(), ChemlightLight.ChemlightLight(), EntranceLight.EntranceLight(), EntranceLightStairs1.EntranceLightStairs1(), ExplosionLight.ExplosionLight(), ExplosiveLight.ExplosiveLight(), FireplaceLight.FireplaceLight(), FlareLight.FlareLight(), FlashGrenadeLight.FlashGrenadeLight(), FlashlightLight.FlashlightLight(), GoatLight.GoatLight(), HeadtorchLight.HeadtorchLight(), MooringBuoyLight.MooringBuoyLight(), MuzzleFlashLight.MuzzleFlashLight(), MuzzleFlashLight_1.MuzzleFlashLight_1(), MuzzleFlashLight_2.MuzzleFlashLight_2(), PartyLight.PartyLight(), PersonalLight.PersonalLight(), PistollightLight.PistollightLight(), PistollightLight.UpdateLightMode(), PortableGasLampLight.PortableGasLampLight(), Roadblock_Light.Roadblock_Light(), RoadflareLight.RoadflareLight(), ShellLight.ShellLight(), SpotlightLight.SpotlightLight(), StoveLight.StoveLight(), TirePileLight.TirePileLight(), TorchLight.TorchLight(), UniversallightLight.UniversallightLight(), UniversallightLight.UpdateLightMode(), WarheadStorageLight.WarheadStorageLight(), XmasSleighLight.XmasSleighLight(), XmasTreeLight.XmasTreeLight(), and ZombieMummyLight.ZombieMummyLight()
void SetLifetime(float life_in_s)

Makes the light destroy itself after the given time in seconds. The light will fade out if it's set to do so with SetFadeOutTime(...)

void SetFadeOutTime(float time_in_s)

Sets the fade out time in seconds. Fade out begins automatically as the light nears the end of its life time, or when method FadeOut() is called.

References m_FadeOutTime
Referenced by AlarmLight.AlarmLight(), BlowtorchLight.BlowtorchLight(), BonfireLight.BonfireLight()
Show 40 more, CarLightBase.CarLightBase(), CarRearLightBase.CarRearLight(), CarRearLightBase.SetAsSegregatedBrakeLight(), CarRearLightBase.SetAsSegregatedReverseLight(), CarScript.BrakeAndReverseRearLight(), ChemlightLight.ChemlightLight(), CivilianSedanFrontLight.CivilianSedanFrontLight(), CivilianSedanRearLight.CivilianSedanRearLight(), EntranceLight.EntranceLight(), ExplosionLight.ExplosionLight(), FireplaceLight.FireplaceLight(), FlareLight.FlareLight(), FlashlightLight.FlashlightLight(), GoatLight.GoatLight(), Hatchback_02FrontLight.Hatchback_02FrontLight(), Hatchback_02RearLight.Hatchback_02RearLight(), HeadtorchLight.HeadtorchLight(), MuzzleFlashLight.MuzzleFlashLight(), MuzzleFlashLight_1.MuzzleFlashLight_1(), MuzzleFlashLight_2.MuzzleFlashLight_2(), Offroad_02FrontLight.Offroad_02FrontLight(), Offroad_02RearLight.Offroad_02RearLight(), OffroadHatchbackFrontLight.OffroadHatchbackFrontLight(), OffroadHatchbackRearLight.OffroadHatchbackRearLight(), PartyLight.PartyLight(), PistollightLight.PistollightLight(), PortableGasLampLight.PortableGasLampLight(), Roadblock_Light.Roadblock_Light(), RoadflareLight.RoadflareLight(), Sedan_02FrontLight.Sedan_02FrontLight(), Sedan_02RearLight.Sedan_02RearLight(), SpotlightLight.SpotlightLight(), StoveLight.StoveLight(), TirePileLight.TirePileLight(), TorchLight.TorchLight(), Truck_01FrontLight.Truck_01FrontLight(), Truck_01RearLight.Truck_01RearLight(), UniversallightLight.UniversallightLight(), WarheadStorageLight.WarheadStorageLight(), and ZombieMummyLight.ZombieMummyLight()
void AddLifetime(float life_in_s)

Prolongs the lifetime of the light in seconds. Use negative number to shorten its lifetime.

References m_LifetimeEnd
void OnFrameLightSource(IEntity other, float timeSlice)

Override this for custom functionality

Referenced by EOnFrame()
override void EOnFrame(IEntity other, float timeSlice)

On frame event. If you want to control your light within your own rules then override the event OnFrameLightSource and put your code there.

float GetDancingShadowsAmplitude()

Returns max movement range of pointlight within the dancing shadow effect

float GetDancingShadowsMovementSpeed()

Returns max movement speed of pointlight within the dancing shadow effect

void EnableDebug(bool state)

Enables some debug functionality of this light

References m_IsDebugEnabled
void HandleFlickering(float time, float timeSlice)
Referenced by EOnFrame()
void SetFlickerAmplitudeMax(float coef)
void SetFlickerAmplitudeMin(float coef)
float GetFlickerSpeed()

Returns flicker speed

float GetFlickerAmplitudeCoefMax()

Returns flicker amplitude maximum

float GetFlickerAmplitudeCoefMin()

Returns flicker amplitude minimum

void TryShadowOptimization()

Optimizes shadows by disabling them on this light source while it's within the given radius around the camera.

Referenced by EOnFrame()
void SetDisableShadowsWithinRadius(float radius_in_m)

When the light source gets within this radius (radius_in_m) around the camera, then it's shadows are disabled.

float GetDisableShadowsWithinRadius()

Returns the range you put inside SetDisableShadowsWithinRadius(...)

private bool CheckLifetime(int current_time)
References Destroy(), and m_LifetimeEnd
Referenced by EOnFrame()
private void CheckFadeOut(int current_time)
Referenced by EOnFrame()
private void HandleBrightnessFadeing(float timeSlice)
Referenced by EOnFrame()
private void HandleRadiusFadeing(float timeSlice)
Referenced by EOnFrame()
void SetBlinkingSpeed(float _speed)

Sets blinking speed (no blinking if speed <= 0)

References m_BlinkingSpeed
float GetBlinkingSpeed()

Returns the speed of blinks

References m_BlinkingSpeed
private void HandleBlinking(float time)
Referenced by EOnFrame()
void EnableDimming(float baseBrightness, DimmingConfig dimCfg)
void StopDimming()
References m_LightDimming