DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
EnEntity.c
Go to the documentation of this file.
1typedef int[] BaseContainer;
2typedef int[] IEntitySource;
3typedef int[] WidgetSource;
4
6{
7 proto native owned string GetClassName();
8 proto native owned string GetName();
9 proto native int VarIndex(string varName);
10 proto native bool IsVariableSet(int varIndex);
11 proto bool IsType(int varIndex, typename type);
12 proto bool Get(int varIndex, out void val);
13};
14
16{
17 proto native IEntitySource GetChildren();
18 proto native IEntitySource GetSibling();
19 proto native IEntitySource GetParent();
20};
21
23{
24 proto native WidgetSource GetChildren();
25 proto native WidgetSource GetSibling();
26 proto native WidgetSource GetParent();
27};
28
42
45{
48
56
63
70
76
82
83//Only with MeshObject
84//ANIMEND - End of AF_ONCE animation, extra = slot number 0...11
85//ANIMBLEND - Animation blended from previous one, extra = slot number 0...11
86
87
88//SOUNDEND - playing of SFL_ONCE sound has ended
89// extra = pointer to a sound handle
90
91//USER
92
103
108
110 ALL
112
115{
120 VISIBLE,
121
122
127
134
137
143
151
158 USER6
160
165{
166//DO NOT INSERT ANYTHING BELOW - order of event methods matters!
171 event protected void EOnTouch(IEntity other, int extra)
172 {
173 }
174 event protected void EOnInit(IEntity other, int extra)
175 {
176 }
177 event protected void EOnExtra(IEntity other, int extra)
178 {
179 }
180 event protected void EOnNotVisible(IEntity other, int extra)
181 {
182 }
183 event protected void EOnFrame(IEntity other, float timeSlice)
184 {
185 }
186 event protected int EOnVisible(IEntity other, int extra)
187 {
188 }
189 event protected void EOnPostFrame(IEntity other, int extra)
190 {
191 }
192 event protected void EOnWorldProcess(IEntity other, int extra)
193 {
194 }
195 event protected void EOnAnimEvent(IEntity other, AnimEvent extra)
196 {
197 }
198 event protected void EOnSoundEvent(IEntity other, SoundEvent extra)
199 {
200 }
201 event protected void EOnSimulate(IEntity other, float dt)
202 {
203 }
204 event protected void EOnPostSimulate(IEntity other, float timeSlice)
205 {
206 }
207 event protected void EOnJointBreak(IEntity other, int extra)
208 {
209 }
210 event protected void EOnPhysicsMove(IEntity other, int extra)
211 {
212 }
213 event protected void EOnContact(IEntity other, Contact extra)
214 {
215 }
216 protected void EOnUser0(IEntity other, int extra)
217 {
218 }
219 protected void EOnUser1(IEntity other, int extra)
220 {
221 }
222 event protected void EOnEnter(IEntity other, int extra)
223 {
224 }
225 event protected void EOnLeave(IEntity other, int extra)
226 {
227 }
228 protected void EOnUser4(IEntity other, int extra)
229 {
230 }
231 protected void EOnDummy020(IEntity other, int extra)
232 {
233 }
234 protected void EOnDummy021(IEntity other, int extra)
235 {
236 }
237 protected void EOnDummy022(IEntity other, int extra)
238 {
239 }
240 protected void EOnDummy023(IEntity other, int extra)
241 {
242 }
243 protected void EOnDummy024(IEntity other, int extra)
244 {
245 }
246 protected void EOnDummy025(IEntity other, int extra)
247 {
248 }
249 protected void EOnDummy026(IEntity other, int extra)
250 {
251 }
252 protected void EOnDummy027(IEntity other, int extra)
253 {
254 }
255 protected void EOnDummy028(IEntity other, int extra)
256 {
257 }
258 protected void EOnDummy029(IEntity other, int extra)
259 {
260 }
261 protected void EOnDummy030(IEntity other, int extra)
262 {
263 }
264 protected void EOnDummy031(IEntity other, int extra)
265 {
266 }
268//DO NOT INSERT ANYTHING ABOVE - order of event methods matters!
269
274
288 proto external void GetTransform(out vector mat[]);
289
303 proto external void GetRenderTransform(out vector mat[]);
304
318 proto external void GetLocalTransform(out vector mat[]);
319
337 proto native external vector GetTransformAxis(int axis);
338
356 proto native external void SetTransform(vector mat[4]);
357
368 proto native external vector GetOrigin();
369
380 proto external vector GetLocalPosition();
381
392 proto native external vector GetYawPitchRoll();
393
397 proto native external vector GetAngles();
398
409 proto native external vector GetLocalYawPitchRoll();
410
414 proto native external vector GetLocalAngles();
415
427 proto native external void SetYawPitchRoll(vector angles);
428
432 proto native external void SetAngles(vector angles);
433
445 proto native external void SetOrigin(vector orig);
446
447 proto native external float GetScale();
448 proto native external void SetScale(float scale);
460 proto native external vector VectorToParent(vector vec);
461
473 proto native external vector CoordToParent(vector coord);
474
486 proto native external vector VectorToLocal(vector vec);
487
499 proto native external vector CoordToLocal(vector coord);
500
502
503
507
518 proto native int GetID();
519
531 proto native void SetID(int id);
532
533 proto native void SetName(string name);
534 proto native external owned string GetName();
536
537
542
551 proto native external bool AddChild(notnull IEntity child, int pivot, bool positionOnly = false);
552
560 proto native external bool RemoveChild(notnull IEntity child, bool keepTransform = false);
561
563 proto native bool IsHierarchyPositionOnly();
564
566 proto native int GetHierarchyPivot();
567
569 proto native IEntity GetParent();
571 proto native IEntity GetChildren();
573 proto native IEntity GetSibling();
575
593 proto external void GetBounds(out vector mins, out vector maxs);
594
612 proto external void GetWorldBounds(out vector mins, out vector maxs);
613
628 proto native external EntityFlags GetFlags();
629
641 proto native external bool IsFlagSet(EntityFlags flags);
642
656 proto native external EntityFlags SetFlags(EntityFlags flags, bool recursively);
657
671 proto native external EntityFlags ClearFlags(EntityFlags flags, bool recursively);
672
673
684 proto native external EntityEvent GetEventMask();
685
699 proto native external EntityEvent SetEventMask(EntityEvent e );
700
716 proto native external EntityEvent ClearEventMask(EntityEvent e);
717
719 proto external volatile void SendEvent(notnull IEntity actor, EntityEvent e, void extra);
720
722
727
735 proto native external void SetObject(vobject object, string options);
736
740 proto native vobject GetVObject();
741
743 proto native external int Animate(float speed, int loop);
745 proto native external int AnimateEx(float speed, int loop, out vector lin, out vector ang);
746
748 proto native external int SetCameraMask(int mask);
750
754 proto native external void FilterNextTrace();
755
764 proto native external int Update();
765
766#ifdef COMPONENT_SYSTEM
768 protected void IEntity(IEntitySource src, IEntity parent);
769#endif
770};
771
772#ifdef ENF_DONE
773// Set fixed LOD. -1 for non-fixed LOD
774proto native void SetFixedLOD(IEntity ent, int lod);
775//Sets the texture that can be referenced from material as $renderview
776//and connects it with camera cam_index. Size iz recommended size of
777//rendertarget (0 is default)
778proto native void SetRenderView(IEntity ent, int cam_index, int width, int height);
779proto void GetRenderView(IEntity ent, out int cam_index, out int width, out int height);
780#endif
781
782
789{
790 string m_Key;
791 string m_Value;
792 string m_Desc;
793
794 void ParamEnum(string key, string value, string desc = "")
795 {
796 m_Key = key;
797 m_Value = value;
798 m_Desc = desc;
799 }
800}
801
802class ParamEnumArray: array<ref ParamEnum>
803{
804 static ParamEnumArray FromEnum(typename e)
806 ParamEnumArray params = new ParamEnumArray();
807 int cnt = e.GetVariableCount();
808 int val;
810 for (int i = 0; i < cnt; i++)
811 {
812 if (e.GetVariableType(i) == int && e.GetVariableValue(NULL, i, val))
813 {
814 params.Insert(new ParamEnum(e.GetVariableName(i), val.ToString()));
815 }
816 }
817
818 return params;
819 }
820}
821
822// -------------------------------------------------------------------------
824{
826 string m_UiWidget;
828 string m_Desc;
829 ref ParamEnumArray m_Enums;
830
831 void Attribute(string defvalue, string uiwidget, string desc = "", string rangescale = "", ParamEnumArray enums = NULL)
832 {
833 m_DefValue = defvalue;
834 m_UiWidget = uiwidget;
835 m_RangeScale = rangescale;
836 m_Desc = desc;
837 m_Enums = enums;
838 }
839}
840
841class EditorAttribute
842{
843 string m_Style;
844 string m_Category;
848 string m_Color;
849 string m_Color2;
853
854 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)
855 {
856 m_Style = style;
857 m_Category = category;
858 m_Description = description;
859 m_SizeMin = sizeMin;
860 m_SizeMax = sizeMax;
861 m_Color = color;
862 m_Color2 = color2;
863 m_Visible = visible;
864 m_Insertable = insertable;
865 m_DynamicBox = dynamicBox;
866 }
867}
869
string name
TODO doc.
Definition EnScript.c:118
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
protected void EOnDummy023(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:240
proto native external owned string GetName()
proto external vector GetLocalPosition()
Returns local position of Entity.
protected void EOnDummy026(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:249
proto native external vector GetTransformAxis(int axis)
Returns one row of Entity transformation matrix.
proto native external EntityEvent ClearEventMask(EntityEvent e)
Clears event mask.
proto native external void SetAngles(vector angles)
Same as SetYawPitchRoll, but sets rotation around X, Y and Z axis.
proto native WidgetSource GetParent()
proto native external void SetObject(vobject object, string options)
event protected void EOnPhysicsMove(IEntity other, int extra)
EntityEvent.PHYSICSMOVE.
Definition EnEntity.c:210
event protected void EOnNotVisible(IEntity other, int extra)
EntityEvent.NOTVISIBLE.
Definition EnEntity.c:180
proto external volatile void SendEvent(notnull IEntity actor, EntityEvent e, void extra)
Dynamic event invokation. Parameters are the same as in IEntity::EOnXXXX() methods.
event protected void EOnContact(IEntity other, Contact extra)
EntityEvent.CONTACT.
Definition EnEntity.c:213
proto native IEntity GetParent()
Returns pointer to parent Entity in hierarchy.
event protected void EOnEnter(IEntity other, int extra)
EntityEvent.ENTER.
Definition EnEntity.c:222
ref ParamEnumArray m_Enums
Only ints and floats are currently supported. Array can be defined this way: { ParamEnum("Choice 1",...
Definition EnEntity.c:829
protected void EOnDummy020(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:231
proto native external EntityEvent GetEventMask()
Returns current event mask.
class Attribute m_Style
can be "box", "sphere", "cylinder", "pyramid", "diamond" or custom style name
event protected int EOnVisible(IEntity other, int extra)
EntityEvent.VISIBLE.
Definition EnEntity.c:186
proto native void SetName(string name)
proto native int GetID()
Return unique entity ID.
proto native external void SetYawPitchRoll(vector angles)
Sets angles for entity (Yaw, Pitch, Roll)
proto native external EntityFlags ClearFlags(EntityFlags flags, bool recursively)
Clear Entity flags. Returns cleared flags.
protected void EOnDummy030(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:261
event protected void EOnAnimEvent(IEntity other, AnimEvent extra)
EntityEvent.ANIMEVENT.
Definition EnEntity.c:195
proto native external vector VectorToParent(vector vec)
Transforms local vector to world space.
proto bool Get(int varIndex, out void val)
proto native external float GetScale()
string m_Key
Definition EnEntity.c:790
proto native external vector GetLocalYawPitchRoll()
Returns local orientation when it's in hierarchy (Yaw, Pitch, Roll)
event protected void EOnFrame(IEntity other, float timeSlice)
EntityEvent.FRAME.
Definition EnEntity.c:183
event protected void EOnJointBreak(IEntity other, int extra)
EntityEvent.JOINTBREAK.
Definition EnEntity.c:207
proto native external vector GetAngles()
Same as GetYawPitchRoll, but returns rotation vector around X, Y and Z axis.
proto native external int AnimateEx(float speed, int loop, out vector lin, out vector ang)
Updates animation (either xob, or particle, whatever)
proto external void GetRenderTransform(out vector mat[])
Returns render transformation of Entity. Must pass in vector array size of 4.
proto native vobject GetVObject()
Returns visual object set to this Entity. No reference is added.
proto external void GetWorldBounds(out vector mins, out vector maxs)
Returns quantized world-bound-box of Entity.
string m_Category
folder structure eg. StaticEntities/Walls
Definition EnEntity.c:844
bool m_Insertable
Definition EnEntity.c:851
proto native owned string GetClassName()
protected void EOnDummy031(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:264
event protected void EOnSimulate(IEntity other, float dt)
EntityEvent.SIMULATE.
Definition EnEntity.c:201
proto native external vector GetYawPitchRoll()
Returns orientation of Entity in world space (Yaw, Pitch, Roll)
protected void EOnDummy022(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:237
proto native external vector CoordToLocal(vector coord)
Transforms world space position to local space.
string m_DefValue
Definition EnEntity.c:825
event protected void EOnTouch(IEntity other, int extra)
EntityEvent.TOUCH.
Definition EnEntity.c:171
protected void EOnDummy021(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:234
proto native void SetID(int id)
Set unique entity ID.
protected void EOnDummy027(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:252
bool m_Visible
Definition EnEntity.c:850
void Attribute(string defvalue, string uiwidget, string desc="", string rangescale="", ParamEnumArray enums=NULL)
Definition EnEntity.c:831
proto native external EntityFlags GetFlags()
Returns Entity flags.
event protected void EOnPostFrame(IEntity other, int extra)
EntityEvent.POSTFRAME.
Definition EnEntity.c:189
string m_Color2
Definition EnEntity.c:849
event protected void EOnExtra(IEntity other, int extra)
EntityEvent.EXTRA.
Definition EnEntity.c:177
proto native external int SetCameraMask(int mask)
Sets visibility mask for cameras, where Entity will be rendered.
event protected void EOnLeave(IEntity other, int extra)
EntityEvent.LEAVE.
Definition EnEntity.c:225
void ParamEnum(string key, string value, string desc="")
Definition EnEntity.c:794
proto native int VarIndex(string varName)
proto native WidgetSource GetSibling()
proto native owned string GetName()
string m_UiWidget
can be "editbox", "combobox", "spinbox", "slider", "font", "fileeditbox", "colorPicker",...
Definition EnEntity.c:826
protected void EOnDummy025(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:246
event protected void EOnWorldProcess(IEntity other, int extra)
EntityEvent.WORLDPROCESS.
Definition EnEntity.c:192
proto native external void SetOrigin(vector orig)
Sets origin for entity.
proto native external vector VectorToLocal(vector vec)
Transforms world space vector to local space.
proto native external vector GetOrigin()
Returns origin of Entity.
string m_Description
class purpose description
Definition EnEntity.c:845
proto native external EntityFlags SetFlags(EntityFlags flags, bool recursively)
Sets Entity flags. It's OR operation, not rewrite. Returns previous flags.
string m_Desc
Definition EnEntity.c:792
proto native WidgetSource GetChildren()
ParamEnum Managed FromEnum(typename e)
Definition EnEntity.c:804
proto native external bool AddChild(notnull IEntity child, int pivot, bool positionOnly=false)
Adds child entity to this entity.
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition EnEntity.c:45
proto native external vector GetLocalAngles()
Same as GetLocalYawPitchRoll, but returns rotation vector around X, Y and Z axis.
string m_Value
Definition EnEntity.c:791
protected void EOnDummy029(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:258
proto native IEntity GetChildren()
Returns pointer to first child Entity in hierarchy.
protected void EOnDummy024(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:243
string m_RangeScale
defined as "MIN_VALUE MAX_VALUE STEP" eg. "1 100 0.5"
Definition EnEntity.c:827
proto native external bool RemoveChild(notnull IEntity child, bool keepTransform=false)
Removes child entity from hierarchy.
proto native external vector CoordToParent(vector coord)
Transforms local position to world space.
proto native IEntitySource GetParent()
protected void EOnUser1(IEntity other, int extra)
EntityEvent.EV_USER+1.
Definition EnEntity.c:219
proto native int GetHierarchyPivot()
Returns the hierarchy component pivot.
proto external void GetTransform(out vector mat[])
Returns transformation of Entity. It returns only so much vectors as array is big.
proto native bool IsVariableSet(int varIndex)
proto native external void SetScale(float scale)
proto native external int Update()
string m_Color
Definition EnEntity.c:848
event protected void EOnPostSimulate(IEntity other, float timeSlice)
EntityEvent.POSTSIMULATE.
Definition EnEntity.c:204
proto native IEntitySource GetChildren()
bool m_DynamicBox
Definition EnEntity.c:852
EntityFlags
Entity flags.
Definition EnEntity.c:115
proto native IEntitySource GetSibling()
protected void EOnDummy028(IEntity other, int extra)
Placeholder.
Definition EnEntity.c:255
event protected void EOnSoundEvent(IEntity other, SoundEvent extra)
EntityEvent.SOUNDEVENT.
Definition EnEntity.c:198
proto external void GetLocalTransform(out vector mat[])
Returns local transformation of Entity. It returns only so much vectors as array is big.
protected void EOnUser4(IEntity other, int extra)
EntityEvent.EV_USER+4.
Definition EnEntity.c:228
proto external void GetBounds(out vector mins, out vector maxs)
Returns local bounding box of model on Entity.
proto native external void SetTransform(vector mat[4])
Sets entity transformation.
event protected void EOnInit(IEntity other, int extra)
EntityEvent.INIT.
Definition EnEntity.c:174
proto bool IsType(int varIndex, typename type)
proto native external bool IsFlagSet(EntityFlags flags)
Test if one or more of specified flags are set.
vector m_SizeMax
max vector of a bounding box
Definition EnEntity.c:847
proto native IEntity GetSibling()
Returns pointer to next child Entity on the same hierarchy.
proto native external EntityEvent SetEventMask(EntityEvent e)
Sets event mask.
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
protected void EOnUser0(IEntity other, int extra)
EntityEvent.EV_USER+0.
Definition EnEntity.c:216
proto native external void FilterNextTrace()
When called, the Entity is excluded from consequent TraceMove/TraceLine.
vector m_SizeMin
min vector of a bounding box
Definition EnEntity.c:846
proto native bool IsHierarchyPositionOnly()
Returns if the hierarchy component was created with positionOnly.
proto native external int Animate(float speed, int loop)
Updates animation (either xob, or particle, whatever)
@ PHYSICSMOVE
Definition EnEntity.c:96
@ INIT
Definition EnEntity.c:81
@ FRAME
Definition EnEntity.c:69
@ PHYSICSSTEADY
Definition EnEntity.c:101
@ POSTSIMULATE
Definition EnEntity.c:95
@ NOTVISIBLE
Definition EnEntity.c:62
@ TOUCH
entity was touched by other entity
Definition EnEntity.c:47
@ CONTACT
Definition EnEntity.c:97
@ SOUNDEVENT
Definition EnEntity.c:100
@ ENTER
Object entered Trigger.
Definition EnEntity.c:105
@ ANIMEVENT
Definition EnEntity.c:99
@ SIMULATE
Definition EnEntity.c:94
@ JOINTBREAK
Definition EnEntity.c:93
@ ALL
Mask of all events.
Definition EnEntity.c:110
@ POSTFRAME
Definition EnEntity.c:75
@ LEAVE
Object left Trigger.
Definition EnEntity.c:107
@ USER
Definition EnEntity.c:102
@ EXTRA
Definition EnEntity.c:98
@ USER6
Definition EnEntity.c:158
@ TRIGGER
Is not collidable, but invokes touch events.
Definition EnEntity.c:124
@ SOLID
Is collidable by various trace methods.
Definition EnEntity.c:123
@ ACTIVE
Definition EnEntity.c:142
@ WATER
Used by tracing methods. Traceable only with flag TraceFlags.WATER.
Definition EnEntity.c:136
@ USER4
Definition EnEntity.c:156
@ USER5
Definition EnEntity.c:157
@ USER1
Flags for custom usage and filterings.
Definition EnEntity.c:153
@ TRANSLUCENT
Definition EnEntity.c:133
@ USER2
Definition EnEntity.c:154
@ TOUCHTRIGGERS
Interacts with triggers.
Definition EnEntity.c:125
@ FEATURE
Scene rendering hint for dominant objects that are not culled by standard way.
Definition EnEntity.c:128
@ VISIBLE
Definition EnEntity.c:55
@ USER3
Definition EnEntity.c:155
@ STATIC
Static objects are included in the query.
Definition EnEntity.c:150
@ SYNCHRONIZATION_DIRTY
Entity wants to synchronize (network)
Definition EnEntity.c:126