9class ObjectSnapCallback
111 for (
int i = 0;
i <
lods.Count(); ++
i)
145 ammoType = ConfigGetString(
"ammoType");
159 if (
GetGame().IsDedicatedServer())
162 GetGame().RPCSingleParam(
this,
ERPCs.RPC_EXPLODE_EVENT,
p,
true);
164 else if (!
GetGame().IsMultiplayer())
171 string ammoType = ConfigGetString(
"ammoType");
470 if (NameOverride(
tmp))
494 return GetGame().ObjectRelease(
this);
500 return GetGame().ObjectIsKindOf(
this, type);
759 return IsPlainObject() && !IsScenery();
797 return high.ToString() +
low.ToString();
808 return o.GetDebugName();
836 return GetGame().ObjectGetSelectionPosition(
this,
name);
841 return GetGame().ObjectGetSelectionPositionLS(
this,
name);
846 return GetGame().ObjectGetSelectionPositionMS(
this,
name);
851 return GetGame().ObjectGetSelectionPositionWS(
this,
name);
1040 return GetHealth(
"",
"");
1045 return GetHealth01(
"",
"");
1050 return GetMaxHealth(
"",
"");
1055 SetHealth(
"",
"",
health);
1060 SetHealth(
"",
"",
health);
1233 StopSoundSet(
sound);
1238 sound.SetAutodestroy(
true);
1273 pos = ModelToWorld(pos);
1277 ErrorEx(
string.Format(
"Memory point %1 not found when playing soundset %2 at memory point location",
memoryPoint,
soundSet));
1312 GetNetworkID(
lo,
hi);
1335 if (MemoryPointExists(
"ce_center"))
1338 return ModelToWorld(GetMemoryPointPos(
"ce_center"));
1362 float scale = GetScale();
1363 scale = 1 / (scale * scale);
eBleedingSourceType GetType()
bool IsDamageDestroyed(ActionTarget target)
override bool CanUseConstruction()
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
override bool IsDayZCreature()
override bool IsMushroom()
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override bool IsHologram()
override bool IsItemBase()
void OnDebug(vector p0, vector p1, bool hasHit, bool found)
Debug callback for rendering on the screen.
bool OnCollide(Object other)
Ray cast line test from owner to a tested position.
vector m_DirectionFunc
The size of the boundig box, centered.
enum ProcessDirectDamageFlags m_Owner
bool OnFirstContact(Object other)
Called for first layer contacts to determine if this object should be snapped around or default rv ra...
bool OnQuery(Object other)
Initial query around the owner position to see if an object should be processed in contact testing.
vector m_Offset
The direction of the owner in world space.
@ NO_ATTACHMENT_TRANSFER
Do not transfer damage to attachments.
@ NO_GLOBAL_TRANSFER
Do not transfer damage to global.
@ NO_TRANSFER
NO_ATTACHMENT_TRANSFER | NO_GLOBAL_TRANSFER.
vector m_OwnerDirection
The position of the owner in world space.
vector m_Transform[4]
If 'OnDebug' is to be called.
bool m_DebugEnabled
How much should the direction be favoured.
vector m_OwnerPosition
The owner performing the snap callback.
vector m_Extents
The true center of the bounding box of the object to be dropped in model space.
void OnSetup()
The transformation currently being debugged.
proto string GetDebugNameNative()
Gets the debug name for the ParticleManager.
class JsonUndergroundAreaTriggerData GetPosition
Static data holder for certain ammo config values.
static bool PlayAmmoEffect(string ammoType, vector pos)
Attempt to play the ammo effect at pos if found, returns true on success.
static bool PlayAmmoParticle(string ammoType, vector pos)
Attempt to play the ammo particle at pos if found, returns true on success.
Wrapper class for managing sound through SEffectManager.
static array< string > GetHiddenSelectionsTexturesConfig(string type)
static array< string > GetHiddenSelectionsMaterialsConfig(string type)
static array< string > GetHiddenSelectionsConfig(string type)
proto native bool IsActionComponentPartOfSelection(int componentIndex, string selectionName, string geometry="")
return true if selection containts action component, 'geometry' can be "fire" or "view" (default "" f...
proto native void GetBoneRotationWS(int pivot, out float quaternion[4])
proto native bool GetCollisionBox(out vector minMax[2])
Gets collision bounding box.
bool IsBeingBackstabbed()
bool IsFireplace()
Returns if this entity is fireplacebase.
bool DisplayNameRuinAttach()
void OnSimulationDisabled()
Event called from C++ when simulation is disabled.
proto native void GetBoneRotationMS(int pivot, out float quaternion[4])
proto native void SetDestructTime(float time)
Sets the time over which to perform DestructTent/DestructTree.
proto native bool IsDamageDestroyed()
Checks if object is destroyed.
EWaterSourceObjectType GetWaterSourceObjectType()
proto native owned string GetShapeName()
Return path and name of the model.
bool ShootsExplosiveAmmo()
Returns if this entity is a weapon which can shoot explosive ammo.
void OnTreeCutDown(EntityAI cutting_entity)
Called when tree is chopped down. 'cutting_entity' can be tool, or player, if cutting bush with bare ...
proto native float GetHealth(string zoneName, string healthType)
Returns current state of health.
proto native float GetHealth01(string zoneName, string healthType)
Returns current state of health in range <0, 1>.
bool StopSoundSet(out EffectSound sound)
EffectSound - stops soundset and returns state of the sound (true - stopped, false - not playing)
proto float ConfigGetFloat(string entryName)
bool IsEntityAI()
Returns if this entity is EntityAI.
proto native int GetMemoryLevel()
bool PlaySoundSetAtMemoryPointLoopedSafe(out EffectSound sound, string soundSet, string memoryPoint, float play_fade_in=0, float stop_fade_out=0)
Same as PlaySoundSetAtMemoryPointLooped, only requests stoppage of the currently playing EffectSound ...
float GetHealth01()
Equivalent of GetHealth01("", "");.
bool IsTransport()
Returns if this entity is transport.
bool IsMagazine()
Returns if this entity is Magazine.
LOD GetLODByName(string name)
Retrieve LOD by given name.
proto native void EnableDynamicCCD(bool state)
void RPCSingleParam(int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=NULL)
Remote procedure call shortcut, see CGame.RPCSingleParam / CGame.RPC.
proto native vector GetWorldPosition()
proto string ConfigGetStringRaw(string entryName)
Get a raw strings from config entry.
proto native void SetAffectPathgraph(bool fromConfig, bool affect)
Sets if object's geometry affects pathgraph generation. If first parameter is true,...
proto native bool IsPlainObject()
Is this just static object without config? So we can avoid calling unnecessary methods.
proto float ClippingInfo(out vector minMax[2])
Get Clipping info.
proto native owned vector GetActionComponentPosition(int componentIndex, string geometry="")
returns action component position by given component index, 'geometry' can be "fire" or "view" (defau...
proto native void RemoveProxyPhysics(string proxySelectionName)
proto native void ConfigGetTextArrayRaw(string entryName, out TStringArray values)
Get array of raw strings from config entry.
bool IsAmmoPile()
Returns if this entity is Ammo Pile.
void PreAreaDamageActions()
void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
bool IsInventoryItem()
Returns if this entity is InventoryItem.
proto native void SetFullHealth()
Sets full health to all zones and removes fatal damage when applicable.
proto native void PlaceOnSurface()
Place object on surface.
proto native void GetBonePivotsForAnimationSource(int level, string animationSource, out TIntArray pivots)
Get the pivots assigned to the animation source at the specified LOD.
proto native bool ConfigIsExisting(string entryName)
Checks if given entry exists.
proto native void SetDirection(vector vPos)
Set direction of object.
void OnReceivedHit(ImpactEffectsData hitData)
vector ModelToWorld(vector modelPos)
proto int GetBonePivot(int level, int component)
Get the pivot point of the bone from the component index in the LOD, level can be geometry,...
proto native int GetFireGeometryLevel()
proto native float GetHealthLevelValue(int healthLevel, string zone="")
Returns cutoff value for health level specified in object's config class parameter healthLevels.
proto native float GetDamage()
Get total damage (clipped to range 0..1)
proto native vector GetSpeed()
Retrieve object's speed in global space.
bool CanUseConstructionBuild()
Returns if this entity can be built, specifically.
proto native vector GetDamageZonePos(string zoneName)
Obtains middle position of damage zone based on it's name.
proto vector ConfigGetVector(string entryName)
void SetHealth(float health)
Equivalent of SetHealth("", "", float value);.
proto native float GetMaxHealth(string zoneName, string healthType)
Returns maximum value of health.
void SpawnDamageDealtEffect()
void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
string GetModelName()
Returns name of the model of this object without the '.p3d' suffix.
proto native bool ToDelete()
Flag to determine this object is marked to be deleted soon.
proto native void ProcessDirectDamage(int damageType, EntityAI source, string componentName, string ammoName, vector modelPos, float damageCoef=1.0, int flags=0)
Applies damage on object.
string GetDisplayName()
Get display name of entity.
string GetNetworkIDString()
bool IsWoodBase()
Returns whether object is PlanBase.
proto native void SetPosition(vector vPos)
Set position.
bool DisableVicinityIcon()
Disables icon in the vicinity, useful for large, immovable items, that are not buildings.
bool IsKindOf(string type)
Check config class name of the object.
proto native void GetBoneRotationLS(int pivot, out float quaternion[4])
returns local space, model space, world space orientation (quaternion) of a bone
proto native void ConfigGetTextArray(string entryName, out TStringArray values)
Get array of strings from config entry.
TStringArray GetHiddenSelections()
Returns the hiddenSelections array from the object's config.
override string GetDebugName()
void DecreaseHealth(float dec_health, bool auto_delete=true)
Equivalent of DecreaseHealth("", "", float value, bool auto_delete);.
bool PlaySoundSetLoop(out EffectSound sound, string sound_set, float fade_in, float fade_out)
EffectSound - plays soundset on this object in loop and returns state of the sound (true - played,...
proto native void AddProxyPhysics(string proxySelectionName)
proto native vector GetPosition()
Retrieve position.
proto native bool GetCanBeDestroyed()
Returns if object is destroyable.
void SetGlobalHealth(float health)
Equivalent of SetHealth("", "", float value);.
proto native int GetHealthLevel(string zone="")
Returns global health level specified in object's config class parameter healthLevels (range is usual...
proto native void GetBoneTransformWS(int pivot, out vector transform[4])
bool CanUseConstruction()
Returns if this entity can be constucted,deconstructed (e.g. fence,watchtower)
bool KindOf(string tag)
Compares config class name to given string.
bool IsMan()
Returns if this entity is Man.
bool IsTree()
Returns if this entity is tree.
proto native void SetAllowDamage(bool val)
Enable or disable object to receive damage.
void AddHealth(float add_health)
Equivalent of AddHealth("", "", float value);.
proto vector GetActionComponentCenterOOB(int level, int componentIndex)
The center of the component, in model space.
proto native void GetSelectionList(out TStringArray selectionList)
bool PlaySoundSet(out EffectSound sound, string sound_set, float fade_in, float fade_out, bool loop=false)
EffectSound - plays soundset on this object and returns state of the sound (true - played,...
bool IsFuelStation()
Returns if this entity is Fuel Station (extends Building)
proto native void SetCanBeDestroyed(bool val)
Enable or disable destruction of object (after health is depleated)
proto native bool IsPendingDeletion()
proto string ConfigGetString(string entryName)
bool IsItemBase()
Returns if this entity is ItemBase.
proto native vector GetOrientation()
Retrieve orientation (yaw, pitch, roll) in degrees
vector GetSelectionPositionLS(string name)
bool NameOverride(out string output)
string GetSurfaceType()
Returns type of surface under object.
TStringArray GetHiddenSelectionsTextures()
Returns the hiddenSelectionsTextures array from the object's config.
vector GetSelectionPositionWS(string name)
bool CanBeIgnoredByDroppedItem()
bool ConfigGetBool(string entryName)
void OnEnterTrigger(ScriptedEntity trigger)
Object entered trigger.
bool IsFood()
Returns if this entity if a food item.
bool IsAnyInherited(array< typename > typenames)
float GetHealth()
Equivalent of GetHealth("", "");.
proto native void GetDamageZones(out TStringArray dmgZones)
Obtains a list of nammes of all object's damage zones.
proto native vector GetMemoryPointPosByIndex(int pointIndex)
bool EEOnDamageCalculated(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
Event called from C++ right before damage is applied.
bool PlaySoundSetAtMemoryPoint(out EffectSound sound, string soundSet, string memoryPoint, bool looped=false, float play_fade_in=0, float stop_fade_out=0)
bool ShowZonesHealth()
Returns true if the health of damage zones should be displayed (instead of global HP of the entity) (...
bool HasAnimation(string anim_name)
Searches object's config for the given animation name. Returns true if it was found,...
SoundOnVehicle PlaySound(string sound_name, float range, bool create_local=true)
Plays the given sound once on this object's instance. Range is in meters. Created sound is only local...
proto native bool GetAllowDamage()
Returns if object can receive damage.
void PostAreaDamageActions()
void Delete()
Delete this object in next frame.
vector WorldToModel(vector worldPos)
bool HasFixedActionTargetCursorPosition()
proto native vector GetLocalPos(vector vPos)
Calculate local position of other entity to this entity.
bool IsBush()
Returns if this entity is bush.
bool IsWeapon()
Returns if this entity is Weapon.
bool CanProxyObstructSelf()
can the object's own proxy geometry obstruct it? Currently checking 'ObjIntersectView'
float GetMaxHealth()
Equivalent of GetMaxHealth("", "");.
proto native void AddHealth(string zoneName, string healthType, float value)
Adds health.
void AddHealthLevel(int healthLevelDelta, string zone="")
Similar to 'SetHealthLevel', but allows to jump up/down 'healthLevelDelta' amount of health levels fr...
static string GetDebugName(Object o)
proto native vector GetDirectionAside()
Retrieve direction aside vector.
proto native bool GetLODS(notnull out array< LOD > lods)
Retrieve all LODS.
proto native int GetGeometryLevel()
Native functions for getting the level used for calculating the pivot.
bool IsPeltBase()
Returns if this entity is Pelt_Base.
proto native void GetTightlyPackedCorners(ETransformationAxis axis, out vector corners[4])
Get corner positions in worldspace aligned to the orientation of the object (currently only TOP/BOTTO...
proto native void SetOrientation(vector vOrientation)
Set orientation (yaw, pitch, roll) in degrees
void DecreaseHealthCoef(float dec_health_coef, bool auto_delete=true)
Decreases health by the given coeficient.
proto native void GetBoneTransformMS(int pivot, out vector transform[4])
float GetSurfaceNoise()
Returns noise multiplier of surface under object.
bool IsRuined()
Returns whether the object is ruined (0 Health).
proto native bool CanAffectPathgraph()
Returns true if object's geometry can affect pathgraph generation.
proto int ConfigGetInt(string entryName)
proto vector GetActionComponentCenter(int level, int componentIndex)
The center of the component, in model space.
proto void GetActionComponentsForSelectionName(int level, string selectionName, TIntArray componentIndices)
outputs action component index list by given selection, 'geometry' can be "fire" or "view" (default "...
vector GetSelectionPositionOld(string name)
proto native vector GetBonePositionWS(int pivot)
TStringArray GetHiddenSelectionsMaterials()
Returns the hiddenSelectionsMaterials array from the object's config.
bool IsClothing()
Returns if this entity is Clothing.
proto native bool MemoryPointExists(string memoryPoint)
proto void GetActionComponentMinMax(int level, int componentIndex, out vector min, out vector max)
The AABB of the component.
proto native owned string GetActionComponentName(int componentIndex, string geometry="")
returns action component name by given component index, 'geometry' can be "fire" or "view" (default "...
void SetHealthMax(string zoneName="", string healthType="")
Sets health to its maximum (zone or global)
bool IsBuilding()
Returns if this entity is Building.
void AddArrow(Object arrow, int componentIndex, vector closeBonePosWS, vector closeBoneRotWS)
void OnSimulationEnabled()
Event called from C++ when simulation is enabled.
proto native void ConfigGetIntArray(string entryName, out TIntArray values)
Get array of integers from config entry.
void DecreaseHealth(string zoneName, string healthType, float value, bool auto_delete)
Decreases health with the option of auto-deleting the object if its ruined.
bool IsHealthVisible()
Returns if the health of this entity should be displayed (widgets, inventory)
bool IsRock()
Returns if this entity is rock.
proto native vector GetDirection()
Retrieve direction vector.
bool IsDayZCreature()
Checks if this instance is of type DayZCreature.
proto native int GetMemoryPointIndex(string memoryPointName)
If Returns true if this item has EnergyManager in its config. Otherwise returns false.
void OnPlayerRecievedHit()
DEPRECATED.
string GetType()
Get config class of object.
SoundOnVehicle PlaySoundLoop(string sound_name, float range, bool create_local=true)
Plays the given sound in loop on this object's instance. Range is in meters. Created sound is only lo...
bool HasSelection(string selection)
Returns true if the given selection was found in the p3d file. False if otherwise.
bool IsTransmitter()
Returns if this entity is a non-static Transmitter.
void Explode(int damageType, string ammoType="")
Creates an explosion on this object by its ammoType in config.
proto native void SetDynamicPhysicsLifeTime(float lifeTime)
void SetHealthLevel(int healthLevel, string zone="")
Sets specific health level. It will use the cutoff value as returned by 'GetHealthLevelValue' as the ...
proto native bool HasDamageSystem()
Checks if object's DamageSystem has been initialized(despite the name, does not really reliably answe...
void SetHealth01(string zoneName, string healthType, float coef)
Sets health relative to its maximum.
proto native void ConfigGetFloatArray(string entryName, out TFloatArray values)
Get array of floats from config entry.
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Called after remote procedure call is recieved for this object.
bool CanUseHandConstruction()
Returns if this entity can be constructed without tools.
proto native owned string GetLODName(LOD lod)
Retrieve LOD name.
void OnExplodeClient()
Called on clients when this object explodes.
bool DescriptionOverride(out string output)
proto native void SetHealth(string zoneName, string healthType, float value)
Sets current state of health.
proto native bool IsScenery()
Is this Scenery? (handy for excluding terain when it is not needed)
void OnLeaveTrigger(ScriptedEntity trigger)
Object left trigger.
proto native owned int GetActionComponentNameList(int componentIndex, TStringArray nameList, string geometry="")
outputs action component name list by given component index, 'geometry' can be "fire" or "view" (defa...
proto native owned string GetDamageZoneNameByComponentIndex(int componentIndex)
Obtains name of damage zone based on index of specific component.
bool IsMeleeWeapon()
returns if this entity is Melee Weapon
proto string GetDebugNameNative()
native GetDebugName which is internally overloaded where needed
proto native vector GetBonePositionLS(int pivot)
returns local space, model space, world space position of the bone
proto native int GetViewGeometryLevel()
proto void GetNetworkID(out int lowBits, out int highBits)
vector GetSelectionPositionMS(string name)
void SetBeingBackstabbed(int backstabType)
proto native vector GetBonePositionMS(int pivot)
bool IsStaticTransmitter()
Returns if this entity is Static Transmitter.
proto native vector GetDirectionUp()
Retrieve direction up vector.
proto native int GetNumberOfHealthLevels(string zone="")
Returns global number of health levels specified in object's config class parameter healthLevels (ran...
proto native void CreateDynamicPhysics(int interactionLayers)
bool PlaySoundSetAtMemoryPointLooped(out EffectSound sound, string soundSet, string memoryPoint, float play_fade_in=0, float stop_fade_out=0)
void RPC(int rpc_type, array< ref Param > params, bool guaranteed, PlayerIdentity recipient=NULL)
Remote procedure call shortcut, see CGame.RPC / CGame.RPCSingleParam.
proto native void GetBoneTransformLS(int pivot, out vector transform[4])
returns local space, model space, world space transformations of a bone
proto native vector GetBoundingCenter()
proto native vector GetMemoryPointPos(string memoryPointName)
proto native void DecreaseHealth(string zoneName, string healthType, float value)
Decreases health.
bool CanBeRepairedToPristine()
proto native float GetCollisionRadius()
Gets collision radius (bounding sphere)
EntityAI ProcessMeleeItemDamage(int mode=0)
bool IsElectricAppliance()
Returns if this is an appliance, that can be plugged into electric circuit (== not energy source)
proto native vector GetModelSpeed()
Retrieve object's speed in local space.
proto native vector GetGlobalPos(vector vPos)
Calculate global position to this entity from local position.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
The class that will be instanced (moddable)
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySoundEnviroment(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound, updating environment variables.
static EffectSound PlaySoundOnObject(string sound_set, Object parent_object, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Serialization general interface. Serializer API works with:
proto native CGame GetGame()
array< string > TStringArray
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto void MatrixInvMultiply4(vector mat0[4], vector mat1[4], out vector res[4])
Invert-transforms matrix.
static proto void MatrixOrthogonalize4(vector mat[4])
Orthogonalizes matrix.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.