Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
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")]
4 class ScriptLightClass
5 {
6 
7 }
8 
9 ScriptLightClass ScriptLightSource;
10 
11 class 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  {
35  RemoveLight(m_light);
36  }
37  }
38 }
39 
40 #endif
LightType
LightType
Definition: enworld.c:121
IEntitySource
Definition: enentity.c:15
LightFlags
LightFlags
Definition: enworld.c:129
HLIGHT
int[] HLIGHT
Light handle.
Definition: enworld.c:119
IEntity
Definition: enentity.c:164
vector
Definition: enconvert.c:105
Radius
float Radius
Definition: undergroundarealoader.c:17
Attribute
Definition: enentity.c:823
EditorAttribute
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:854
RemoveLight
proto native bool RemoveLight(HLIGHT light)
removes light
AddLight
proto HLIGHT AddLight(IEntity owner, LightType type, LightFlags flags, float radius, vector color)
ParamEnum
void ParamEnum(string key, string value, string desc="")
Definition: enentity.c:8
Type
string Type
Definition: jsondatacontaminatedarea.c:11