Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
enentity.c
Go to the documentation of this file.
1 typedef int[] BaseContainer;
2 typedef int[] IEntitySource;
3 typedef 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 
81  INIT,
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 
111 };
112 
115 {
120  VISIBLE,
121 
122 
127 
129 
134 
137 
143 
151 
159 };
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
767  protected void IEntity(IEntitySource src, IEntity parent);
769 #endif
770 };
771 
772 #ifdef ENF_DONE
773 // Set fixed LOD. -1 for non-fixed LOD
774 proto 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)
778 proto native void SetRenderView(IEntity ent, int cam_index, int width, int height);
779 proto 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 
802 class ParamEnumArray: array<ref ParamEnum>
803 {
804  static ParamEnumArray FromEnum(typename e)
805  {
806  ParamEnumArray params = new ParamEnumArray();
807  int cnt = e.GetVariableCount();
808  int val;
809 
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 {
825  string m_DefValue;
826  string m_UiWidget;
827  string m_RangeScale;
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 
841 class EditorAttribute
842 {
843  string m_Style;
844  string m_Category;
845  string m_Description;
848  string m_Color;
849  string m_Color2;
850  bool m_Visible;
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 
INIT
@ INIT
Definition: enentity.c:81
USER1
@ USER1
Flags for custom usage and filterings.
Definition: enentity.c:153
TOUCHTRIGGERS
@ TOUCHTRIGGERS
Interacts with triggers.
Definition: enentity.c:125
ACTIVE
@ ACTIVE
Definition: enentity.c:142
POSTSIMULATE
@ POSTSIMULATE
Definition: enentity.c:95
JOINTBREAK
@ JOINTBREAK
Definition: enentity.c:93
IEntitySource
Definition: enentity.c:15
EntityFlags
EntityFlags
Entity flags.
Definition: enentity.c:114
POSTFRAME
@ POSTFRAME
Definition: enentity.c:75
m_Key
string m_Key
Definition: enentity.c:4
m_SizeMax
vector m_SizeMax
max vector of a bounding box
Definition: enentity.c:847
PHYSICSSTEADY
@ PHYSICSSTEADY
Definition: enentity.c:101
vobject
Definition: proto.c:48
PHYSICSMOVE
@ PHYSICSMOVE
Definition: enentity.c:96
VISIBLE
@ VISIBLE
Definition: enentity.c:55
USER4
@ USER4
Definition: enentity.c:156
Managed
TODO doc.
Definition: enscript.c:117
SoundEvent
Definition: proto.c:39
m_Value
string m_Value
Definition: enentity.c:5
CONTACT
@ CONTACT
Definition: enentity.c:97
ENTER
@ ENTER
Object entered Trigger.
Definition: enentity.c:105
FromEnum
ParamEnum Managed FromEnum(typename e)
Definition: enentity.c:804
ALL
@ ALL
Mask of all events.
Definition: enentity.c:110
IEntity
Definition: enentity.c:164
ParamEnum
Definition: enentity.c:788
WidgetSource
int[] WidgetSource
Definition: enentity.c:3
m_Description
string m_Description
class purpose description
Definition: enentity.c:845
NOTVISIBLE
@ NOTVISIBLE
Definition: enentity.c:62
TOUCH
@ TOUCH
entity was touched by other entity
Definition: enentity.c:47
USER6
@ USER6
Definition: enentity.c:158
vector
Definition: enconvert.c:105
SOLID
@ SOLID
Is collidable by various trace methods.
Definition: enentity.c:123
SOUNDEVENT
@ SOUNDEVENT
Definition: enentity.c:100
BaseContainer
int[] BaseContainer
Definition: enentity.c:1
SYNCHRONIZATION_DIRTY
@ SYNCHRONIZATION_DIRTY
Entity wants to synchronize (network)
Definition: enentity.c:126
Attribute
Definition: enentity.c:823
m_Visible
bool m_Visible
Definition: enentity.c:850
m_Insertable
bool m_Insertable
Definition: enentity.c:851
TRANSLUCENT
@ TRANSLUCENT
Definition: enentity.c:133
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
m_DynamicBox
bool m_DynamicBox
Definition: enentity.c:852
Contact
Definition: enphysics.c:300
m_Color2
string m_Color2
Definition: enentity.c:849
m_Category
string m_Category
folder structure eg. StaticEntities/Walls
Definition: enentity.c:844
m_Style
class Attribute m_Style
can be "box", "sphere", "cylinder", "pyramid", "diamond" or custom style name
ANIMEVENT
@ ANIMEVENT
Definition: enentity.c:99
m_SizeMin
vector m_SizeMin
min vector of a bounding box
Definition: enentity.c:846
m_Desc
string m_Desc
Definition: enentity.c:6
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition: isboxcollidinggeometryproxyclasses.c:27
USER3
@ USER3
Definition: enentity.c:155
LEAVE
@ LEAVE
Object left Trigger.
Definition: enentity.c:107
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
EXTRA
@ EXTRA
Definition: enentity.c:98
WATER
@ WATER
Used by tracing methods. Traceable only with flag TraceFlags.WATER.
Definition: enentity.c:136
m_Color
string m_Color
Definition: enentity.c:848
ParamEnum
void ParamEnum(string key, string value, string desc="")
Definition: enentity.c:8
AnimEvent
Definition: proto.c:33
USER2
@ USER2
Definition: enentity.c:154
STATIC
@ STATIC
Static objects are included in the query.
Definition: enentity.c:150
USER5
@ USER5
Definition: enentity.c:157
SIMULATE
@ SIMULATE
Definition: enentity.c:94
USER
@ USER
Definition: enentity.c:102
FEATURE
@ FEATURE
Scene rendering hint for dominant objects that are not culled by standard way.
Definition: enentity.c:128
IEntitySource
int[] IEntitySource
Definition: enentity.c:2
EntityEvent
EntityEvent
Entity events for event-mask, or throwing event from code.
Definition: enentity.c:44
FRAME
@ FRAME
Definition: enentity.c:69
BaseContainer
Definition: enentity.c:5
TRIGGER
@ TRIGGER
Is not collidable, but invokes touch events.
Definition: enentity.c:124
WidgetSource
Definition: enentity.c:22