Dayz Explorer 1.28.160049
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 {
35 RemoveLight(m_light);
36 }
37 }
38}
39
40#endif
void ParamEnum(string key, string value, string desc="")
Definition enentity.c:811
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:856
proto native bool RemoveLight(HLIGHT light)
removes light
int[] HLIGHT
Light handle.
Definition enworld.c:122
LightFlags
Definition enworld.c:133
proto HLIGHT AddLight(IEntity owner, LightType type, LightFlags flags, float radius, vector color)
LightType
Definition enworld.c:125
string Type
float Radius