69 if (!IsVisibleDuringDaylight())
72 if (player && player.m_UndergroundPresence)
73 SetVisibleDuringDaylight(
true);
89 item.GetInventory().GetCurrentInventoryLocation( il );
115 m_DeleteTimer.Run( 0.03 ,
this,
"DeleteLightNow", NULL,
true);
149 SetOrientation(local_ori);
151 parent.AddChild(
this, -1);
164 if (parent.MemoryPointExists(memory_point_start))
166 m_LocalPos = parent.GetMemoryPointPos(memory_point_start);
169 if (memory_point_target !=
"" )
171 if (parent.MemoryPointExists(memory_point_target))
173 vector target_pos = parent.GetSelectionPositionLS(memory_point_target);
179 ErrorEx(
"memory point 'memory_point_target' not found when attaching light");
187 ErrorEx(
"memory point 'memory_point_start' not found when attaching light");
201 if ( !
m_Parent.ToDelete() && !ToDelete() )
215 if (target.MemoryPointExists(memory_point_start))
218 light.AttachOnMemoryPoint(target, memory_point_start, memory_point_target);
234 Error(
"Error! Light entity of name " +
name.ToString() +
" cannot be spawned! This name is incorrect or not inherited from ScriptedLightBase." );
238 if (fade_in_time_in_s != 0)
240 light_instance.FadeIn(fade_in_time_in_s);
247 Error(
"An instance of ScriptedLightBase was attempted to spawn on server side! Lights are CLIENT SIDE ONLY!");
251 return light_instance;
272 float brightness_compesation = 1 / v;
274 SetBrightness(compenset_brightness);
349 float time_in_ms = time_in_s * 1000;
467 for (
int i = 0; i < 3; i++ )
572 SetCastShadow(
false);
611 EntityAI parent2 = parent_EAI.GetHierarchyParent();
613 if (parent2 && parent2.GetInventory())
615 is_in_cargo = parent2.GetInventory().IsInCargo();
652 float time_left_in_s = (
m_LifetimeEnd - current_time) * 0.001;
743 multiplier = (multiplier + 1)/2;
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
InventoryLocationType
types of Inventory Location
void LightDimming(ScriptedLightBase light, float baseBrightness, DimmingConfig dimCfg)
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void SetEnabled()
prevents insider adding in the wrong position, HOTFIX
void SetRadius(float radius)
proto int GetTime()
returns mission time in milliseconds
proto native void ObjectDelete(Object obj)
void HandleBrightnessFadeing(float timeSlice)
float m_BrightnessPulseSpeed
Object GetAttachmentParent()
Returns attachment parent.
void EnableDimming(float baseBrightness, DimmingConfig dimCfg)
void HandleBlinking(float time)
void UpdateLightSourceMaterial(string path)
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 t...
void FadeIn(float time_in_s)
Makes the light fade into existence. Works only at the moment the light is created....
float m_BrightnessSpeedOfChange
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 li...
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 OnFra...
void ~ScriptedLightBase()
void TryShadowOptimization()
Optimizes shadows by disabling them on this light source while it's within the given radius around th...
void HandleRadiusFadeing(float timeSlice)
void SetBrightnessTo(float value)
Sets the brightness of the light.
float m_RadiusSpeedOfChange
void DeleteLightWithDelay()
Correct way of deleting light from memory. It is necesarry to have this delay due to hierarchy.
static ScriptedLightBase CreateLightAtObjMemoryPoint(typename name, notnull Object target, string memory_point_start, string memory_point_target="", vector global_pos="0 0 0", float fade_in_time_in_s=0)
static ref set< ScriptedLightBase > m_NightTimeOnlyLights
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 ma...
override bool IsScriptedLight()
void SetDancingShadowsMovementSpeed(float speed_in_meters_per_frame)
Sets the maximum speed of the point light within the dancing shadows effect.
float GetDisableShadowsWithinRadius()
Returns the range you put inside SetDisableShadowsWithinRadius(...)
float GetBlinkingSpeed()
Returns the speed of blinks.
float m_BrightnessPulseAmplitudeMax
void HandleDancingShadows(float time, float timeSlice)
void SetBlinkingSpeed(float _speed)
Sets blinking speed (no blinking if speed <= 0)
void AddLifetime(float life_in_s)
Prolongs the lifetime of the light in seconds. Use negative number to shorten its lifetime.
void Destroy()
Switches off the light and deletes it from memory.
void SetDancingShadowsAmplitude(float max_deviation_in_meters)
Sets the maximum range of the point light within the dancing shadows effect.
void CheckIfParentIsInCargo()
void DetachFromParent()
Detaches this light from its parent entity.
void ScriptedLightBase()
Constructor. Everything here is executed before the constructor of all children.
float GetFlickerAmplitudeCoefMin()
Returns flicker amplitude minimum.
ref LightDimming m_LightDimming
LightDimming GetDimming()
void SetFlickerSpeed(float speed)
Sets speed of light flickering (random brightness coefficient change per second)
void SetFlickerAmplitudeMax(float coef)
override void EOnInit(IEntity other, int extra)
float GetDancingShadowsAmplitude()
Returns max movement range of pointlight within the dancing shadow effect.
void AttachOnMemoryPoint(Object parent, string memory_point_start, string memory_point_target="")
Attaches this light on the parent entity's memory point, with optional direction target memory point.
float GetDancingShadowsMovementSpeed()
Returns max movement speed of pointlight within the dancing shadow effect.
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.
vector m_DancingShadowsLocalPos
float m_OptimizeShadowsRadius
float GetFlickerSpeed()
Returns flicker speed.
void CorrectLightPulseDuringDaylight()
Call this after using SetBrightness(...) to fix light's intensity during daytime.
void SetFlickerAmplitude(float coef)
Sets the change coefficient of flickering light. (0.0 - 1.0 values, result of greater values are peri...
float GetFlickerAmplitudeCoefMax()
Returns flicker amplitude maximum.
void HandleFlickering(float time, float timeSlice)
void SetRadiusTo(float value)
Sets the radius of the light.
void FadeOut(float time_in_s=-1)
Starts the fade out process and destroys the light when its done. Optional parameter allows you to se...
void FadeBrightnessTo(float value, float time_in_s)
Fades the brightness of the light to the given value.
void SetFlickerAmplitudeMin(float coef)
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 ...
void OnFrameLightSource(IEntity other, float timeSlice)
Override this for custom functionality.
void SetSelectionID(int id)
void FadeRadiusTo(float value, float time_in_s)
Fades the radius of the light to the given value.
float m_BrightnessPulseAmplitudeMin
void EnableDebug(bool state)
Enables some debug functionality of this light.
void CheckFadeOut(int current_time)
float m_DancingShadowsSpeed
void UpdateLightMode(string slotName)
bool CheckLifetime(int current_time)
float m_DancingShadowsAmplitude
bool IsInCargo()
Returns true if this Inventory owner is in cargo of something.
script counterpart to engine's class Inventory
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetType()
returns type of InventoryLocation
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
void SetParticleParam(int parameter_id, float value)
Set the value of a parameter of all emitors in the particle.
Legacy way of using particles in the game.
static const int DEBUG_DOT
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
proto native void SetPosition(vector position)
Set the world position of the Effect.
proto native void Destroy()
Cleans up the Effect, including unregistering if needed.
EntityEvent
Entity events for event-mask, or throwing event from code.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Round(float f)
Returns mathematical round of value.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto float Sin(float angle)
Returns sinus of angle in radians.
static proto float AbsFloat(float f)
Returns absolute value.
class JsonUndergroundAreaTriggerData GetPosition