Entity editor attribute system
Part of Entity system
Classes
Enums
Values
ACTIVE | Tells that this entity has to be actively updated by engine, its EntityEvent.FRAME has to be called etc. | |
ALL | Mask of all events | |
ANIMEVENT | ||
CONTACT | ||
ENTER | Object entered Trigger | |
EXTRA | ||
FEATURE | Scene rendering hint for dominant objects that are not culled by standard way | |
FRAME | new frame event, called each frame other WorldClass extra frame index | |
INIT | event called after the world is created, including all entities other WorldClass | |
JOINTBREAK | ||
LEAVE | Object left Trigger | |
NOTVISIBLE | entity is not visible, will not be part of rendering other WorldClass extra frame index | |
PHYSICSMOVE | ||
PHYSICSSTEADY | ||
POSTFRAME | event at the end of each frame or when entity is moved during the frame other WorldClass | |
POSTSIMULATE | ||
SIMULATE | ||
SOLID | Is collidable by various trace methods | |
SOUNDEVENT | ||
STATIC | Tells that this entity will represent mostly static object, so we can use more precise but slower methods for scene-tree linking. Also it tells to scene tree that he can count with this entity as tree-split hint. | |
SYNCHRONIZATION_DIRTY | Entity wants to synchronize (network) | |
TOUCH | entity was touched by other entity | |
TOUCHTRIGGERS | Interacts with triggers | |
TRANSLUCENT | Used by tracing methods. When tracing with TraceFlags.PASSTRANSLUCENT, then this entity is ignored. Used for glass for example. | |
TRIGGER | Is not collidable, but invokes touch events. | |
USER | ||
USER1 | Flags for custom usage and filterings. | |
USER2 | ||
USER3 | ||
USER4 | ||
USER5 | ||
USER6 | ||
VISIBLE [1/2] | entity is visible, so part of the rendering other WorldClass extra frame index result false should be rendered, true shoudn't be rendered | |
VISIBLE [2/2] | Entity is visible. Is rendered if there is some attached object and event EntityEvent.VISIBLE is invoked, when event mask is set. | |
WATER | Used by tracing methods. Traceable only with flag TraceFlags.WATER |
Functions
proto native external bool AddChild(notnull IEntity child, int pivot, bool positionOnly = false) | Adds child entity to this entity. | more… |
proto native external int Animate(float speed, int loop) | Updates animation (either xob, or particle, whatever) | |
proto native external int AnimateEx(float speed, int loop, out vector lin, out vector ang) | Updates animation (either xob, or particle, whatever) | |
void Attribute(string defvalue, string uiwidget, string desc = "", string rangescale = "", ParamEnumArray enums = NULL) | ||
proto native external EntityEvent ClearEventMask(EntityEvent e) | Clears event mask | more… |
proto native external EntityFlags ClearFlags(EntityFlags flags, bool recursively) | Clear Entity flags. Returns cleared flags | more… |
proto native external vector CoordToLocal(vector coord) | Transforms world space position to local space | more… |
proto native external vector CoordToParent(vector coord) | Transforms local position to world space | more… |
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) | ||
event protected void EOnAnimEvent(IEntity other, AnimEvent extra) | EntityEvent.WORLDPROCESS | |
event protected void EOnContact(IEntity other, Contact extra) | EntityEvent.PHYSICSMOVE | |
protected void EOnDummy020(IEntity other, int extra) | EntityEvent.EV_USER+4 | |
protected void EOnDummy021(IEntity other, int extra) | Placeholder | |
protected void EOnDummy022(IEntity other, int extra) | Placeholder | |
protected void EOnDummy023(IEntity other, int extra) | Placeholder | |
protected void EOnDummy024(IEntity other, int extra) | Placeholder | |
protected void EOnDummy025(IEntity other, int extra) | Placeholder | |
protected void EOnDummy026(IEntity other, int extra) | Placeholder | |
protected void EOnDummy027(IEntity other, int extra) | Placeholder | |
protected void EOnDummy028(IEntity other, int extra) | Placeholder | |
protected void EOnDummy029(IEntity other, int extra) | Placeholder | |
protected void EOnDummy030(IEntity other, int extra) | Placeholder | |
protected void EOnDummy031(IEntity other, int extra) | Placeholder | |
event protected void EOnEnter(IEntity other, int extra) | EntityEvent.EV_USER+1 | |
event protected void EOnExtra(IEntity other, int extra) | EntityEvent.INIT | |
event protected void EOnFrame(IEntity other, float timeSlice) | EntityEvent.NOTVISIBLE | |
event protected void EOnInit(IEntity other, int extra) | EntityEvent.TOUCH | |
event protected void EOnJointBreak(IEntity other, int extra) | EntityEvent.POSTSIMULATE | |
event protected void EOnLeave(IEntity other, int extra) | EntityEvent.ENTER | |
event protected void EOnNotVisible(IEntity other, int extra) | EntityEvent.EXTRA | |
event protected void EOnPhysicsMove(IEntity other, int extra) | EntityEvent.JOINTBREAK | |
event protected void EOnPostFrame(IEntity other, int extra) | EntityEvent.VISIBLE | |
event protected void EOnPostSimulate(IEntity other, float timeSlice) | EntityEvent.SIMULATE | |
event protected void EOnSimulate(IEntity other, float dt) | EntityEvent.SOUNDEVENT | |
event protected void EOnSoundEvent(IEntity other, SoundEvent extra) | EntityEvent.ANIMEVENT | |
event protected void EOnTouch(IEntity other, int extra) | \name Event methods Event method stubs. Reimplement these in inherited entities to receive event calls | |
protected void EOnUser0(IEntity other, int extra) | EntityEvent.CONTACT | |
protected void EOnUser1(IEntity other, int extra) | EntityEvent.EV_USER+0 | |
protected void EOnUser4(IEntity other, int extra) | EntityEvent.LEAVE | |
event protected int EOnVisible(IEntity other, int extra) | EntityEvent.FRAME | |
event protected void EOnWorldProcess(IEntity other, int extra) | EntityEvent.POSTFRAME | |
proto native external void FilterNextTrace() | When called, the Entity is excluded from consequent TraceMove/TraceLine | |
static ParamEnumArray FromEnum(typename e) | more… | |
proto native external vector GetAngles() | Same as GetYawPitchRoll, but returns rotation vector around X, Y and Z axis. | |
proto external void GetBounds(out vector mins, out vector maxs) | Returns local bounding box of model on Entity | more… |
proto native IEntity GetChildren() | Returns pointer to first child Entity in hierarchy | |
proto native external EntityEvent GetEventMask() | Returns current event mask | more… |
proto native external EntityFlags GetFlags() | Returns Entity flags | more… |
proto native int GetHierarchyPivot() | Returns the hierarchy component pivot | |
proto native int GetID() | Return unique entity ID | more… |
proto native external vector GetLocalAngles() | Same as GetLocalYawPitchRoll, but returns rotation vector around X, Y and Z axis. | |
proto external vector GetLocalPosition() | Returns local position of Entity | more… |
proto external void GetLocalTransform(out vector mat[]) | Returns local transformation of Entity. It returns only so much vectors as array is big | more… |
proto native external vector GetLocalYawPitchRoll() | Returns local orientation when it's in hierarchy (Yaw, Pitch, Roll) | more… |
proto native external owned string GetName() | ||
proto native external vector GetOrigin() | Returns origin of Entity | more… |
proto native IEntity GetParent() | Returns pointer to parent Entity in hierarchy | |
proto native external Physics GetPhysics() | ||
proto external void GetRenderTransform(out vector mat[]) | Returns render transformation of Entity. Must pass in vector array size of 4 | more… |
proto void GetRenderView(IEntity ent, out int cam_index, out int width, out int height)ENF_DONE | ||
proto native external float GetScale() | ||
proto native IEntity GetSibling() | Returns pointer to next child Entity on the same hierarchy | |
proto external void GetTransform(out vector mat[]) | Returns transformation of Entity. It returns only so much vectors as array is big | more… |
proto native external vector GetTransformAxis(int axis) | Returns one row of Entity transformation matrix | more… |
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 | more… |
proto native external vector GetYawPitchRoll() | Returns orientation of Entity in world space (Yaw, Pitch, Roll) | more… |
protected void IEntity(IEntitySource src, IEntity parent)COMPONENT_SYSTEM | Constructor | |
proto native external bool IsFlagSet(EntityFlags flags) | Test if one or more of specified flags are set | more… |
proto native bool IsHierarchyPositionOnly() | Returns if the hierarchy component was created with positionOnly | |
void ParamEnum(string key, string value, string desc = "") | ||
proto native external bool RemoveChild(notnull IEntity child, bool keepTransform = false) | Removes child entity from hierarchy. | more… |
proto external volatile void SendEvent(notnull IEntity actor, EntityEvent e, void extra) | Dynamic event invokation. Parameters are the same as in IEntity::EOnXXXX() methods | |
proto native external void SetAngles(vector angles) | Same as SetYawPitchRoll, but sets rotation around X, Y and Z axis. | |
proto native external int SetCameraMask(int mask) | Sets visibility mask for cameras, where Entity will be rendered | |
proto native external EntityEvent SetEventMask(EntityEvent e) | Sets event mask | more… |
proto native void SetFixedLOD(IEntity ent, int lod)ENF_DONE | ||
proto native external EntityFlags SetFlags(EntityFlags flags, bool recursively) | Sets Entity flags. It's OR operation, not rewrite. Returns previous flags | more… |
proto native void SetID(int id) | Set unique entity ID | more… |
proto native void SetName(string name) | ||
proto native external void SetObject(vobject object, string options) | Sets the visual object to this entity. Reference is added and released upon entity destruction | more… |
proto native external void SetOrigin(vector orig) | Sets origin for entity | more… |
proto native void SetRenderView(IEntity ent, int cam_index, int width, int height)ENF_DONE | ||
proto native external void SetScale(float scale) | ||
proto native external void SetTransform(vector mat[4]) | Sets entity transformation | more… |
proto native external void SetYawPitchRoll(vector angles) | Sets angles for entity (Yaw, Pitch, Roll) | more… |
proto native external int Update() | Updates entity state/position. Should be called when you want to manually commit position changes etc before trace methods etc. Entity is updated automatically at the end and the beginning of simulation step, when it has EntityFlags.TFL_ACTIVE flag set. | more… |
proto native external vector VectorToLocal(vector vec) | Transforms world space vector to local space | more… |
proto native external vector VectorToParent(vector vec) | Transforms local vector to world space | more… |
Variables
string m_Category | folder structure eg. StaticEntities/Walls | |
string m_Color | ||
string m_Color2 | ||
string m_DefValue | ||
string m_Desc [1/2] | ||
string m_Desc [2/2] | ||
string m_Description | class purpose description | |
bool m_DynamicBox | ||
ref ParamEnumArray m_Enums | Only ints and floats are currently supported. Array can be defined this way: { ParamEnum("Choice 1", "1"), ParamEnum("Choicen 2", "2") } | |
bool m_Insertable | ||
string m_Key | ||
string m_RangeScale | defined as "MIN_VALUE MAX_VALUE STEP" eg. "1 100 0.5" | |
vector m_SizeMax | max vector of a bounding box | |
vector m_SizeMin | min vector of a bounding box | |
string m_Style | can be "box", "sphere", "cylinder", "pyramid", "diamond" or custom style name | |
string m_UiWidget | can be "editbox", "combobox", "spinbox", "slider", "font", "fileeditbox", "colorPicker", "flags", "resourceNamePicker" | |
string m_Value | ||
bool m_Visible |
Function Documentation
AddChildIEntity
Adds child entity to this entity.
childIEntityPointer to entity which become our childpivotintPivot is pivot index, or -1 for center of parent.positionOnlyboolWhen set to true, the orientation will still be in WS.
Returns: bool True when entity has been attached. False otherwise.
Show 14 more
, Headtorch_ColorBase.AttachLightOnHead(), Object.AddArrow(), Particle.AddAsChild(), Particle.CreateParticleEffect(), PlayerBase.AddArrow(), PlayerBase.OnParticleEvent(), PlayerBase.SetDecayEffects(), PlayerBase.SpawnBreathVaporEffect(), PlayerBase.SpawnDrowningBubbles(), ScriptedLightBase.AttachOnObject(), ScriptedLightBase.HandleDancingShadows(), SpookyArea23.OnPlayerEnterServer(), UndergroundTriggerCarrier.SpawnTrigger(), and ZombieBase.AddArrow()ClearEventMaskIEntity
proto native external EntityEvent ClearEventMask(EntityEvent e)Clears event mask
eintevent mask
Returns: int event mask
Man player = g_Game.GetPlayer();
player.SetEventMask(EntityEvent.VISIBLE );
Print( player.GetEventMask() );
player.ClearEventMask(EntityEvent.ALL );
Print( player.GetEventMask() );
>> 128
>> 0ClearFlagsIEntity
proto native external EntityFlags ClearFlags(EntityFlags flags, bool recursively)Clear Entity flags. Returns cleared flags
flagsintflags to be setrecursively- flags will be recursively applied to children of hierarchy too
Returns: int cleared flags
Man player = g_Game.GetPlayer();
player.ClearFlags(EntityFlags.VISIBLE|EntityFlags.SOLID );
Print( player.GetFlags() );
>> 1610612744CoordToLocalIEntity
Transforms world space position to local space
coordvectorworld space position to transform
Returns: vector position in local space
Man player = g_Game.GetPlayer();
Print( player.CoordToLocal("500 10 155") );
>> <15254,-54.2004,8745.53>CoordToParentIEntity
Transforms local position to world space
coordvectorlocal position to transform
Returns: vector position in world space
Man player = g_Game.GetPlayer();
Print( player.CoordToParent("1 2 3") );
>> <2549,17.6478,2857>FromEnumParamEnumArray
static ParamEnumArray FromEnum(typename e)GetBoundsIEntity
Returns local bounding box of model on Entity
- out
mins vectorminimum point of bounding box- out
maxs vectormaximum point of bounding box
Man player = g_Game.GetPlayer();
vector mins, maxs;
player.GetBounds(mins, maxs );
Print( mins );
Print( maxs );
>> <0,0,0>
>> <0,0,0>GetEventMaskIEntity
proto native external EntityEvent GetEventMask()Returns current event mask
Returns: int current event mask
Man player = g_Game.GetPlayer();
Print( player.GetEventMask() );
>> 0GetFlagsIEntity
proto native external EntityFlags GetFlags()Returns Entity flags
Returns: EntityFlags entity flags
Man player = g_Game.GetPlayer();
Print( player.GetFlags() );
>> 1610612745GetIDIEntity
proto native int GetID()Return unique entity ID
Returns: int unique entity ID
ItemBase apple = g_Game.CreateObject( "FruitApple", String2Vector("0 10 0"), false );
Print( apple.GetID() );
>> 0GetLocalPositionIEntity
proto external vector GetLocalPosition()Returns local position of Entity
Returns: vector entity local position
Man player = g_Game.GetPlayer();
Print( player.GetOrigin() );
>> <2577.02,15.6837,2924.27>GetLocalTransformIEntity
proto external void GetLocalTransform(out vector mat[])Returns local transformation of Entity. It returns only so much vectors as array is big
matvector[1...4]matrix to be get
Man player = g_Game.GetPlayer();
vector mat[4];
player.GetTransform(mat);
Print( mat );
>> <0.989879,-0,0.141916>,<0,1,0>,<-0.141916,0,0.989879>,<2545.08,15.6754,2867.49>GetLocalYawPitchRollIEntity
proto native external vector GetLocalYawPitchRoll()Returns local orientation when it's in hierarchy (Yaw, Pitch, Roll)
Returns: vector local orientation
Man player = g_Game.GetPlayer();
Print( player.GetLocalYawPitchRoll() );
>> <180,-57.2585,180>GetOriginIEntity
proto native external vector GetOrigin()Returns origin of Entity
Returns: vector entity origin
Man player = g_Game.GetPlayer();
Print( player.GetOrigin() );
>> <2577.02,15.6837,2924.27>GetRenderTransformIEntity
proto external void GetRenderTransform(out vector mat[])Returns render transformation of Entity. Must pass in vector array size of 4
matvector[4]matrix to be get
Man player = g_Game.GetPlayer();
vector mat[4];
player.GetRenderTransform(mat);
Print( mat );
>> <0.989879,-0,0.141916>,<0,1,0>,<-0.141916,0,0.989879>,<2545.08,15.6754,2867.49>GetTransformIEntity
proto external void GetTransform(out vector mat[])Returns transformation of Entity. It returns only so much vectors as array is big
matvector[1...4]matrix to be get
Man player = g_Game.GetPlayer();
vector mat[4];
player.GetTransform(mat);
Print( mat );
>> <0.989879,-0,0.141916>,<0,1,0>,<-0.141916,0,0.989879>,<2545.08,15.6754,2867.49>Show 25 more
, CarWheel.EEHealthLevelChanged(), ChainedDropAndKillPlayerLambda.ChainedDropAndKillPlayerLambda(), ClaymoreMine.DrawDamageZone(), ComponentEntityDebug.OnDrawing(), Construction.DrawDebugCollisionBox(), Construction.DropNonUsableMaterialsServer(), DayZCreature.AddArrow(), DayZPlayerCamera3rdPersonVehicle.OnUpdate(), DestroyItemInCorpsesHandsAndCreateNewOnGndLambda.DestroyItemInCorpsesHandsAndCreateNewOnGndLambda(), GameInventory.SetGroundPosByOwnerBounds(), HandEventThrow.HandEventThrow(), Hologram.DrawDebugCollisionBox(), ItemBase.SetInventoryLocationToVicinityOrCurrent(), Object.AddArrow(), Object.Gizmo_GetWorldTransform(), PlayerBase.AddArrow(), PlayerBase.ContaminatedParticleAdjustment(), PlayerBase.DiagOnPostFrame(), SceneObject.EditorShapeUpdatePos(), ScriptCamera.EOnFrame(), ScriptCamera.FreeFly(), ScriptCamera.ScriptCamera(), Transport.IsAreaAtDoorFree(), Trigger.DrawDebugShape(), and ZombieBase.AddArrow()GetTransformAxisIEntity
Returns one row of Entity transformation matrix
axisintmatrix axis. Can be 0..3
Returns: vector axis row of Entity matrix
Man player = g_Game.GetPlayer();
Print( player.GetTransformAxis(0) );
Print( player.GetTransformAxis(1) );
Print( player.GetTransformAxis(2) );
Print( player.GetTransformAxis(3) );
>> <-0.386781,0,0.922171>
>> <0,1,0>
>> <-0.922171,0,-0.386782>
>> <2551.34,15.6439,2856.72>GetWorldBoundsIEntity
Returns quantized world-bound-box of Entity
- out
mins vectorminimum point of bounding box- out
maxs vectormaximum point of bounding box
Man player = g_Game.GetPlayer();
vector mins, maxs;
player.GetWorldBounds( mins, maxs );
Print( mins );
Print( maxs );
>> <2547.2,15.5478,2852.85>
>> <2548.8,17.5478,2855.05>GetYawPitchRollIEntity
proto native external vector GetYawPitchRoll()Returns orientation of Entity in world space (Yaw, Pitch, Roll)
Returns: vector entity orientation
Man player = g_Game.GetPlayer();
Print( player.GetYawPitchRoll() );
>> <180,-76.5987,180>Show 2 more
, ScriptCamera.FreeFly(), and ScriptCamera.ScriptCamera()IsFlagSetIEntity
proto native external bool IsFlagSet(EntityFlags flags)Test if one or more of specified flags are set
Returns: bool True if is set, false otherwise.
Man player = g_Game.GetPlayer();
player.SetFlags(EntityFlags.VISIBLE);
Print( player.IsFlagSet(EntityFlags.VISIBLE) );
>> trueRemoveChildIEntity
Removes child entity from hierarchy.
childIEntityPointer to child entity we want to remove.keepTransformboolWhen set to true, Entity is kept on her world position. Otherwise it's local transform is used as world-space one.
Returns: bool True if it was removed, false when this entity is not our child.
SetEventMaskIEntity
proto native external EntityEvent SetEventMask(EntityEvent e)Sets event mask
e- combined mask of one or more members of EntityEvent enum
Man player = g_Game.GetPlayer();
Print( player.GetEventMask() );
player.SetEventMask( EntityEvent.VISIBLE );
Print( player.GetEventMask() );
>> 0
>> 128Show 25 more
, ComponentEntityDebug.DebugBBoxDraw(), ComponentEntityDebug.DebugDirectionDraw(), DayZAnimal.DayZAnimal(), DayZPlayerImplement.DayZPlayerImplement(), DayZSpectator.DayZSpectator(), DynamicArea_Flare.DynamicArea_Flare(), EasterEgg.EasterEgg(), Fireplace.Fireplace(), GardenBase.GardenBase(), HelicopterScript.HelicopterScript(), ItemBase.ItemBase(), Land_Underground_EntranceBase.OnDoorStateChangedClient(), Land_Underground_WaterReservoir.Land_Underground_WaterReservoir(), Particle.ParticleInit(), PlayerBase.Init(), PowerGeneratorBase.PowerGeneratorBase(), PumpkinHelmet.PumpkinHelmet(), RenderTarget.RenderTarget(), ScriptCamera.ScriptCamera(), ScriptedLightBase.ScriptedLightBase(), TestFramework.TestFramework(), TrapTrigger.TrapTrigger(), Trigger.Trigger(), WorldsMenu.WorldsMenu(), and ZombieBase.Init()SetFlagsIEntity
proto native external EntityFlags SetFlags(EntityFlags flags, bool recursively)Sets Entity flags. It's OR operation, not rewrite. Returns previous flags
flagsintflags to be setrecursively- flags will be recursively applied to children of hierarchy too
Returns: int previous flags
Man player = g_Game.GetPlayer();
player.SetFlags(EntityFlags.VISIBLE|EntityFlags.SOLID );
Print( player.GetFlags() );
>> 1610612747SetIDIEntity
proto native void SetID(int id)Set unique entity ID
idintunique entity ID to be set
ItemBase apple = g_Game.CreateObject( "Fruit_Apple", String2Vector("0 10 0"), false );
apple.SetID(101);
Print( apple.GetID() );
>> 101SetObjectIEntity
Sets the visual object to this entity. Reference is added and released upon entity destruction
object- handle to object got by GetObject()
options- String, dependant on object type. //Only supported one for XOB objects: //$remap 'original material name' 'new material'; [$remap 'another original material name' 'anothernew material']
SetOriginIEntity
proto native external void SetOrigin(vector orig)Sets origin for entity
origvectororigin to be set
Man player = g_Game.GetPlayer();
player.SetOrigin("2550 10 2900" );
Print( player.GetOrigin() );
>> <2550,10,2900>SetTransformIEntity
proto native external void SetTransform(vector mat[4])Sets entity transformation
matvector[4]matrix to be set
vector mat[4];
Math3D.MatrixIdentity( mat )
Man player = g_Game.GetPlayer();
player.SetTransform( mat );
vector outmat[4];
player.GetTransform(outmat );
Print( outmat );
>> <1,0,0>,<0,1,0>,<0,0,1>,<0,0,0>SetYawPitchRollIEntity
proto native external void SetYawPitchRoll(vector angles)Sets angles for entity (Yaw, Pitch, Roll)
anglesvectorangles to be set
Man player = g_Game.GetPlayer();
player.SetYawPitchRoll("180 50 180" );
Print( player.GetYawPitchRoll() );
>> <-180,50,-180>UpdateIEntity
proto native external int Update()Updates entity state/position. Should be called when you want to manually commit position changes etc before trace methods etc. Entity is updated automatically at the end and the beginning of simulation step, when it has EntityFlags.TFL_ACTIVE flag set.
Returns: mask with flags // EntityFlags.UPDATE - hierarchy has been updated // EntityFlags.UPDATE_MDL - model hierarchy has been updated
Show 1 more
, ScriptedLightBase.HandleDancingShadows()VectorToLocalIEntity
Transforms world space vector to local space
vecvectorworld space vector to transform
Returns: vector local space vector
Man player = g_Game.GetPlayer();
Print( player.VectorToLocal("2 1 5") );
>> <-0.166849,1,5.38258>VectorToParentIEntity
Transforms local vector to world space
vecvectorlocal space vector to transform
Returns: vector world space vector
Man player = g_Game.GetPlayer();
Print( player.VectorToParent("1 2 3") );
>> <2.89791,2,1.26575>