DayZ 1.24
Loading...
Searching...
No Matches
ScriptLight.c
Go to the documentation of this file.
1#ifdef GAME_TEMPLATE
2
3[EditorAttribute("box", "GameLib/Scripted", "Script light", "-0.25 -0.25 -0.25", "0.25 0.25 0.25", "255 0 0 255")]
4class ScriptLightClass
5{
6
7}
8
9ScriptLightClass ScriptLightSource;
10
11class ScriptLight: GenericEntity
12{
13 [Attribute("1", "flags", "Flags", "", { ParamEnum("Point", "1"), ParamEnum("Spot", "2"), ParamEnum("Directional", "4") })]
14 int Flags;
15 [Attribute("1", "combobox", "Type", "", { ParamEnum("Point", "1"), ParamEnum("Spot", "2"), ParamEnum("Directional", "3") })]
16 int Type;
17 [Attribute("1", "editbox", "Radius", "", NULL)]
18 float Radius;
19 [Attribute("1 1 1", "color", "Color", "", NULL)]
20 vector Color;
21 [Attribute("1", "editbox", "Intensity", "", NULL)]
22 float Intensity;
23 HLIGHT m_light;
24
25 void ScriptLight(IEntitySource src, IEntity parent)
26 {
27 //SetFlags(this, EntityFlags.ACTIVE | EntityFlags.SOLID | EntityFlags.VISIBLE);
28 m_light = AddLight(this, LightType.POINT, LightFlags.DYNAMIC | LightFlags.CASTSHADOW, Radius, Color * Intensity);
29 }
30
31 void ~ScriptLight()
32 {
33 if (m_light)
34 RemoveLight(m_light);
35 }
36}
37
38#endif
string Type
float Radius
void ParamEnum(string key, string value, string desc="")
Definition EnEntity.c:808
void EditorAttribute(string style, string category, string description, vector sizeMin, vector sizeMax, string color, string color2="0 0 0 0", bool visible=true, bool insertable=true, bool dynamicBox=false)
Definition EnEntity.c:851
proto native bool RemoveLight(HLIGHT light)
removes light
int[] HLIGHT
Light handle.
Definition EnWorld.c:119
LightFlags
Definition EnWorld.c:130
proto HLIGHT AddLight(IEntity owner, LightType type, LightFlags flags, float radius, vector color)
LightType
Definition EnWorld.c:122