DayZ 1.24
Loading...
Searching...
No Matches
Entity Class Reference
Collaboration diagram for Entity:
[legend]

Protected Member Functions

void EntityAI ()
 
void ~EntityAI ()
 
void DeferredInit ()
 
bool IsInitialized ()
 
int GetHideIconMask ()
 should the item's icon be hidden in any part of the inventory?
 
float ConvertNonlethalDamage (float damage, DamageType damageType)
 
float ConvertNonlethalDamage (float damage)
 DEPRECATED - for legacy purposes.
 
DamageZoneMap GetEntityDamageZoneMap ()
 
map< int, stringGetEntityDamageDisplayNameMap ()
 
bool CanDisplayWeight ()
 'displayWeight' in item config
 
void Log (string msg, string fnc_name="n/a")
 Log.
 
void LogWarning (string msg, string fnc_name="n/a")
 LogWarning.
 
void LogError (string msg, string fnc_name="n/a")
 LogError.
 
bool HasFlammableMaterial ()
 Override this method to return TRUE when this item has or can provide fire. Evaluated on server and client.
 
bool CanBeIgnitedBy (EntityAI igniter=NULL)
 Override this method so it checks whenever this item can be ignited right now or not. Evaluated on Server and Client.
 
bool CanIgniteItem (EntityAI ignite_target=NULL)
 Override this method and check if the given item can be ignited right now by this one. Evaluated on Server and Client.
 
bool IsIgnited ()
 Override this method and make it so it returns whenever this item is on fire right now or not. Evaluated on Server and Client.
 
bool DisassembleOnLastDetach ()
 
bool IsBasebuildingKit ()
 
bool PlacementCanBeRotated ()
 Should return false if you want to disable hologram rotation.
 
void OnIgnitedTarget (EntityAI target_item)
 Executed on Server when this item ignites some target item.
 
void OnIgnitedThis (EntityAI fire_source)
 Executed on Server when some item ignited this one.
 
void OnIgnitedTargetFailed (EntityAI target_item)
 Executed on Server when this item failed to ignite target item.
 
void OnIgnitedThisFailed (EntityAI fire_source)
 Executed on Server when some item failed to ignite this one.
 
bool IsTargetIgnitionSuccessful (EntityAI item_target)
 Final evaluation just before the target item is actually ignited. Evaluated on Server.
 
bool IsThisIgnitionSuccessful (EntityAI item_source=NULL)
 Final evaluation just before this item is actually ignited from fire source. Evaluated on Server.
 
void OnPlacementStarted (Man player)
 
void OnHologramBeingPlaced (Man player)
 
void OnPlacementComplete (Man player, vector position="0 0 0", vector orientation="0 0 0")
 
void OnPlacementCancelled (Man player)
 
bool CanBePlaced (Man player, vector position)
 
string CanBePlacedFailMessage (Man player, vector position)
 Method which returns message why object can't be placed at given position.
 
bool DoPlacingHeightCheck ()
 Do the roof check when placing this?
 
float HeightCheckOverride ()
 used as script-side override of distance for specific height checks
 
float HeightStartCheckOverride ()
 used as script-side override of start pos for specific height checks
 
bool IsEmpty ()
 is this container empty or not, checks both cargo and attachments
 
bool CanBeSplit ()
 
bool HasAnyCargo ()
 is this container empty or not, checks only cargo
 
array< EntityAIGetAttachmentsWithCargo ()
 
array< EntityAIGetAttachmentsWithAttachments ()
 
int GetAgents ()
 
void RemoveAgent (int agent_id)
 
void RemoveAllAgents ()
 
void RemoveAllAgentsExcept (int agent_to_keep)
 
void InsertAgent (int agent, float count=1)
 
override bool IsEntityAI ()
 
bool IsInventoryVisible ()
 
bool IsPlayer ()
 
bool IsAnimal ()
 
bool IsZombie ()
 
bool IsZombieMilitary ()
 
bool IsIgnoredByConstruction ()
 
bool CanBeTargetedByAI (EntityAI ai)
 
bool CanBeBackstabbed ()
 
override void Delete ()
 Delete this object in next frame.
 
void DeleteOnClient ()
 
void DeleteSafe ()
 
void DeleteSave ()
 
bool IsSetForDeletion ()
 
override bool CanBeActionTarget ()
 
void SetPrepareToDelete ()
 
bool IsPreparedToDelete ()
 
void CheckForDestroy ()
 
bool IsPrepareToDelete ()
 
bool TryDelete ()
 
void OnBeforeTryDelete ()
 
proto native EntityAI GetHierarchyRoot ()
 Returns root of current hierarchy (for example: if this entity is in Backpack on gnd, returns Backpack)
 
proto native Man GetHierarchyRootPlayer ()
 Returns root of current hierarchy cast to Man.
 
proto native EntityAI GetHierarchyParent ()
 Returns direct parent of current entity.
 
proto native CEItemProfile GetEconomyProfile ()
 Get economy item profile (if assigned, otherwise null)
 
int GetHierarchyLevel (int lvl=0)
 
void OnInventoryInit ()
 
void EEInit ()
 Called upon object creation.
 
void EEDelete (EntityAI parent)
 Called right before object deleting.
 
override void OnExplosionEffects (Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
 
void OnItemLocationChanged (EntityAI old_owner, EntityAI new_owner)
 
void OnItemAttachmentSlotChanged (notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
void EEItemLocationChanged (notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
 
void EEParentedTo (EntityAI parent)
 Called from 'IEntity.AddChild'.
 
void EEParentedFrom (EntityAI parent)
 Called from 'IEntity.RemoveChild' or 'IEntity.AddChild' when hierarchy changes.
 
void EEInventoryIn (Man newParentMan, EntityAI diz, EntityAI newParent)
 
void EEInventoryOut (Man oldParentMan, EntityAI diz, EntityAI newParent)
 
void EEAmmoChanged ()
 
void EEHealthLevelChanged (int oldLevel, int newLevel, string zone)
 
void OnDamageDestroyed (int oldLevel)
 Called when the health gets to the min value, 'oldLevel' is previous health level, 'oldLevel' -1 means this entity was just spawned.
 
void AttemptDestructionBehaviour (int oldLevel, int newLevel, string zone)
 
void SetTakeable (bool pState)
 
void EEKilled (Object killer)
 called on server when the entity is killed
 
bool ReplaceOnDeath ()
 
string GetDeadItemName ()
 
bool KeepHealthOnReplace ()
 
void DeathUpdate ()
 
void OnAttachmentRuined (EntityAI attachment)
 Called when some attachment of this parent is ruined. Called on server and client side.
 
void EEHitBy (TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
 
void EEHitByRemote (int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos)
 
void EEItemAttached (EntityAI item, string slot_name)
 
void SwitchItemSelectionTexture (EntityAI item, string slot_name)
 
void SwitchItemSelectionTextureEx (EItemManipulationContext context, Param par=null)
 
void EEItemDetached (EntityAI item, string slot_name)
 
void EECargoIn (EntityAI item)
 
void EECargoOut (EntityAI item)
 
void EECargoMove (EntityAI item)
 
ScriptInvoker GetOnItemAttached ()
 
ScriptInvoker GetOnItemDetached ()
 
ScriptInvoker GetOnItemAddedIntoCargo ()
 
ScriptInvoker GetOnItemRemovedFromCargo ()
 
ScriptInvoker GetOnItemMovedInCargo ()
 
ScriptInvoker GetOnItemFlipped ()
 
ScriptInvoker GetOnViewIndexChanged ()
 
ScriptInvoker GetOnSetLock ()
 
ScriptInvoker GetOnReleaseLock ()
 
ScriptInvoker GetOnAttachmentSetLock ()
 
ScriptInvoker GetOnAttachmentReleaseLock ()
 
ScriptInvoker GetOnHitByInvoker ()
 
ScriptInvoker GetOnKilledInvoker ()
 
void OnMovedInsideCargo (EntityAI container)
 Called when this item enters cargo of some container.
 
void OnRemovedFromCargo (EntityAI container)
 Called when this item exits cargo of some container.
 
void OnMovedWithinCargo (EntityAI container)
 Called when this item moves within cargo of some container.
 
void EEOnAfterLoad ()
 Called when entity is part of "connected system" and being restored after load.
 
void EEOnCECreate ()
 Called when entity is being created as new by CE/ Debug.
 
void AfterStoreLoad ()
 Called when entity is being loaded from DB or Storage (after all children loaded)
 
void OnBinLoadItemsDropped ()
 Called when an item fails to get loaded into the inventory of an entity and gets dropped.
 
void HideAllSelections ()
 Sets all animation values to 1, making them INVISIBLE if they are configured in models.cfg in such way. These selections must also be defined in the entity's config class in 'AnimationSources'.
 
void ShowAllSelections ()
 Sets all animation values to 0, making them VISIBLE if they are configured in models.cfg in such way. These selections must also be defined in the entity's config class in 'AnimationSources'.
 
bool CanReceiveAttachment (EntityAI attachment, int slotId)
 calls this->CanReceiveAttachment(attachment)
 
bool CanLoadAttachment (EntityAI attachment)
 
bool CanPutAsAttachment (EntityAI parent)
 calls this->CanPutAsAttachment(parent)
 
bool CanSwitchDuringAttach (EntityAI parent)
 
bool CanReleaseAttachment (EntityAI attachment)
 calls this->CanReleaseAttachment(attachment)
 
bool CanDetachAttachment (EntityAI parent)
 calls this->CanDetachAttachment(parent)
 
bool CanBeFSwaped ()
 
bool CanCombineAttachment (notnull EntityAI e, int slot, bool stack_max_limit=false)
 
bool CanBeCombined (EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
 
void CombineItemsClient (EntityAI entity2, bool use_stack_max=false)
 
bool CanReceiveItemIntoCargo (EntityAI item)
 calls this->CanReceiveItemIntoCargo(item)
 
bool CanLoadItemIntoCargo (EntityAI item)
 calls this->CanLoadItemIntoCargo(item), is called on server start when loading in the storage
 
bool CanPutInCargo (EntityAI parent)
 calls this->CanPutInCargo(parent)
 
bool CanSwapItemInCargo (EntityAI child_entity, EntityAI new_entity)
 calls this->CanSwapItemInCargo(child_entity, new_entity)
 
bool CanReleaseCargo (EntityAI cargo)
 calls this->CanReleaseCargo(cargo)
 
bool CanRemoveFromCargo (EntityAI parent)
 calls this->CanRemoveFromCargo(parent)
 
bool CanReceiveItemIntoHands (EntityAI item_to_hands)
 calls this->CanReceiveItemIntoHands(item_to_hands)
 
bool IsBeingPlaced ()
 
override bool IsHologram ()
 
bool CanSaveItemInHands (EntityAI item_in_hands)
 
bool CanPutIntoHands (EntityAI parent)
 calls this->CanPutIntoHands(parent)
 
bool CanReleaseFromHands (EntityAI handheld)
 calls this->CanReleaseFromHands(handheld)
 
bool CanRemoveFromHands (EntityAI parent)
 calls this->CanRemoveFromHands(parent)
 
bool CanDisplayAttachmentSlot (string slot_name)
 
bool CanDisplayAttachmentSlot (int slot_id)
 
bool CanDisplayAnyAttachmentSlot ()
 
bool CanDisplayAttachmentCategory (string category_name)
 
bool CanDisplayCargo ()
 
bool CanAssignToQuickbar ()
 
bool CanAssignAttachmentsToQuickbar ()
 
bool IgnoreOutOfReachCondition ()
 
void OnWasAttached (EntityAI parent, int slot_id)
 
void OnWasDetached (EntityAI parent, int slot_id)
 
void OnCargoChanged ()
 
bool IsTakeable ()
 
proto native GameInventory GetInventory ()
 
proto native void CreateAndInitInventory ()
 
proto native void DestroyInventory ()
 
int GetSlotsCountCorrect ()
 
EntityAI FindAttachmentBySlotName (string slot_name)
 
bool IsLockedInSlot ()
 
bool PredictiveTakeEntityToInventory (FindInventoryLocationType flags, notnull EntityAI item)
 Put item anywhere into this entity (as attachment or into cargo, recursively)
 
bool LocalTakeEntityToInventory (FindInventoryLocationType flags, notnull EntityAI item)
 
bool ServerTakeEntityToInventory (FindInventoryLocationType flags, notnull EntityAI item)
 
bool PredictiveTakeEntityToTargetInventory (notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
 
bool LocalTakeEntityToTargetInventory (notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
 
bool ServerTakeEntityToTargetInventory (notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
 
bool PredictiveTakeEntityToCargo (notnull EntityAI item)
 Put item into into cargo.
 
bool LocalTakeEntityToCargo (notnull EntityAI item)
 
bool ServerTakeEntityToCargo (notnull EntityAI item)
 
bool PredictiveTakeEntityToTargetCargo (notnull EntityAI target, notnull EntityAI item)
 
bool LocalTakeEntityToTargetCargo (notnull EntityAI target, notnull EntityAI item)
 
bool ServerTakeEntityToTargetCargo (notnull EntityAI target, notnull EntityAI item)
 
bool PredictiveTakeEntityToCargoEx (notnull EntityAI item, int idx, int row, int col)
 Put item into into cargo on specific cargo location.
 
bool LocalTakeEntityToCargoEx (notnull EntityAI item, int idx, int row, int col)
 
bool PredictiveTakeEntityToTargetCargoEx (notnull CargoBase cargo, notnull EntityAI item, int row, int col)
 
bool LocalTakeEntityToTargetCargoEx (notnull CargoBase cargo, notnull EntityAI item, int row, int col)
 
bool ServerTakeEntityToTargetCargoEx (notnull CargoBase cargo, notnull EntityAI item, int row, int col)
 
bool PredictiveTakeEntityAsAttachmentEx (notnull EntityAI item, int slot)
 Returns if item can be added as attachment on specific slot. Note that slot index IS NOT slot ID! Slot ID is defined in DZ/data/config.cpp.
 
bool LocalTakeEntityAsAttachmentEx (notnull EntityAI item, int slot)
 
bool ServerTakeEntityAsAttachmentEx (notnull EntityAI item, int slot)
 
bool PredictiveTakeEntityToTargetAttachmentEx (notnull EntityAI target, notnull EntityAI item, int slot)
 
bool LocalTakeEntityToTargetAttachmentEx (notnull EntityAI target, notnull EntityAI item, int slot)
 
bool ServerTakeEntityToTargetAttachmentEx (notnull EntityAI target, notnull EntityAI item, int slot)
 
bool PredictiveTakeEntityToTargetAttachment (notnull EntityAI target, notnull EntityAI item)
 
bool LocalTakeEntityToTargetAttachment (notnull EntityAI target, notnull EntityAI item)
 
bool ServerTakeEntityToTargetAttachment (notnull EntityAI target, notnull EntityAI item)
 
bool PredictiveTakeToDst (notnull InventoryLocation src, notnull InventoryLocation dst)
 
bool LocalTakeToDst (notnull InventoryLocation src, notnull InventoryLocation dst)
 
bool ServerTakeToDst (notnull InventoryLocation src, notnull InventoryLocation dst)
 
bool PredictiveTakeEntityAsAttachment (notnull EntityAI item)
 Put item into as attachment.
 
bool LocalTakeEntityAsAttachment (notnull EntityAI item)
 
bool ServerTakeEntityAsAttachment (notnull EntityAI item)
 
bool PredictiveDropEntity (notnull EntityAI item)
 
bool LocalDropEntity (notnull EntityAI item)
 
bool ServerDropEntity (notnull EntityAI item)
 
EntityAI GetAttachmentByType (typename type)
 Get attached entity by type.
 
EntityAI GetAttachmentByConfigTypeName (string type)
 Get attached entity by config type name.
 
bool CanDropEntity (notnull EntityAI item)
 Returns if item can be dropped out from this entity.
 
EntityAI SpawnInInventoryOrGroundPos (string object_name, GameInventory inv, vector pos)
 
EntityAI SpawnEntityOnGroundPos (string object_name, vector pos)
 
EntityAI SpawnEntityOnGround (string object_name, vector mat[4])
 
bool CanSwapEntities (EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
 
void SetWet (float value, bool allow_client=false)
 
void AddWet (float value)
 
void SetWetMax ()
 
float GetWet ()
 
float GetWetMax ()
 
float GetWetMin ()
 
float GetWetInit ()
 
bool HasWetness ()
 
void OnWetChanged (float newVal, float oldVal)
 
void OnWetLevelChanged (EWetnessLevel newLevel, EWetnessLevel oldLevel)
 
EWetnessLevel GetWetLevel ()
 
float GetQuantity ()
 
int GetQuantityMax ()
 
void SetQuantityToMinimum ()
 
int GetTargetQuantityMax (int attSlotID=-1)
 
int GetQuickBarBonus ()
 
void SetTemperature (float value, bool allow_client=false)
 
void AddTemperature (float value)
 
void SetTemperatureMax ()
 
float GetTemperature ()
 
float GetTemperatureInit ()
 
float GetTemperatureMin ()
 
float GetTemperatureMax ()
 
HiddenSelectionsData GetHiddenSelectionsData ()
 
int GetHiddenSelectionIndex (string selection)
 Returns index of the string found in cfg array 'hiddenSelections'. If it's not found then it returns -1.
 
override TStringArray GetHiddenSelections ()
 Returns the hiddenSelectionsTextures array from the object's config.
 
override TStringArray GetHiddenSelectionsTextures ()
 Returns the hiddenSelectionsTextures array from the object's config.
 
override TStringArray GetHiddenSelectionsMaterials ()
 Returns the hiddenSelectionsMaterials array from the object's config.
 
proto native void PlaceOnSurfaceRotated (out vector trans[4], vector pos, float dx=0, float dz=0, float fAngle=0, bool align=false)
 
proto native void RegisterNetSyncVariableBool (string variableName)
 registers bool variable synchronized over network
 
proto native void RegisterNetSyncVariableBoolSignal (string variableName)
 when bool variable is true, it's sent to clients and become false again
 
proto native void RegisterNetSyncVariableInt (string variableName, int minValue=0, int maxValue=0)
 registers int variable synchronized over network
 
proto native void RegisterNetSyncVariableFloat (string variableName, float minValue=0, float maxValue=0, int precision=1)
 registers float variable synchronized over network
 
proto native void RegisterNetSyncVariableObject (string variableName)
 registers object variable synchronized over network, only synchronizes if network id is assigned. Doesn't handle object despawn on client
 
proto native void UpdateNetSyncVariableInt (string variableName, float minValue=0, float maxValue=0)
 
proto native void UpdateNetSyncVariableFloat (string variableName, float minValue=0, float maxValue=0, int precision=1)
 
proto native void SwitchLight (bool isOn)
 
proto native void SetSimpleHiddenSelectionState (int index, bool state)
 Simple hidden selection state; 0 == hidden.
 
proto native bool IsSimpleHiddenSelectionVisible (int index)
 
proto native void SetObjectTexture (int index, string texture_name)
 Change texture in hiddenSelections.
 
proto native owned string GetObjectTexture (int index)
 
proto native void SetObjectMaterial (int index, string mat_name)
 Change material in hiddenSelections.
 
proto native owned string GetObjectMaterial (int index)
 
proto native bool IsPilotLight ()
 
proto native void SetPilotLight (bool isOn)
 
void OnStoreSave (ParamsWriteContext ctx)
 Engine calls this function to collect data from entity to store for persistence (on server side).
 
bool OnStoreLoad (ParamsReadContext ctx, int version)
 Called when data is loaded from persistence (on server side).
 
proto native void SetSynchDirty ()
 Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take effect only in MP on server side)
 
void OnVariablesSynchronized ()
 Called on clients after receiving synchronization data from server.
 
proto native void SetAITargetCallbacks (AbstractAITargetCallbacks callbacks)
 
override void EOnFrame (IEntity other, float timeSlice)
 
string GetDebugText ()
 
void GetDebugButtonNames (out string button1, out string button2, out string button3, out string button4)
 
void OnDebugButtonPressClient (int button_index)
 
void OnDebugButtonPressServer (int button_index)
 
Shape DebugBBoxDraw ()
 
void DebugBBoxSetColor (int color)
 
void DebugBBoxDelete ()
 
Shape DebugDirectionDraw (float distance=1)
 
void DebugDirectionSetColor (int color)
 
void DebugDirectionDelete ()
 
void HideSelection (string selection_name)
 Hides selection of the given name. Must be configed in config.cpp and models.cfg.
 
void ShowSelection (string selection_name)
 Shows selection of the given name. Must be configed in config.hpp and models.cfg.
 
proto void GetPersistentID (out int b1, out int b2, out int b3, out int b4)
 
proto native void SetLifetime (float fLifeTime)
 Set (override) remaining economy lifetime (seconds)
 
proto native float GetLifetime ()
 Get remaining economy lifetime (seconds)
 
proto native void IncreaseLifetime ()
 Reset economy lifetime to default (seconds)
 
proto native void SetLifetimeMax (float fLifeTime)
 Set (override) max economy lifetime per entity instance (seconds)
 
proto native float GetLifetimeMax ()
 Get max economy lifetime per instance - default is from DB (seconds)
 
void IncreaseLifetimeUp ()
 Reset economy lifetime to default across entity hierarchy all the way to the topmost entity.
 
ComponentBodyStaging GetCompBS ()
 Use this to access Body Staging component on dead character. Returns NULL if the given object lacks such component.
 
override void OnRPC (PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
 
float GetWetWeightModifier ()
 
float GetConfigWeightModified ()
 
int GetWeight ()
 
void ClearWeightDirty ()
 
void SetWeightDirty ()
 
float GetInventoryAndCargoWeight (bool forceRecalc=false)
 
float GetWeightSpecialized (bool forceRecalc=false)
 returns weight of the entity in a way that's specific to the entity type and is internal to the weight system calculation, to obtain entity's weight, use the 'GetWeightEx' method instead
 
float GetWeightEx (bool forceRecalc=false)
 returns overall weight of the entity, 'forceRecalc = true' is meant to be used only when debugging, using it in gameplay code is higly inadvisable as it bypasses the weight caching and has adverse effect on performance
 
void UpdateWeight (WeightUpdateType updateType=WeightUpdateType.FULL, float weightAdjustment=0)
 
float GetSingleInventoryItemWeightEx ()
 
void GetDebugActions (out TSelectableActionInfoArrayEx outputList)
 
bool OnAction (int action_id, Man player, ParamsReadContext ctx)
 
string GetHitComponentForAI ()
 Returns hit component for the Entity (overriden for each Type - PlayerBase, DayZInfected, DayZAnimal, etc.)
 
string GetDefaultHitComponent ()
 returns default hit component for the Entity (overriden for each Type - PlayerBase, DayZInfected, DayZAnimal, etc.)
 
string GetDefaultHitPositionComponent ()
 returns default hit position component name for the Entity (overriden by type if needed - used mainly as support for impact particles)
 
array< stringGetSuitableFinisherHitComponents ()
 
vector GetDefaultHitPosition ()
 
int GetMeleeTargetType ()
 value is related to EMeleeTargetType
 
string GetAttachmentSoundType ()
 returns sound type of attachment (used for clothing and weapons on DayZPlayerImplement, paired with Anim*Type enum from DayZAnimEvents)
 
bool IsHeavyBehaviour ()
 returns item behaviour of item (more in ItemBase)
 
bool IsOneHandedBehaviour ()
 returns item behaviour of item (more in ItemBase)
 
bool IsTwoHandedBehaviour ()
 returns item behaviour of item (more in ItemBase)
 
string ChangeIntoOnAttach (string slot)
 
string ChangeIntoOnDetach ()
 
void OnCEUpdate ()
 Central economy calls this function whenever going over all the entities.
 
void OnDebugSpawnEx (DebugSpawnParams params)
 
void OnDebugSpawn ()
 
override EntityAI ProcessMeleeItemDamage (int mode=0)
 
float GetLiquidThroughputCoef ()
 Returns liquid throughput coeficient.
 
string GetInvulnerabilityTypeString ()
 
void ProcessInvulnerabilityCheck (string servercfg_param)
 
void SetBayonetAttached (bool pState, int slot_idx=-1)
 
bool HasBayonetAttached ()
 
int GetBayonetAttachmentIdx ()
 
void SetButtstockAttached (bool pState, int slot_idx=-1)
 
bool HasButtstockAttached ()
 
int GetButtstockAttachmentIdx ()
 
void SetInvisibleRecursive (bool invisible, EntityAI parent=null, array< int > attachments=null)
 
void SoundHardTreeFallingPlay ()
 
void SoundSoftTreeFallingPlay ()
 
void SoundHardBushFallingPlay ()
 
void SoundSoftBushFallingPlay ()
 
void RegisterTransportHit (Transport transport)
 
bool GetInventoryHandAnimation (notnull InventoryLocation loc, out int value)
 
bool TranslateSlotFromSelection (string selection_name, out int slot_id)
 
bool IsUniversalTemperatureSource ()
 Universal Temperature Sources Helpers.
 
UTemperatureSource GetUniversalTemperatureSource ()
 
void SetUniversalTemperatureSource (UTemperatureSource uts)
 
vector GetUniversalTemperatureSourcePosition ()
 
RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour ()
 Remotely controlled devices helpers.
 
void PairRemote (notnull EntityAI trigger)
 
void UnpairRemote ()
 
EntityAI GetPairDevice ()
 
void SetPersistentPairID (int id)
 
bool HasTurnableValveBehavior ()
 Turnable Valve behaviour.
 
bool IsValveTurnable (int pValveIndex)
 
int GetTurnableValveIndex (int pComponentIndex)
 
void ExecuteActionsConnectedToValve (int pValveIndex)
 
set< intGetAttachmentExclusionInitSlotValue (int slotId)
 override this to modify slot behavior for specific items, or just set 'm_AttachmentExclusionMaskGlobal' value for simple items
 
void InitLegacyConfigExclusionValues ()
 
bool InitLegacyExclusionCheck ()
 
void InitLegacySlotExclusionValuesImplicit ()
 adding base one-directional relations between headgear, masks, eyewear, and headstraps (exception)
 
void InitLegacySlotExclusionValuesDerived ()
 
void InitGlobalExclusionValues ()
 override to init part of the mask, independent of slot-specific behavior
 
void AddSingleExclusionValueGlobal (EAttExclusions value)
 to help with item staging exclusions
 
void ClearSingleExclusionValueGlobal (EAttExclusions value)
 to help with item staging exclusions
 
void SetAttachmentExclusionMaskGlobal (set< int > values)
 
void SetAttachmentExclusionMaskSlot (int slotId, set< int > values)
 sets values for specific slot
 
bool IsExclusionFlagPresent (set< int > values)
 checks 'this' if the incoming flag is present for the current state (slot behavior and others)
 
bool IsExclusionFlagPresentRecursive (set< int > values, int targetSlot)
 Gets flag from what is effectively an owner.
 
bool CheckExclusionAccessCondition (int occupiedSlot, int targetSlot, set< int > value, inout set< int > adjustedValue)
 
void AdjustExclusionAccessCondition (int occupiedSlot, int testedSlot, set< int > value, inout set< int > adjustedValue)
 if we want to filter
 
bool CheckExclusionAccessPropagation (int occupiedSlot, int targetSlot, set< int > value, inout set< int > adjustedValue)
 special propagation contition
 
void AdjustExclusionAccessPropagation (int occupiedSlot, int testedSlot, set< int > value, inout set< int > adjustedValue)
 if we want to filter propagation specifically; DO NOT override unless you know what you are doing.
 
bool IsManagingArrows ()
 
ArrowManagerBase GetArrowManager ()
 
void SetFromProjectile (ProjectileStoppedInfo info)
 
void ClearInventory ()
 
bool IsSkinned ()
 Skinning.
 
void SetAsSkinned ()
 
bool CanBeSkinnedWith (EntityAI tool)
 
ComponentEnergyManager GetCompEM ()
 
bool HasEnergyManager ()
 If this item has class EnergyManager in its config then it returns true. Otherwise returns false.
 
void OnWorkStart ()
 Energy manager event: Called only once when this device starts doing its work.
 
void OnWork (float consumed_energy)
 Energy manager event: Called every device update if its supposed to do some work. The update can be every second or at random, depending on its manipulation.
 
void OnWorkStop ()
 Energy manager event: Called when the device stops working (was switched OFF or ran out of energy)
 
void OnSwitchOn ()
 Energy manager event: Called when the device is switched on.
 
void OnSwitchOff ()
 Energy manager event: Called when the device is switched OFF.
 
void OnIsPlugged (EntityAI source_device)
 Energy manager event: Called when this device is plugged into some energy source.
 
void OnIsUnplugged (EntityAI last_energy_source)
 Energy manager event: Called when this device is UNPLUGGED from the energy source.
 
void OnOwnSocketTaken (EntityAI device)
 Energy manager event: When something is plugged into this device.
 
void OnOwnSocketReleased (EntityAI device)
 Energy manager event: When something is UNPLUGGED from this device.
 
void OnInitEnergy ()
 Energy manager event: Object's initialization. Energy Manager is fully initialized by this point.
 
void OnEnergyConsumed ()
 Energy manager event: Called when energy was consumed on this device. ALWAYS CALL super.OnEnergyConsumed() !!!
 
void OnEnergyAdded ()
 Energy manager event: Called when energy was added on this device. ALWAYS CALL super.OnEnergyAdded() !!!
 

Static Protected Member Functions

static EWetnessLevel GetWetLevelInternal (float wetness)
 

Protected Attributes

ref DamageZoneMap m_DamageZoneMap
 
bool m_CanDisplayWeight
 
float m_ElapsedSinceLastUpdate
 
UTemperatureSource m_UniversalTemperatureSource
 
bool m_PendingDelete = false
 
bool m_Initialized = false
 
bool m_TransportHitRegistered = false
 
vector m_TransportHitVelocity
 
ref ScriptInvoker m_OnItemAttached
 
ref ScriptInvoker m_OnItemDetached
 
ref ScriptInvoker m_OnItemAddedIntoCargo
 
ref ScriptInvoker m_OnItemRemovedFromCargo
 
ref ScriptInvoker m_OnItemMovedInCargo
 
ref ScriptInvoker m_OnItemFlipped
 
ref ScriptInvoker m_OnViewIndexChanged
 
ref ScriptInvoker m_OnSetLock
 
ref ScriptInvoker m_OnReleaseLock
 
ref ScriptInvoker m_OnAttachmentSetLock
 
ref ScriptInvoker m_OnAttachmentReleaseLock
 
ref ScriptInvoker m_OnHitByInvoker
 
ref ScriptInvoker m_OnKilledInvoker
 

Private Member Functions

proto native void SetNearPlane (float nearPlane)
 
proto native float GetNearPlane ()
 
proto native void SetActive (bool active)
 Sets this camera as active.
 
proto native bool IsActive ()
 Is this camera active?
 
proto native void SetFOV (float fov)
 Field of View settings.
 
proto native void SetFocus (float distance, float blur)
 Depth of Field settings.
 
proto native void LookAt (vector targetPos)
 Orientation change by lookAt point.
 
Component CreateComponent (int comp_type, string extended_class_name="")
 CreateComponent.
 
Component GetComponent (int comp_type, string extended_class_name="")
 GetComponent.
 
bool DeleteComponent (int comp_type)
 DeleteComponent.
 
string GetDestructionBehaviour ()
 
bool IsDestructionBehaviour ()
 
bool HasComponent (int comp_type)
 IsComponentExist.
 
void MaxLifetimeRefreshCalc ()
 Calculates if the max lifetime is higher than refresher frequency (i.e. gets kept alive by refresher)
 
bool IsRefresherSignalingViable ()
 
void InitDamageZoneMapping ()
 Initializes script-side map of damage zones and their components (named selections in models)
 
void InitDamageZoneDisplayNameMapping ()
 Initialize map of damage zone display names for more optimized retrieval.
 
void InitAttachmentExclusionValues ()
 
void InitInherentSlotExclusionMap ()
 map stored on instance to better respond to various state changes
 
void PropagateExclusionValueRecursive (set< int > values, int slotId)
 
void ClearExclusionValueRecursive (set< int > values, int slotId)
 
set< intGetAttachmentExclusionMaskAll (int slotId)
 Slot-specific, children (attachments), and additional (state etc.) masks combined.
 
set< intGetAttachmentExclusionMaskSlot (int slotId)
 Specific slot behavior.
 
set< intGetAttachmentExclusionMaskGlobal ()
 Global mask value, independent of slot-specific behavior!
 
set< intGetAttachmentExclusionMaskChildren ()
 Mask value coming from the item's attachments.
 
bool HasInternalExclusionConflicts (int targetSlot)
 checks if any attachment or item state would interfere with this being attached into a different slot (Headgear -> Mask)
 
proto native void SetLightType (int pType)
 
proto native int GetLightType ()
 
proto native void SetEnabled (bool pState)
 
proto native bool IsEnabled ()
 
proto native void SetCastShadow (bool pState)
 
proto native bool GetCastShadow ()
 
proto native bool EnableSpecular (bool pState)
 
proto native bool EnableLinear (bool pState)
 
proto native void SetPulseCoef (float pState)
 
proto native void SetVisibleDuringDaylight (bool pState)
 
proto native bool IsVisibleDuringDaylight ()
 
proto native void SetRadius (float pValue)
 
proto native float GetRadius ()
 
proto native void EnableHeatHaze (bool pState)
 
proto native void SetHeatHazeRadius (float pValue)
 
proto native float GetHeatHazeRadius ()
 
proto native void SetHeatHazePower (float pValue)
 
proto native float GetHeatHazePower ()
 
proto native void SetDiffuseColor (float pRed, float pGreen, float pBlue)
 
proto native void SetDiffuseColorV (vector pColorVector)
 
proto native void SetDiffuseAlpha (float pAlpha)
 
proto native vector GetDiffuseColorV ()
 
proto native float GetDiffuseAlpha ()
 
proto native void SetAmbientColor (float pRed, float pGreen, float pBlue)
 
proto native void SetAmbientColorV (vector pColorVector)
 
proto native void SetAmbientAlpha (float pAlpha)
 
proto native vector GetAmbientColorV ()
 
proto native float GetAmbientAlpha ()
 
proto native void SetBrightness (float pValue)
 
proto native float GetBrightness ()
 
proto native void SetFlareVisible (bool pState)
 
proto native bool IsFlareVisible ()
 
proto native void SetFlareRelPosition (vector pPosition)
 
proto native vector GetFlareRelPosition ()
 
proto native void SetSpotLightAngle (float pValue)
 
proto native float GetSpotLightAngle ()
 
proto native float GetSoundLength ()
 

Static Private Member Functions

static proto native Camera GetCurrentCamera ()
 Returns active Camera instance (note: player's camera is not Camera instance - thus it return null)
 
static proto native float GetCurrentFOV ()
 Returns FOV of current camera object.
 
static proto native void InterpolateTo (Camera targetCamera, float time, int type)
 Interpolation between camera instances (current camera becomes targetCamera at the end of interpolation)
 

Private Attributes

bool m_DeathSyncSent
 
bool m_KilledByHeadshot
 
bool m_PreparedToDelete = false
 
bool m_RefresherViable = false
 
bool m_WeightDirty = 1
 
ref map< int, ref set< int > > m_AttachmentExclusionSlotMap
 
ref set< intm_AttachmentExclusionMaskGlobal
 
ref set< intm_AttachmentExclusionMaskChildren
 
ref DestructionEffectBase m_DestructionBehaviourObj
 
ref KillerData m_KillerData
 
ref HiddenSelectionsData m_HiddenSelectionsData
 
const int DEAD_REPLACE_DELAY = 2000
 
const int DELETE_CHECK_DELAY = 100
 
ref array< EntityAIm_AttachmentsWithCargo
 
ref array< EntityAIm_AttachmentsWithAttachments
 
ref InventoryLocation m_OldLocation
 
ref map< int, stringm_DamageDisplayNameMap = new map<int, string>
 
float m_Weight
 
float m_WeightEx
 
float m_ConfigWeight = ConfigGetInt("weight")
 
float m_LastUpdatedTime
 
ref ComponentsBank m_ComponentsBank
 
ComponentEnergyManager m_EM
 
int m_ViewIndex = 0
 
void SetViewIndex (int index)
 Sets item preview index.
 
int GetViewIndex ()
 Returns item preview index !!!! IF OVERRIDING with more dynamic events call GetOnViewIndexChanged() in constructor on client !!!!
 

Detailed Description

Definition at line 1 of file Camera.c.

Constructor & Destructor Documentation

◆ ~EntityAI()

void Entity::~EntityAI ( )
inlineprotected

Definition at line 204 of file EntityAI.c.

205 {
206
207 }

Member Function Documentation

◆ AddSingleExclusionValueGlobal()

void Entity::AddSingleExclusionValueGlobal ( EAttExclusions value)
inlineprotected

to help with item staging exclusions

Definition at line 3347 of file EntityAI.c.

3348 {
3349 if (m_AttachmentExclusionMaskGlobal.Find(value) == -1)
3351 }
ref set< int > m_AttachmentExclusionMaskGlobal
Definition EntityAI.c:107

◆ AddTemperature()

void Entity::AddTemperature ( float value)
inlineprotected

Definition at line 1973 of file EntityAI.c.

1973{};

◆ AddWet()

void Entity::AddWet ( float value)
protected

◆ AdjustExclusionAccessCondition()

void Entity::AdjustExclusionAccessCondition ( int occupiedSlot,
int testedSlot,
set< int > value,
inout set< int > adjustedValue )
inlineprotected

if we want to filter

Definition at line 3523 of file EntityAI.c.

3524 {
3526 }

◆ AdjustExclusionAccessPropagation()

void Entity::AdjustExclusionAccessPropagation ( int occupiedSlot,
int testedSlot,
set< int > value,
inout set< int > adjustedValue )
inlineprotected

if we want to filter propagation specifically; DO NOT override unless you know what you are doing.

Definition at line 3545 of file EntityAI.c.

3546 {
3548 }
void AdjustExclusionAccessCondition(int occupiedSlot, int testedSlot, set< int > value, inout set< int > adjustedValue)
if we want to filter
Definition EntityAI.c:3523

◆ AfterStoreLoad()

void Entity::AfterStoreLoad ( )
inlineprotected

Called when entity is being loaded from DB or Storage (after all children loaded)

Definition at line 1183 of file EntityAI.c.

1184 {
1185 }

◆ AttemptDestructionBehaviour()

void Entity::AttemptDestructionBehaviour ( int oldLevel,
int newLevel,
string zone )
inlineprotected

Definition at line 863 of file EntityAI.c.

864 {
866 {
868
869 if (destType)
870 {
873
875 m_DestructionBehaviourObj.OnHealthLevelChanged(this, oldLevel, newLevel, zone);
876 }
877 else
878 ErrorEx("Incorrect destruction behaviour type, make sure the class returned in 'GetDestructionBehaviour()' is a valid type inheriting from 'DestructionEffectBase'");
879 }
880 }
string GetDestructionBehaviour()
Definition EntityAI.c:249
bool IsDestructionBehaviour()
Definition EntityAI.c:254
ref DestructionEffectBase m_DestructionBehaviourObj
Definition EntityAI.c:110
enum ShapeType ErrorEx
proto native ToType()
Returns internal type representation. Can be used in runtime, or cached in variables and used for fas...

References ErrorEx, GetDestructionBehaviour(), and IsDestructionBehaviour().

◆ CanAssignAttachmentsToQuickbar()

Entity::CanAssignAttachmentsToQuickbar ( )
inlineprotected
Returns
true if attached item can be assigned to quickbar safely

Definition at line 1550 of file EntityAI.c.

1551 {
1552 return true;
1553 }

◆ CanAssignToQuickbar()

Entity::CanAssignToQuickbar ( )
inlineprotected
Returns
true if item can be assigned to quickbar safely

Definition at line 1542 of file EntityAI.c.

1543 {
1544 return true;
1545 }

◆ CanBeActionTarget()

override bool Entity::CanBeActionTarget ( )
inlineprotected

Definition at line 662 of file EntityAI.c.

663 {
664 if (super.CanBeActionTarget())
665 return !IsSetForDeletion();
666 else
667 return false;
668 }
bool IsSetForDeletion()
Definition EntityAI.c:657

◆ CanBeBackstabbed()

bool Entity::CanBeBackstabbed ( )
inlineprotected

Definition at line 613 of file EntityAI.c.

614 {
615 return false;
616 }

◆ CanBeCombined()

bool Entity::CanBeCombined ( EntityAI other_item,
bool reservation_check = true,
bool stack_max_limit = false )
inlineprotected

Definition at line 1325 of file EntityAI.c.

1326 {
1327 return false;
1328 }

◆ CanBeFSwaped()

bool Entity::CanBeFSwaped ( )
inlineprotected

Definition at line 1312 of file EntityAI.c.

1313 {
1314 return true;
1315 }

◆ CanBeIgnitedBy()

bool Entity::CanBeIgnitedBy ( EntityAI igniter = NULL)
inlineprotected

Override this method so it checks whenever this item can be ignited right now or not. Evaluated on Server and Client.

Definition at line 423 of file EntityAI.c.

424 {
425 return false;
426 }

◆ CanBePlaced()

bool Entity::CanBePlaced ( Man player,
vector position )
inlineprotected

Definition at line 502 of file EntityAI.c.

503 {
504 return true;
505 }

◆ CanBePlacedFailMessage()

string Entity::CanBePlacedFailMessage ( Man player,
vector position )
inlineprotected

Method which returns message why object can't be placed at given position.

Definition at line 508 of file EntityAI.c.

509 {
510 return "";
511 }

◆ CanBeSkinnedWith()

bool Entity::CanBeSkinnedWith ( EntityAI tool)
inlineprotected

Definition at line 406 of file EntityAI.c.

407 {
408 if (!IsSkinned() && tool)
409 if (!IsAlive())
410 return true;
411 return false;
412 }
bool IsSkinned()
Skinning.
Definition EntityAI.c:395

◆ CanBeSplit()

bool Entity::CanBeSplit ( )
inlineprotected

Definition at line 537 of file EntityAI.c.

538 {
539 return false;
540 }

◆ CanBeTargetedByAI()

bool Entity::CanBeTargetedByAI ( EntityAI ai)
inlineprotected

Definition at line 603 of file EntityAI.c.

604 {
605 if (ai && ai.IsBeingBackstabbed())
606 return false;
607
608 if (!dBodyIsActive(this) && !IsMan())
609 return false;
610 return !IsDamageDestroyed();
611 }
bool IsDamageDestroyed(ActionTarget target)
Definition ActionBase.c:841
proto native bool dBodyIsActive(notnull IEntity ent)

References dBodyIsActive(), IsDamageDestroyed(), and EntityAI::IsMan().

◆ CanCombineAttachment()

bool Entity::CanCombineAttachment ( notnull EntityAI e,
int slot,
bool stack_max_limit = false )
inlineprotected

Definition at line 1317 of file EntityAI.c.

1318 {
1319 EntityAI att = GetInventory().FindAttachment(slot);
1320 if (att)
1321 return att.CanBeCombined(e, true, stack_max_limit);
1322 return false;
1323 }
proto native GameInventory GetInventory()

◆ CanDetachAttachment()

Entity::CanDetachAttachment ( EntityAI parent)
inlineprotected

calls this->CanDetachAttachment(parent)

Returns
true if action allowed
Note
: return scriptConditionExecute(this, parent, "CanDetachAttachment");

Definition at line 1307 of file EntityAI.c.

1308 {
1309 return true;
1310 }

◆ CanDisplayAnyAttachmentSlot()

Entity::CanDisplayAnyAttachmentSlot ( )
inlineprotected
Returns
true if any attachment slot can be shown

Definition at line 1508 of file EntityAI.c.

1509 {
1510 int count = GetInventory().GetAttachmentSlotsCount();
1511 int slotID;
1512 for (int i = 0; i < count; i++)
1513 {
1514 slotID = GetInventory().GetAttachmentSlotId(i);
1516 return true;
1517 }
1518
1519 return false;
1520 }
bool CanDisplayAttachmentSlot(string slot_name)
Definition EntityAI.c:1490

References CanDisplayAttachmentSlot().

◆ CanDisplayAttachmentCategory()

Entity::CanDisplayAttachmentCategory ( string category_name)
inlineprotected
Parameters
category_name->nameof the attachment category that will or won't be displayed
Returns
true if attachment icon can be displayed in UI (inventory)

Definition at line 1526 of file EntityAI.c.

1527 {
1528 return true;
1529 }

◆ CanDisplayAttachmentSlot() [1/2]

bool Entity::CanDisplayAttachmentSlot ( int slot_id)
inlineprotected

Definition at line 1500 of file EntityAI.c.

1501 {
1503 }
provides access to slot configuration
static proto native bool GetShowForSlotId(int slot_Id)

References InventorySlots::GetShowForSlotId().

◆ CanDisplayAttachmentSlot() [2/2]

bool Entity::CanDisplayAttachmentSlot ( string slot_name)
inlineprotected

Definition at line 1490 of file EntityAI.c.

1491 {
1492 Debug.LogWarning("Obsolete function - use CanDisplayAttachmentSlot with slot id parameter");
1494 }
Definition Debug.c:14
static void LogWarning(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as warning message.
Definition Debug.c:321
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

References InventorySlots::GetShowForSlotId(), InventorySlots::GetSlotIdFromString(), and Debug::LogWarning().

◆ CanDisplayCargo()

Entity::CanDisplayCargo ( )
inlineprotected
Returns
true if cargo can be displayed in UI (inventory)

Definition at line 1534 of file EntityAI.c.

1535 {
1536 return GetInventory().GetCargo() != null;
1537 }

◆ CanDisplayWeight()

bool Entity::CanDisplayWeight ( )
inlineprotected

'displayWeight' in item config

Definition at line 371 of file EntityAI.c.

372 {
373 return m_CanDisplayWeight;
374 }
bool m_CanDisplayWeight
Definition EntityAI.c:128

◆ CanDropEntity()

bool Entity::CanDropEntity ( notnull EntityAI item)
inlineprotected

Returns if item can be dropped out from this entity.

Definition at line 1852 of file EntityAI.c.

1853 {
1854 return true;
1855 }

◆ CanIgniteItem()

bool Entity::CanIgniteItem ( EntityAI ignite_target = NULL)
inlineprotected

Override this method and check if the given item can be ignited right now by this one. Evaluated on Server and Client.

Definition at line 429 of file EntityAI.c.

430 {
431 return false;
432 }

◆ CanLoadAttachment()

bool Entity::CanLoadAttachment ( EntityAI attachment)
inlineprotected

Definition at line 1259 of file EntityAI.c.

1260 {
1261 return true;
1262 }

◆ CanLoadItemIntoCargo()

Entity::CanLoadItemIntoCargo ( EntityAI item)
inlineprotected

calls this->CanLoadItemIntoCargo(item), is called on server start when loading in the storage

Returns
true if action allowed
Note
: return scriptConditionExecute(this, item, "CanLoadItemIntoCargo");

Definition at line 1353 of file EntityAI.c.

1354 {
1355 return true;
1356 }

◆ CanPutAsAttachment()

Entity::CanPutAsAttachment ( EntityAI parent)
inlineprotected

calls this->CanPutAsAttachment(parent)

Parameters
[in]parenttarget entity this is trying to attach to
Returns
true if action allowed
Note
: engine code is scriptConditionExecute(this, parent, "CanPutAsAttachment")

Definition at line 1271 of file EntityAI.c.

1272 {
1273 return !IsHologram();
1274 }
override bool IsHologram()
Definition EntityAI.c:1443

References IsHologram().

◆ CanPutInCargo()

Entity::CanPutInCargo ( EntityAI parent)
inlineprotected

calls this->CanPutInCargo(parent)

Returns
true if action allowed
Note
: return scriptConditionExecute(this, parent, "CanPutInCargo");

Definition at line 1364 of file EntityAI.c.

1365 {
1366 return !IsHologram();
1367 }

References IsHologram().

◆ CanPutIntoHands()

Entity::CanPutIntoHands ( EntityAI parent)
inlineprotected

calls this->CanPutIntoHands(parent)

Returns
true if action allowed
Note
: return scriptConditionExecute(this, parent, "CanPutIntoHands");

Definition at line 1459 of file EntityAI.c.

1460 {
1461 return !IsHologram();
1462 }

References IsHologram().

◆ CanReceiveAttachment()

Entity::CanReceiveAttachment ( EntityAI attachment,
int slotId )
inlineprotected

calls this->CanReceiveAttachment(attachment)

Returns
true if action allowed
Note
: return scriptConditionExecute(this, attachment, "CanReceiveAttachment");

Definition at line 1236 of file EntityAI.c.

1237 {
1238 //generic occupancy check
1239 EntityAI currentAtt = GetInventory().FindAttachment(slotId);
1240 bool hasInternalConflict = attachment.HasInternalExclusionConflicts(slotId);
1241 if (currentAtt) //probably a swap or same-type swap
1242 {
1243 set<int> diff = attachment.GetAttachmentExclusionMaskAll(slotId);
1244 diff.RemoveItems(currentAtt.GetAttachmentExclusionMaskAll(slotId));
1245 if (diff.Count() == 0)
1246 return !hasInternalConflict;
1247 else
1249 }
1250 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(attachment.GetAttachmentExclusionMaskAll(slotId), slotId);
1251 }
bool IsExclusionFlagPresentRecursive(set< int > values, int targetSlot)
Gets flag from what is effectively an owner.
Definition EntityAI.c:3481

◆ CanReceiveItemIntoCargo()

Entity::CanReceiveItemIntoCargo ( EntityAI item)
inlineprotected

calls this->CanReceiveItemIntoCargo(item)

Returns
true if action allowed
Note
: return scriptConditionExecute(this, item, "CanReceiveItemIntoCargo");

Definition at line 1339 of file EntityAI.c.

1340 {
1341 if (GetInventory() && GetInventory().GetCargo())
1342 return GetInventory().GetCargo().CanReceiveItemIntoCargo(item));
1343
1344 return true;
1345 }

◆ CanReceiveItemIntoHands()

Entity::CanReceiveItemIntoHands ( EntityAI item_to_hands)
inlineprotected

calls this->CanReceiveItemIntoHands(item_to_hands)

Returns
true if action allowed
Note
: scriptConditionExecute(this, item_to_hands, "CanReceiveItemIntoHands");

Definition at line 1433 of file EntityAI.c.

1434 {
1435 return true;
1436 }

◆ CanReleaseAttachment()

Entity::CanReleaseAttachment ( EntityAI attachment)
inlineprotected

calls this->CanReleaseAttachment(attachment)

Returns
true if action allowed
Note
: return scriptConditionExecute(this, attachment, "CanReleaseAttachment");

Definition at line 1287 of file EntityAI.c.

1288 {
1289 if (attachment && attachment.GetInventory() && GetInventory())
1290 {
1292 attachment.GetInventory().GetCurrentInventoryLocation(il);
1293 if (il.IsValid())
1294 {
1295 int slot = il.GetSlot();
1296 return !GetInventory().GetSlotLock(slot);
1297 }
1298 }
1299 return true;
1300 }
InventoryLocation.

◆ CanReleaseCargo()

Entity::CanReleaseCargo ( EntityAI cargo)
inlineprotected

calls this->CanReleaseCargo(cargo)

Returns
true if action allowed
Note
: return scriptConditionExecute(this, cargo, "CanReleaseCargo");

Definition at line 1389 of file EntityAI.c.

1390 {
1391 return true;
1392 }

◆ CanReleaseFromHands()

Entity::CanReleaseFromHands ( EntityAI handheld)
inlineprotected

calls this->CanReleaseFromHands(handheld)

Returns
true if action allowed
Note
: scriptConditionExecute(this, handheld, "CanReleaseFromHands");

Definition at line 1470 of file EntityAI.c.

1471 {
1472 return true;
1473 }

◆ CanRemoveFromCargo()

Entity::CanRemoveFromCargo ( EntityAI parent)
inlineprotected

calls this->CanRemoveFromCargo(parent)

Returns
true if action allowed
Note
: return scriptConditionExecute(this, parent, "CanRemoveFromCargo");

Definition at line 1400 of file EntityAI.c.

1401 {
1402 return true;
1403 }

◆ CanRemoveFromHands()

Entity::CanRemoveFromHands ( EntityAI parent)
inlineprotected

calls this->CanRemoveFromHands(parent)

Returns
true if action allowed
Note
: return scriptConditionExecute(this, parent, "CanRemoveFromHands");

Definition at line 1481 of file EntityAI.c.

1482 {
1483 return true;
1484 }

◆ CanSaveItemInHands()

bool Entity::CanSaveItemInHands ( EntityAI item_in_hands)
inlineprotected

Definition at line 1448 of file EntityAI.c.

1449 {
1450 return true;
1451 }

◆ CanSwapEntities()

bool Entity::CanSwapEntities ( EntityAI otherItem,
InventoryLocation otherDestination,
InventoryLocation destination )
inlineprotected

Definition at line 1891 of file EntityAI.c.

1892 {
1893 return true;
1894 }

◆ CanSwapItemInCargo()

Entity::CanSwapItemInCargo ( EntityAI child_entity,
EntityAI new_entity )
inlineprotected

calls this->CanSwapItemInCargo(child_entity, new_entity)

Returns
true if action allowed
Note
: return ScriptConditionExecute(GetOwner(), child_entity, "CanSwapItemInCargo", new_entity);

Definition at line 1375 of file EntityAI.c.

1376 {
1377 if (GetInventory() && GetInventory().GetCargo())
1378 return GetInventory().GetCargo().CanSwapItemInCargo(child_entity, new_entity));
1379
1380 return true;
1381 }

◆ CanSwitchDuringAttach()

bool Entity::CanSwitchDuringAttach ( EntityAI parent)
inlineprotected

Definition at line 1277 of file EntityAI.c.

1278 {
1279 return false;
1280 }

◆ ChangeIntoOnAttach()

string Entity::ChangeIntoOnAttach ( string slot)
inlineprotected

Definition at line 2850 of file EntityAI.c.

2850{}

◆ ChangeIntoOnDetach()

string Entity::ChangeIntoOnDetach ( )
inlineprotected

Definition at line 2851 of file EntityAI.c.

2851{}

◆ CheckExclusionAccessCondition()

bool Entity::CheckExclusionAccessCondition ( int occupiedSlot,
int targetSlot,
set< int > value,
inout set< int > adjustedValue )
inlineprotected

Definition at line 3501 of file EntityAI.c.

3502 {
3505
3507 {
3509 return false;
3510 }
3511
3512 if (targetException)
3513 {
3515 return false;
3516 }
3517
3519 return adjustedValue.Count() != 0;
3520 }

◆ CheckExclusionAccessPropagation()

bool Entity::CheckExclusionAccessPropagation ( int occupiedSlot,
int targetSlot,
set< int > value,
inout set< int > adjustedValue )
inlineprotected

special propagation contition

Definition at line 3529 of file EntityAI.c.

3530 {
3533
3534 if (targetException)
3535 {
3537 return false;
3538 }
3539
3541 return adjustedValue.Count() != 0;
3542 }
void AdjustExclusionAccessPropagation(int occupiedSlot, int testedSlot, set< int > value, inout set< int > adjustedValue)
if we want to filter propagation specifically; DO NOT override unless you know what you are doing.
Definition EntityAI.c:3545
const int INVALID
Invalid slot (-1)

References InventorySlots::INVALID.

◆ CheckForDestroy()

void Entity::CheckForDestroy ( )
inlineprotected

Definition at line 681 of file EntityAI.c.

682 {
683 if (IsPrepareToDelete())
684 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(TryDelete, DELETE_CHECK_DELAY, false);
685 }
bool IsPrepareToDelete()
Definition EntityAI.c:687
bool TryDelete()
Definition EntityAI.c:692
const int DELETE_CHECK_DELAY
Definition EntityAI.c:116
proto native CGame GetGame()
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, GetGame(), and IsPrepareToDelete().

◆ ClearExclusionValueRecursive()

void Entity::ClearExclusionValueRecursive ( set< int > values,
int slotId )
inlineprivate

Definition at line 3393 of file EntityAI.c.

3394 {
3395 if (values && values.Count() != 0)
3396 {
3399 GetInventory().GetCurrentInventoryLocation(lcn);
3401 {
3402 int count = passThis.Count();
3403 for (int i = 0; i < count; i++)
3405 EntityAI parent = GetHierarchyParent();
3406 if (parent)
3407 parent.ClearExclusionValueRecursive(passThis, lcn.GetSlot());
3408 }
3409 }
3410 }
proto native EntityAI GetHierarchyParent()
Returns direct parent of current entity.
bool CheckExclusionAccessPropagation(int occupiedSlot, int targetSlot, set< int > value, inout set< int > adjustedValue)
special propagation contition
Definition EntityAI.c:3529
ref set< int > m_AttachmentExclusionMaskChildren
Definition EntityAI.c:108

◆ ClearInventory()

void Entity::ClearInventory ( )
protected

◆ ClearSingleExclusionValueGlobal()

void Entity::ClearSingleExclusionValueGlobal ( EAttExclusions value)
inlineprotected

to help with item staging exclusions

Definition at line 3354 of file EntityAI.c.

3355 {
3357 if (idx != -1)
3359 }

◆ ClearWeightDirty()

void Entity::ClearWeightDirty ( )
inlineprotected

Definition at line 2578 of file EntityAI.c.

2579 {
2580 //Print("ent:" + this + " - ClearWeightDirty");
2581 m_WeightDirty = 0;
2582 }
bool m_WeightDirty
Definition EntityAI.c:105

◆ CombineItemsClient()

void Entity::CombineItemsClient ( EntityAI entity2,
bool use_stack_max = false )
inlineprotected

Definition at line 1330 of file EntityAI.c.

1331 {}

◆ ConvertNonlethalDamage() [1/2]

float Entity::ConvertNonlethalDamage ( float damage)
inlineprotected

DEPRECATED - for legacy purposes.

Definition at line 355 of file EntityAI.c.

356 {
357 return 0.0;
358 }

◆ ConvertNonlethalDamage() [2/2]

float Entity::ConvertNonlethalDamage ( float damage,
DamageType damageType )
inlineprotected

Definition at line 349 of file EntityAI.c.

350 {
351 return 0.0;
352 }

◆ CreateAndInitInventory()

proto native void Entity::CreateAndInitInventory ( )
protected

◆ CreateComponent()

Component Entity::CreateComponent ( int comp_type,
string extended_class_name = "" )
inlineprivate

CreateComponent.

Definition at line 229 of file EntityAI.c.

230 {
232 }
Component GetComponent(int comp_type, string extended_class_name="")
GetComponent.
Definition EntityAI.c:235

◆ DeathUpdate()

void Entity::DeathUpdate ( )
inlineprotected

Definition at line 912 of file EntityAI.c.

913 {
915 dead_entity.SetOrientation(GetOrientation());
917 dead_entity.SetHealth(GetHealth());
918 this.Delete();
919 }
vector GetOrientation()
const int ECE_OBJECT_SWAP
const int RF_ORIGINAL
class JsonUndergroundAreaTriggerData GetPosition
bool KeepHealthOnReplace()
Definition EntityAI.c:907
string GetDeadItemName()
Definition EntityAI.c:902
override void Delete()
Delete this object in next frame.
Definition EntityAI.c:626

References ECE_OBJECT_SWAP, GetDeadItemName(), GetGame(), GetOrientation(), GetPosition, KeepHealthOnReplace(), and RF_ORIGINAL.

◆ DebugBBoxDelete()

void Entity::DebugBBoxDelete ( )
inlineprotected

Definition at line 2364 of file EntityAI.c.

2365 {
2367 }
void DebugBBoxDelete()
const int COMP_TYPE_ETITY_DEBUG
Definition Component.c:8

References COMP_TYPE_ETITY_DEBUG.

◆ DebugBBoxDraw()

Shape Entity::DebugBBoxDraw ( )
inlineprotected

Definition at line 2354 of file EntityAI.c.

2355 {
2357 }
Shape DebugBBoxDraw()

References COMP_TYPE_ETITY_DEBUG.

◆ DebugBBoxSetColor()

void Entity::DebugBBoxSetColor ( int color)
inlineprotected

Definition at line 2359 of file EntityAI.c.

2360 {
2362 }
void DebugBBoxSetColor(int color)

References COMP_TYPE_ETITY_DEBUG.

◆ DebugDirectionDelete()

void Entity::DebugDirectionDelete ( )
inlineprotected

Definition at line 2379 of file EntityAI.c.

References COMP_TYPE_ETITY_DEBUG.

◆ DebugDirectionDraw()

Shape Entity::DebugDirectionDraw ( float distance = 1)
inlineprotected

Definition at line 2369 of file EntityAI.c.

2370 {
2372 }
Shape DebugDirectionDraw(float distance=1)

References COMP_TYPE_ETITY_DEBUG.

◆ DebugDirectionSetColor()

void Entity::DebugDirectionSetColor ( int color)
inlineprotected

Definition at line 2374 of file EntityAI.c.

2375 {
2377 }
void DebugDirectionSetColor(int color)

References COMP_TYPE_ETITY_DEBUG.

◆ DeferredInit()

void Entity::DeferredInit ( )
inlineprotected

Definition at line 209 of file EntityAI.c.

210 {
211 m_Initialized = true;
212 }
bool m_Initialized
Definition EntityAI.c:135

References m_Initialized.

◆ Delete()

override void Entity::Delete ( )
inlineprotected

Delete this object in next frame.

Returns
void
ItemBase item = GetGame().GetPlayer().CreateInInventory("GrenadeRGD5");
item.Delete();

Definition at line 626 of file EntityAI.c.

627 {
628 m_PendingDelete = true;
629 super.Delete();
630 }
bool m_PendingDelete
Definition EntityAI.c:134

◆ DeleteComponent()

bool Entity::DeleteComponent ( int comp_type)
inlineprivate

DeleteComponent.

Definition at line 244 of file EntityAI.c.

245 {
246 return m_ComponentsBank.DeleteComponent(comp_type);
247 }
ref ComponentsBank m_ComponentsBank
Definition EntityAI.c:225

◆ DeleteOnClient()

void Entity::DeleteOnClient ( )
inlineprotected

Definition at line 632 of file EntityAI.c.

633 {
634 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Call(GetGame().ObjectDeleteOnClient, this);
635 }

References CALL_CATEGORY_SYSTEM, and GetGame().

◆ DeleteSafe()

void Entity::DeleteSafe ( )
inlineprotected

Definition at line 638 of file EntityAI.c.

639 {
641 Delete();
642 else
643 {
644 if (GetGame().IsServer() && GetGame().IsMultiplayer())
645 GetHierarchyRootPlayer().JunctureDeleteItem(this);
646 else
647 GetHierarchyRootPlayer().AddItemToDelete(this);
648 }
649 }
proto native Man GetHierarchyRootPlayer()
Returns root of current hierarchy cast to Man.

References GetGame().

◆ DeleteSave()

void Entity::DeleteSave ( )
inlineprotected

Definition at line 652 of file EntityAI.c.

653 {
654 DeleteSafe();
655 }
void DeleteSafe()
Definition EntityAI.c:638

◆ DestroyInventory()

proto native void Entity::DestroyInventory ( )
protected

◆ DisassembleOnLastDetach()

bool Entity::DisassembleOnLastDetach ( )
inlineprotected

Definition at line 443 of file EntityAI.c.

444 {
445 return false;
446 }

◆ DoPlacingHeightCheck()

bool Entity::DoPlacingHeightCheck ( )
inlineprotected

Do the roof check when placing this?

Definition at line 514 of file EntityAI.c.

515 {
516 return false;
517 }

◆ EEAmmoChanged()

void Entity::EEAmmoChanged ( )
inlineprotected

Definition at line 840 of file EntityAI.c.

841 {
843 }
void SetWeightDirty()
Definition EntityAI.c:2584

◆ EECargoIn()

void Entity::EECargoIn ( EntityAI item)
inlineprotected

Definition at line 1006 of file EntityAI.c.

1007 {
1009
1011 m_OnItemAddedIntoCargo.Invoke(item, this);
1012
1013 item.OnMovedInsideCargo(this);
1014 }
ref ScriptInvoker m_OnItemAddedIntoCargo
Definition EntityAI.c:144

◆ EECargoMove()

void Entity::EECargoMove ( EntityAI item)
inlineprotected

Definition at line 1026 of file EntityAI.c.

1027 {
1029 m_OnItemMovedInCargo.Invoke(item, this);
1030 item.OnMovedWithinCargo(this);
1031 }
ref ScriptInvoker m_OnItemMovedInCargo
Definition EntityAI.c:148

◆ EECargoOut()

void Entity::EECargoOut ( EntityAI item)
inlineprotected

Definition at line 1016 of file EntityAI.c.

1017 {
1019
1021 m_OnItemRemovedFromCargo.Invoke(item, this);
1022
1023 item.OnRemovedFromCargo(this);
1024 }
ref ScriptInvoker m_OnItemRemovedFromCargo
Definition EntityAI.c:146

◆ EEDelete()

void Entity::EEDelete ( EntityAI parent)
inlineprotected

Called right before object deleting.

Definition at line 769 of file EntityAI.c.

770 {
771 m_PendingDelete = true;
772 GetInventory().EEDelete(parent);
773
774 if (m_EM)
776 }
ComponentEnergyManager m_EM
Definition EntityAI.c:226

References ComponentEnergyManager::OnDeviceDestroyed().

◆ EEHealthLevelChanged()

void Entity::EEHealthLevelChanged ( int oldLevel,
int newLevel,
string zone )
inlineprotected

Definition at line 845 of file EntityAI.c.

846 {
847 // Notify potential parent that this item was ruined
848 EntityAI parent = GetHierarchyParent();
849
851 {
852 if (parent)
853 parent.OnAttachmentRuined(this);
854 if (!zone)
857 }
858 }
void OnDamageDestroyed(int oldLevel)
Called when the health gets to the min value, 'oldLevel' is previous health level,...
void AttemptDestructionBehaviour(int oldLevel, int newLevel, string zone)
Definition EntityAI.c:863
const int STATE_RUINED
Definition constants.c:757

References OnDamageDestroyed(), and GameConstants::STATE_RUINED.

◆ EEHitBy()

void Entity::EEHitBy ( TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo,
vector modelPos,
float speedCoef )
inlineprotected

Definition at line 927 of file EntityAI.c.

928 {
931#ifdef DEVELOPER
932 //Print("EEHitBy: " + this + "; damageResult:"+ damageResult.GetDamage("","") +"; damageType: "+ damageType +"; source: "+ source +"; component: "+ component +"; dmgZone: "+ dmgZone +"; ammo: "+ ammo +"; modelPos: "+ modelPos);
933#endif
934 }
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
ref ScriptInvoker m_OnHitByInvoker
Definition EntityAI.c:162

References component.

◆ EEHitByRemote()

void Entity::EEHitByRemote ( int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo,
vector modelPos )
inlineprotected

Definition at line 937 of file EntityAI.c.

938 {
939
940 }

◆ EEInit()

void Entity::EEInit ( )
inlineprotected

Called upon object creation.

Definition at line 744 of file EntityAI.c.

745 {
746 if (GetInventory())
747 {
748 GetInventory().EEInit();
751 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
752 {
753 EntityAI attachment = GetInventory().GetAttachmentFromIndex(i);
754 if (attachment)
755 {
756 if (attachment.GetInventory().GetCargo())
758
759 if (attachment.GetInventory().GetAttachmentSlotsCount() > 0)
761 }
762 }
763 }
764
766 }
ref array< EntityAI > m_AttachmentsWithCargo
Definition EntityAI.c:118
ref array< EntityAI > m_AttachmentsWithAttachments
Definition EntityAI.c:119
void MaxLifetimeRefreshCalc()
Calculates if the max lifetime is higher than refresher frequency (i.e. gets kept alive by refresher)
Definition EntityAI.c:269

◆ EEInventoryIn()

void Entity::EEInventoryIn ( Man newParentMan,
EntityAI diz,
EntityAI newParent )
inlineprotected

Definition at line 829 of file EntityAI.c.

830 {
831 }

◆ EEInventoryOut()

void Entity::EEInventoryOut ( Man oldParentMan,
EntityAI diz,
EntityAI newParent )
inlineprotected

Definition at line 832 of file EntityAI.c.

833 {
834 m_LastUpdatedTime = 0.0;
835
836 if (GetInventory() && newParent == null)
837 GetInventory().ResetFlipCargo();
838 }
float m_LastUpdatedTime
Definition EntityAI.c:129

◆ EEItemAttached()

void Entity::EEItemAttached ( EntityAI item,
string slot_name )
inlineprotected

Definition at line 943 of file EntityAI.c.

944 {
946 PropagateExclusionValueRecursive(item.GetAttachmentExclusionMaskAll(slotId), slotId); //Performed from parent to avoid event order issues on swap
948
949 if (m_ComponentsBank != NULL)
950 {
951 for (int comp_key = 0; comp_key < COMP_TYPE_COUNT; ++comp_key)
952 {
953 if (m_ComponentsBank.IsComponentAlreadyExist(comp_key))
954 m_ComponentsBank.GetComponent(comp_key).Event_OnItemAttached(item, slot_name);
955 }
956 }
957
958 // Energy Manager
959 if (m_EM && item.GetCompEM())
961
962 if (item.GetInventory().GetCargo())
964
965 if (item.GetInventory().GetAttachmentSlotsCount() > 0)
967
969 m_OnItemAttached.Invoke(item, slot_name, this);
970 }
void OnAttachmentAdded(EntityAI elec_device)
ref ScriptInvoker m_OnItemAttached
Definition EntityAI.c:140
void PropagateExclusionValueRecursive(set< int > values, int slotId)
Definition EntityAI.c:3376
const int COMP_TYPE_COUNT
Definition Component.c:12

References COMP_TYPE_COUNT, InventorySlots::GetSlotIdFromString(), and ComponentEnergyManager::OnAttachmentAdded().

◆ EEItemDetached()

void Entity::EEItemDetached ( EntityAI item,
string slot_name )
inlineprotected

Definition at line 976 of file EntityAI.c.

977 {
979 ClearExclusionValueRecursive(item.GetAttachmentExclusionMaskAll(slotId), slotId); //Performed from parent to avoid event order issues on swap
981
982 if (m_ComponentsBank != NULL)
983 {
984 for (int comp_key = 0; comp_key < COMP_TYPE_COUNT; ++comp_key)
985 {
986 if (m_ComponentsBank.IsComponentAlreadyExist(comp_key))
987 m_ComponentsBank.GetComponent(comp_key).Event_OnItemDetached(item, slot_name);
988 }
989 }
990
991 // Energy Manager
992 if (m_EM && item.GetCompEM())
994
995 if (m_AttachmentsWithCargo.Find(item) > -1)
996 m_AttachmentsWithCargo.RemoveItem(item);
997
998 if (m_AttachmentsWithAttachments.Find(item) > -1)
1000
1001
1002 if (m_OnItemDetached)
1003 m_OnItemDetached.Invoke(item, slot_name, this);
1004 }
void OnAttachmentRemoved(EntityAI elec_device)
void ClearExclusionValueRecursive(set< int > values, int slotId)
Definition EntityAI.c:3393
ref ScriptInvoker m_OnItemDetached
Definition EntityAI.c:142

References COMP_TYPE_COUNT, InventorySlots::GetSlotIdFromString(), and ComponentEnergyManager::OnAttachmentRemoved().

◆ EEItemLocationChanged()

void Entity::EEItemLocationChanged ( notnull InventoryLocation oldLoc,
notnull InventoryLocation newLoc )
inlineprotected

Definition at line 793 of file EntityAI.c.

794 {
795 EntityAI old_owner = oldLoc.GetParent();
796 EntityAI new_owner = newLoc.GetParent();
798
799 if (oldLoc.GetType() == InventoryLocationType.ATTACHMENT && newLoc.GetType() == InventoryLocationType.ATTACHMENT)
801
802 if (oldLoc.GetType() == InventoryLocationType.ATTACHMENT)
803 {
804 if (old_owner)
805 OnWasDetached(old_owner, oldLoc.GetSlot());
806 else
807 Error("EntityAI::EEItemLocationChanged - detached, but old_owner is null");
808 }
809
810 if (newLoc.GetType() == InventoryLocationType.ATTACHMENT)
811 {
812 if (new_owner)
813 OnWasAttached(newLoc.GetParent(), newLoc.GetSlot());
814 else
815 Error("EntityAI::EEItemLocationChanged - attached, but new_owner is null");
816 }
817 }
InventoryLocationType
types of Inventory Location
void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Definition EntityAI.c:789
void OnWasDetached(EntityAI parent, int slot_id)
Definition EntityAI.c:1567
void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Definition EntityAI.c:791
void OnWasAttached(EntityAI parent, int slot_id)
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References Error(), OnItemAttachmentSlotChanged(), OnItemLocationChanged(), OnWasAttached(), and OnWasDetached().

◆ EEKilled()

void Entity::EEKilled ( Object killer)
inlineprotected

called on server when the entity is killed

Definition at line 886 of file EntityAI.c.

887 {
889 m_OnKilledInvoker.Invoke(this, killer);
890 //analytics
891 GetGame().GetAnalyticsServer().OnEntityKilled(killer, this);
892
893 if (ReplaceOnDeath())
894 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(DeathUpdate, DEAD_REPLACE_DELAY, false);
895 }
const int DEAD_REPLACE_DELAY
Definition EntityAI.c:115
void DeathUpdate()
Definition EntityAI.c:912
ref ScriptInvoker m_OnKilledInvoker
Definition EntityAI.c:164
bool ReplaceOnDeath()
Definition EntityAI.c:897

References CALL_CATEGORY_SYSTEM, GetGame(), and ReplaceOnDeath().

◆ EEOnAfterLoad()

void Entity::EEOnAfterLoad ( )
inlineprotected

Called when entity is part of "connected system" and being restored after load.

Definition at line 1145 of file EntityAI.c.

1146 {
1147 // ENERGY MANAGER
1148 // Restore connections between devices which were connected before server restart
1149 if (m_EM && m_EM.GetRestorePlugState())
1150 {
1155
1156 // get pointer to EntityAI based on this ID
1157 EntityAI potential_energy_source = GetGame().GetEntityByPersitentID(b1, b2, b3, b4); // This function is available only in this event!
1158
1159 // IMPORTANT!
1160 // Object IDs acquired here become INVALID when electric devices are transfered to another server while in plugged state (like Flashlight plugged into its attachment 9V battery)
1161 // To avoid issues, these items must be excluded from this system of restoring plug state so they don't unintentionally plug to incorrect devices through these invalid IDs.
1162 // Therefore their plug state is being restored withing the EEItemAttached() event while being excluded by the following 'if' conditions...
1163
1164 bool is_attachment = false;
1165
1168
1170 is_attachment = potential_energy_source.GetInventory().HasAttachment(this);
1171
1172 if (potential_energy_source && potential_energy_source.GetCompEM() /*&& potential_energy_source.HasEnergyManager()*/ && !is_attachment)
1173 m_EM.PlugThisInto(potential_energy_source); // restore connection
1174 }
1175 }
bool PlugThisInto(EntityAI energy_source, int socket_id=-1)
Energy manager: Attempts to plug this device into the energy_source. Returns true if the action was s...

References ComponentEnergyManager::GetEnergySourceStorageIDb1(), ComponentEnergyManager::GetEnergySourceStorageIDb2(), ComponentEnergyManager::GetEnergySourceStorageIDb3(), ComponentEnergyManager::GetEnergySourceStorageIDb4(), GetGame(), ComponentEnergyManager::GetRestorePlugState(), and ComponentEnergyManager::PlugThisInto().

◆ EEOnCECreate()

void Entity::EEOnCECreate ( )
inlineprotected

Called when entity is being created as new by CE/ Debug.

Definition at line 1178 of file EntityAI.c.

1179 {
1180 }

◆ EEParentedFrom()

void Entity::EEParentedFrom ( EntityAI parent)
inlineprotected

Called from 'IEntity.RemoveChild' or 'IEntity.AddChild' when hierarchy changes.

Definition at line 825 of file EntityAI.c.

826 {
827 }

◆ EEParentedTo()

void Entity::EEParentedTo ( EntityAI parent)
inlineprotected

Called from 'IEntity.AddChild'.

Definition at line 820 of file EntityAI.c.

821 {
822 }

◆ EnableHeatHaze()

proto native void Entity::EnableHeatHaze ( bool pState)
private

◆ EnableLinear()

proto native bool Entity::EnableLinear ( bool pState)
private

◆ EnableSpecular()

proto native bool Entity::EnableSpecular ( bool pState)
private

◆ EntityAI()

void Entity::EntityAI ( )
inlineprotected

Definition at line 166 of file EntityAI.c.

167 {
168 // Set up the Energy Manager
169 string type = GetType();
170 string param_access_energy_sys = "CfgVehicles " + type + " EnergyManager ";
171 bool is_electic_device = GetGame().ConfigIsExisting(param_access_energy_sys);
172
173 if (is_electic_device) // TO DO: Check if this instance is a hologram (advanced placement). If Yes, then do not create Energy Manager component.
174 {
176 RegisterNetSyncVariableBool("m_EM.m_IsSwichedOn");
177 RegisterNetSyncVariableBool("m_EM.m_CanWork");
178 RegisterNetSyncVariableBool("m_EM.m_IsPlugged");
179 RegisterNetSyncVariableInt("m_EM.m_EnergySourceNetworkIDLow");
180 RegisterNetSyncVariableInt("m_EM.m_EnergySourceNetworkIDHigh");
181 RegisterNetSyncVariableFloat("m_EM.m_Energy");
182 }
183
184 // Item preview index
185 RegisterNetSyncVariableInt("m_ViewIndex", 0, 99);
186 // Refresher signalization
187 RegisterNetSyncVariableBool("m_RefresherViable");
188
191 m_LastUpdatedTime = 0.0;
193
194 m_CanDisplayWeight = ConfigGetBool("displayWeight");
195
198
200
201 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(DeferredInit, 34);
202 }
eBleedingSourceType GetType()
void InitDamageZoneMapping()
Initializes script-side map of damage zones and their components (named selections in models)
Definition EntityAI.c:303
ref HiddenSelectionsData m_HiddenSelectionsData
Definition EntityAI.c:113
float m_ElapsedSinceLastUpdate
Definition EntityAI.c:130
proto native void RegisterNetSyncVariableFloat(string variableName, float minValue=0, float maxValue=0, int precision=1)
registers float variable synchronized over network
proto native void RegisterNetSyncVariableBool(string variableName)
registers bool variable synchronized over network
void InitDamageZoneDisplayNameMapping()
Initialize map of damage zone display names for more optimized retrieval.
Definition EntityAI.c:310
Component CreateComponent(int comp_type, string extended_class_name="")
CreateComponent.
Definition EntityAI.c:229
proto native void RegisterNetSyncVariableInt(string variableName, int minValue=0, int maxValue=0)
registers int variable synchronized over network
void DeferredInit()
Definition EntityAI.c:209
const int COMP_TYPE_ENERGY_MANAGER
Definition Component.c:9

References CALL_CATEGORY_SYSTEM, COMP_TYPE_ENERGY_MANAGER, GetGame(), and GetType().

◆ EOnFrame()

override void Entity::EOnFrame ( IEntity other,
float timeSlice )
inlineprotected

Definition at line 2313 of file EntityAI.c.

2314 {
2315 if (m_ComponentsBank != NULL)
2316 {
2317 for (int comp_key = 0; comp_key < COMP_TYPE_COUNT; ++comp_key)
2318 {
2319 if (m_ComponentsBank.IsComponentAlreadyExist(comp_key))
2320 m_ComponentsBank.GetComponent(comp_key).Event_OnFrame(other, timeSlice);
2321 }
2322 }
2323 }

References COMP_TYPE_COUNT.

◆ ExecuteActionsConnectedToValve()

void Entity::ExecuteActionsConnectedToValve ( int pValveIndex)
protected

◆ FindAttachmentBySlotName()

EntityAI Entity::FindAttachmentBySlotName ( string slot_name)
inlineprotected

Definition at line 1596 of file EntityAI.c.

1597 {
1598 if (GetGame())
1599 {
1602 return GetInventory().FindAttachment(slot_id);
1603 }
1604 return null;
1605 }

References GetGame(), InventorySlots::GetSlotIdFromString(), and InventorySlots::INVALID.

◆ GetAgents()

int Entity::GetAgents ( )
inlineprotected

Definition at line 565 of file EntityAI.c.

565{ return 0; }

◆ GetAmbientAlpha()

proto native float Entity::GetAmbientAlpha ( )
private

◆ GetAmbientColorV()

proto native vector Entity::GetAmbientColorV ( )
private

◆ GetArrowManager()

ArrowManagerBase Entity::GetArrowManager ( )
inlineprotected

Definition at line 3555 of file EntityAI.c.

3556 {
3557 return null;
3558 }

◆ GetAttachmentByConfigTypeName()

EntityAI Entity::GetAttachmentByConfigTypeName ( string type)
inlineprotected

Get attached entity by config type name.

Definition at line 1839 of file EntityAI.c.

1840 {
1841 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
1842 {
1843 EntityAI attachment = GetInventory().GetAttachmentFromIndex(i);
1844 if (attachment.IsKindOf(type))
1845 return attachment;
1846 }
1847 return NULL;
1848 }

◆ GetAttachmentByType()

EntityAI Entity::GetAttachmentByType ( typename type )
inlineprotected

Get attached entity by type.

Definition at line 1825 of file EntityAI.c.

1826 {
1827 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
1828 {
1829 EntityAI attachment = GetInventory().GetAttachmentFromIndex(i);
1830 if (attachment && attachment.IsInherited(type))
1831 return attachment;
1832 }
1833 return NULL;
1834 }

◆ GetAttachmentExclusionInitSlotValue()

set< int > Entity::GetAttachmentExclusionInitSlotValue ( int slotId)
inlineprotected

override this to modify slot behavior for specific items, or just set 'm_AttachmentExclusionMaskGlobal' value for simple items

Definition at line 3182 of file EntityAI.c.

3183 {
3184 set<int> dflt = new set<int>;
3185 return dflt;
3186 }

◆ GetAttachmentExclusionMaskAll()

set< int > Entity::GetAttachmentExclusionMaskAll ( int slotId)
inlineprivate

Slot-specific, children (attachments), and additional (state etc.) masks combined.

Definition at line 3413 of file EntityAI.c.

3414 {
3415 set<int> values = new set<int>();
3417 if (slotValues)
3418 values.InsertSet(slotValues);
3421
3422 return values;
3423 }
set< int > GetAttachmentExclusionMaskSlot(int slotId)
Specific slot behavior.
Definition EntityAI.c:3426

◆ GetAttachmentExclusionMaskChildren()

set< int > Entity::GetAttachmentExclusionMaskChildren ( )
inlineprivate

Mask value coming from the item's attachments.

Definition at line 3438 of file EntityAI.c.

3439 {
3441 }

◆ GetAttachmentExclusionMaskGlobal()

set< int > Entity::GetAttachmentExclusionMaskGlobal ( )
inlineprivate

Global mask value, independent of slot-specific behavior!

Definition at line 3432 of file EntityAI.c.

3433 {
3435 }

◆ GetAttachmentExclusionMaskSlot()

set< int > Entity::GetAttachmentExclusionMaskSlot ( int slotId)
inlineprivate

Specific slot behavior.

Definition at line 3426 of file EntityAI.c.

3427 {
3429 }
ref map< int, ref set< int > > m_AttachmentExclusionSlotMap
Definition EntityAI.c:106

◆ GetAttachmentSoundType()

string Entity::GetAttachmentSoundType ( )
inlineprotected

returns sound type of attachment (used for clothing and weapons on DayZPlayerImplement, paired with Anim*Type enum from DayZAnimEvents)

Definition at line 2827 of file EntityAI.c.

2828 {
2829 return "None";
2830 }

◆ GetAttachmentsWithAttachments()

array< EntityAI > Entity::GetAttachmentsWithAttachments ( )
inlineprotected

Definition at line 560 of file EntityAI.c.

561 {
563 }

◆ GetAttachmentsWithCargo()

array< EntityAI > Entity::GetAttachmentsWithCargo ( )
inlineprotected

Definition at line 555 of file EntityAI.c.

556 {
558 }

◆ GetBayonetAttachmentIdx()

int Entity::GetBayonetAttachmentIdx ( )
inlineprotected

Definition at line 2975 of file EntityAI.c.

2975{};

◆ GetBrightness()

proto native float Entity::GetBrightness ( )
private

◆ GetButtstockAttachmentIdx()

int Entity::GetButtstockAttachmentIdx ( )
inlineprotected

Definition at line 2979 of file EntityAI.c.

2979{};

◆ GetCastShadow()

proto native bool Entity::GetCastShadow ( )
private

◆ GetCompBS()

ComponentBodyStaging Entity::GetCompBS ( )
inlineprotected

Use this to access Body Staging component on dead character. Returns NULL if the given object lacks such component.

Definition at line 2429 of file EntityAI.c.

2430 {
2433 return NULL;
2434 }
bool HasComponent(int comp_type)
IsComponentExist.
Definition EntityAI.c:260
const int COMP_TYPE_BODY_STAGING
Definition Component.c:10

References COMP_TYPE_BODY_STAGING.

◆ GetCompEM()

ComponentEnergyManager Entity::GetCompEM ( )
inlineprotected

energy manager ENERGY MANAGER:Documentation: Confluence >> Camping & Squatting >> Electricity >> Energy Manager functionalities Use this to access Energy Manager component on your device. Returns NULL if the given object lacks such component.

Definition at line 2439 of file EntityAI.c.

2440 {
2441 if (m_EM)
2442 return m_EM;
2443
2446 return NULL;
2447 }

References COMP_TYPE_ENERGY_MANAGER.

◆ GetComponent()

Component Entity::GetComponent ( int comp_type,
string extended_class_name = "" )
inlineprivate

GetComponent.

Definition at line 235 of file EntityAI.c.

236 {
237 if (m_ComponentsBank == NULL)
239
240 return m_ComponentsBank.GetComponent(comp_type, extended_class_name);
241 }

◆ GetConfigWeightModified()

float Entity::GetConfigWeightModified ( )
inlineprotected

Definition at line 2557 of file EntityAI.c.

2558 {
2560 }
float GetWetWeightModifier()
Definition EntityAI.c:2552
float m_ConfigWeight
Definition EntityAI.c:127

◆ GetCurrentCamera()

static proto native Camera Entity::GetCurrentCamera ( )
staticprivate

Returns active Camera instance (note: player's camera is not Camera instance - thus it return null)

Returns
Camera active Camera instance

◆ GetCurrentFOV()

static proto native float Entity::GetCurrentFOV ( )
staticprivate

Returns FOV of current camera object.

Returns
float FOV of current camera object

◆ GetDeadItemName()

string Entity::GetDeadItemName ( )
inlineprotected

Definition at line 902 of file EntityAI.c.

903 {
904 return "";
905 }

◆ GetDebugActions()

void Entity::GetDebugActions ( out TSelectableActionInfoArrayEx outputList)
inlineprotected

Definition at line 2658 of file EntityAI.c.

2659 {
2660 //fix entity
2661 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.FIX_ENTITY, "Fix Entity", FadeColors.LIGHT_GREY));
2662
2663 //weight
2664 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.GET_TOTAL_WEIGHT, "Print Weight", FadeColors.LIGHT_GREY));
2665 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.GET_TOTAL_WEIGHT_RECALC, "Print Weight Verbose", FadeColors.LIGHT_GREY));
2666 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.GET_PLAYER_WEIGHT, "Print Player Weight", FadeColors.LIGHT_GREY));
2667 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.GET_PLAYER_WEIGHT_RECALC, "Print Player Weight Verbose", FadeColors.LIGHT_GREY));
2668 }
Param4< int, int, string, int > TSelectableActionInfoWithColor
Definition EntityAI.c:97
EActions
Definition EActions.c:2
const int SAT_DEBUG_ACTION
Definition constants.c:424

References SAT_DEBUG_ACTION.

◆ GetDebugButtonNames()

void Entity::GetDebugButtonNames ( out string button1,
out string button2,
out string button3,
out string button4 )
inlineprotected

Definition at line 2349 of file EntityAI.c.

2349{} //DEPRICATED, USE GetDebugActions / OnAction

◆ GetDebugText()

string Entity::GetDebugText ( )
inlineprotected

Definition at line 2325 of file EntityAI.c.

2326 {
2327 string text = string.Empty;
2328
2329 text += "Weight: " + GetWeightEx() + "\n";
2330 text += "Disabled: " + GetIsSimulationDisabled() + "\n";
2331#ifdef SERVER
2332 if (GetEconomyProfile())
2333 text += "CE Lifetime default: " + (int)GetEconomyProfile().GetLifetime() + "\n";
2334 text += "CE Lifetime remaining: " + (int)GetLifetime() + "\n";
2335#endif
2336
2338 if (compEM)
2339 {
2340 text += "Energy Source: " + Object.GetDebugName(compEM.GetEnergySource()) + "\n";
2341 text += "Switched On: " + compEM.IsSwitchedOn() + "\n";
2342 text += "Is Working: " + compEM.IsWorking() + "\n";
2343 }
2344
2345 return text;
2346 }
Param3 int
float GetWeightEx(bool forceRecalc=false)
returns overall weight of the entity, 'forceRecalc = true' is meant to be used only when debugging,...
Definition EntityAI.c:2632
proto native float GetLifetime()
Get remaining economy lifetime (seconds)
proto native CEItemProfile GetEconomyProfile()
Get economy item profile (if assigned, otherwise null)
ComponentEnergyManager GetCompEM()
Definition EntityAI.c:2439

◆ GetDefaultHitComponent()

string Entity::GetDefaultHitComponent ( )
inlineprotected

returns default hit component for the Entity (overriden for each Type - PlayerBase, DayZInfected, DayZAnimal, etc.)

returns Global so it is obvious you need to configure that properly on entity

Definition at line 2794 of file EntityAI.c.

2795 {
2796 Debug.LogError("EntityAI: DefaultHitComponent not set properly for that entity (" + GetType() + ")");
2798 return "";
2799 }
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition Debug.c:341

References GetType(), and Debug::LogError().

◆ GetDefaultHitPosition()

vector Entity::GetDefaultHitPosition ( )
inlineprotected

Definition at line 2814 of file EntityAI.c.

2815 {
2816 Debug.LogError("EntityAI: DefaultHitPosition not set for that entity (" + GetType() + ")");
2817 return vector.Zero;
2818 }
static const vector Zero
Definition EnConvert.c:110

References GetType(), Debug::LogError(), and vector::Zero.

◆ GetDefaultHitPositionComponent()

string Entity::GetDefaultHitPositionComponent ( )
inlineprotected

returns default hit position component name for the Entity (overriden by type if needed - used mainly as support for impact particles)

Definition at line 2802 of file EntityAI.c.

2803 {
2804 Debug.LogError("EntityAI: DefaultHitPositionComponent not set for that entity (" + GetType() + ")");
2805 return "";
2806 }

References GetType(), and Debug::LogError().

◆ GetDestructionBehaviour()

string Entity::GetDestructionBehaviour ( )
inlineprivate

Definition at line 249 of file EntityAI.c.

250 {
251 return "";
252 }

◆ GetDiffuseAlpha()

proto native float Entity::GetDiffuseAlpha ( )
private

◆ GetDiffuseColorV()

proto native vector Entity::GetDiffuseColorV ( )
private

◆ GetEconomyProfile()

proto native CEItemProfile Entity::GetEconomyProfile ( )
protected

Get economy item profile (if assigned, otherwise null)

◆ GetEntityDamageDisplayNameMap()

map< int, string > Entity::GetEntityDamageDisplayNameMap ( )
inlineprotected

Definition at line 365 of file EntityAI.c.

366 {
368 }
ref map< int, string > m_DamageDisplayNameMap
Definition EntityAI.c:123

◆ GetEntityDamageZoneMap()

DamageZoneMap Entity::GetEntityDamageZoneMap ( )
inlineprotected

Definition at line 360 of file EntityAI.c.

361 {
362 return m_DamageZoneMap;
363 }
ref DamageZoneMap m_DamageZoneMap
Definition EntityAI.c:122

◆ GetFlareRelPosition()

proto native vector Entity::GetFlareRelPosition ( )
private

◆ GetHeatHazePower()

proto native float Entity::GetHeatHazePower ( )
private

◆ GetHeatHazeRadius()

proto native float Entity::GetHeatHazeRadius ( )
private

◆ GetHiddenSelectionIndex()

int Entity::GetHiddenSelectionIndex ( string selection)
inlineprotected

Returns index of the string found in cfg array 'hiddenSelections'. If it's not found then it returns -1.

Definition at line 2004 of file EntityAI.c.

2005 {
2007 return m_HiddenSelectionsData.GetHiddenSelectionIndex(selection);
2008
2009 return -1;
2010 }

◆ GetHiddenSelections()

override TStringArray Entity::GetHiddenSelections ( )
inlineprotected

Returns the hiddenSelectionsTextures array from the object's config.

Definition at line 2013 of file EntityAI.c.

2014 {
2016 return m_HiddenSelectionsData.m_HiddenSelections;
2017 else
2018 return super.GetHiddenSelections();
2019 }

◆ GetHiddenSelectionsData()

HiddenSelectionsData Entity::GetHiddenSelectionsData ( )
inlineprotected

Definition at line 1998 of file EntityAI.c.

1999 {
2001 }

◆ GetHiddenSelectionsMaterials()

override TStringArray Entity::GetHiddenSelectionsMaterials ( )
inlineprotected

Returns the hiddenSelectionsMaterials array from the object's config.

Definition at line 2031 of file EntityAI.c.

2032 {
2034 return m_HiddenSelectionsData.m_HiddenSelectionsMaterials;
2035 else
2036 return super.GetHiddenSelectionsMaterials();
2037 }

◆ GetHiddenSelectionsTextures()

override TStringArray Entity::GetHiddenSelectionsTextures ( )
inlineprotected

Returns the hiddenSelectionsTextures array from the object's config.

Definition at line 2022 of file EntityAI.c.

2023 {
2025 return m_HiddenSelectionsData.m_HiddenSelectionsTextures;
2026 else
2027 return super.GetHiddenSelectionsTextures();
2028 }

◆ GetHideIconMask()

int Entity::GetHideIconMask ( )
inlineprotected

should the item's icon be hidden in any part of the inventory?

Definition at line 220 of file EntityAI.c.

221 {
222 return EInventoryIconVisibility.ALWAYS;
223 }

◆ GetHierarchyLevel()

int Entity::GetHierarchyLevel ( int lvl = 0)
inlineprotected

Definition at line 730 of file EntityAI.c.

731 {
732 if (!GetHierarchyParent())
733 return lvl;
734
735 return GetHierarchyParent().GetHierarchyLevel(lvl + 1);
736 }

◆ GetHierarchyParent()

proto native EntityAI Entity::GetHierarchyParent ( )
protected

Returns direct parent of current entity.

◆ GetHierarchyRoot()

proto native EntityAI Entity::GetHierarchyRoot ( )
protected

Returns root of current hierarchy (for example: if this entity is in Backpack on gnd, returns Backpack)

◆ GetHierarchyRootPlayer()

proto native Man Entity::GetHierarchyRootPlayer ( )
protected

Returns root of current hierarchy cast to Man.

◆ GetHitComponentForAI()

string Entity::GetHitComponentForAI ( )
inlineprotected

Returns hit component for the Entity (overriden for each Type - PlayerBase, DayZInfected, DayZAnimal, etc.)

returns Global so it is obvious you need to configure that properly on entity

Definition at line 2786 of file EntityAI.c.

2787 {
2788 Debug.LogError("EntityAI: HitComponentForAI not set properly for that entity (" + GetType() + ")");
2790 return "";
2791 }

References GetType(), and Debug::LogError().

◆ GetInventory()

proto native GameInventory Entity::GetInventory ( )
protected

◆ GetInventoryAndCargoWeight()

float Entity::GetInventoryAndCargoWeight ( bool forceRecalc = false)
inlineprotected

Definition at line 2601 of file EntityAI.c.

2602 {
2603 float totalWeight;
2604 if (GetInventory())
2605 {
2606 int i = 0;
2607 int AttachmentsCount = GetInventory().AttachmentCount();
2608 if (AttachmentsCount > 0)
2609 {
2610 for (i = 0; i < AttachmentsCount; i++)
2611 totalWeight += GetInventory().GetAttachmentFromIndex(i).GetWeightEx(forceRecalc);
2612 }
2613
2614 CargoBase cargo = GetInventory().GetCargo();
2615 if (cargo)
2616 {
2617 int cargoCount = cargo.GetItemCount();
2618 for (i = 0; i < cargoCount; i++)
2619 totalWeight += cargo.GetItem(i).GetWeightEx(forceRecalc);
2620 }
2621 }
2622 return totalWeight;
2623 }
represents base for cargo storage for entities
Definition Cargo.c:7

◆ GetInventoryHandAnimation()

bool Entity::GetInventoryHandAnimation ( notnull InventoryLocation loc,
out int value )
inlineprotected

Definition at line 3093 of file EntityAI.c.

3094 {
3095 value = -1;
3096 return false;
3097 }

◆ GetInvulnerabilityTypeString()

string Entity::GetInvulnerabilityTypeString ( )
inlineprotected

Definition at line 2947 of file EntityAI.c.

2948 {
2949 return "";
2950 }

◆ GetLifetime()

proto native float Entity::GetLifetime ( )
protected

Get remaining economy lifetime (seconds)

◆ GetLifetimeMax()

proto native float Entity::GetLifetimeMax ( )
protected

Get max economy lifetime per instance - default is from DB (seconds)

◆ GetLightType()

proto native int Entity::GetLightType ( )
private

◆ GetLiquidThroughputCoef()

float Entity::GetLiquidThroughputCoef ( )
inlineprotected

Returns liquid throughput coeficient.

Definition at line 2942 of file EntityAI.c.

2943 {
2945 }
const float LIQUID_THROUGHPUT_DEFAULT
Definition constants.c:524

References LIQUID_THROUGHPUT_DEFAULT.

◆ GetMeleeTargetType()

int Entity::GetMeleeTargetType ( )
inlineprotected

value is related to EMeleeTargetType

Definition at line 2821 of file EntityAI.c.

2822 {
2823 return EMeleeTargetType.ALIGNABLE;
2824 }
EMeleeTargetType

◆ GetNearPlane()

proto native float Entity::GetNearPlane ( )
private

get near plane of camera

◆ GetObjectMaterial()

proto native owned string Entity::GetObjectMaterial ( int index)
protected

◆ GetObjectTexture()

proto native owned string Entity::GetObjectTexture ( int index)
protected

◆ GetOnAttachmentReleaseLock()

ScriptInvoker Entity::GetOnAttachmentReleaseLock ( )
inlineprotected

Definition at line 1103 of file EntityAI.c.

1104 {
1108 }
ref ScriptInvoker m_OnAttachmentReleaseLock
Definition EntityAI.c:160
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116

◆ GetOnAttachmentSetLock()

ScriptInvoker Entity::GetOnAttachmentSetLock ( )
inlineprotected

Definition at line 1096 of file EntityAI.c.

1097 {
1100 return m_OnAttachmentSetLock;
1101 }
ref ScriptInvoker m_OnAttachmentSetLock
Definition EntityAI.c:158

◆ GetOnHitByInvoker()

ScriptInvoker Entity::GetOnHitByInvoker ( )
inlineprotected

Definition at line 1110 of file EntityAI.c.

1111 {
1112 if (!m_OnHitByInvoker)
1114 return m_OnHitByInvoker;
1115 }

◆ GetOnItemAddedIntoCargo()

ScriptInvoker Entity::GetOnItemAddedIntoCargo ( )
inlineprotected

Definition at line 1047 of file EntityAI.c.

1048 {
1052 }

◆ GetOnItemAttached()

ScriptInvoker Entity::GetOnItemAttached ( )
inlineprotected

Definition at line 1033 of file EntityAI.c.

1034 {
1035 if (!m_OnItemAttached)
1037 return m_OnItemAttached;
1038 }

◆ GetOnItemDetached()

ScriptInvoker Entity::GetOnItemDetached ( )
inlineprotected

Definition at line 1040 of file EntityAI.c.

1041 {
1042 if (!m_OnItemDetached)
1044 return m_OnItemDetached;
1045 }

◆ GetOnItemFlipped()

ScriptInvoker Entity::GetOnItemFlipped ( )
inlineprotected

Definition at line 1068 of file EntityAI.c.

1069 {
1070 if (!m_OnItemFlipped)
1072 return m_OnItemFlipped;
1073 }
ref ScriptInvoker m_OnItemFlipped
Definition EntityAI.c:150

◆ GetOnItemMovedInCargo()

ScriptInvoker Entity::GetOnItemMovedInCargo ( )
inlineprotected

Definition at line 1061 of file EntityAI.c.

1062 {
1065 return m_OnItemMovedInCargo;
1066 }

◆ GetOnItemRemovedFromCargo()

ScriptInvoker Entity::GetOnItemRemovedFromCargo ( )
inlineprotected

Definition at line 1054 of file EntityAI.c.

◆ GetOnKilledInvoker()

ScriptInvoker Entity::GetOnKilledInvoker ( )
inlineprotected

Definition at line 1117 of file EntityAI.c.

1118 {
1119 if (!m_OnKilledInvoker)
1121 return m_OnKilledInvoker;
1122 }

◆ GetOnReleaseLock()

ScriptInvoker Entity::GetOnReleaseLock ( )
inlineprotected

Definition at line 1089 of file EntityAI.c.

1090 {
1091 if (!m_OnReleaseLock)
1093 return m_OnReleaseLock;
1094 }
ref ScriptInvoker m_OnReleaseLock
Definition EntityAI.c:156

◆ GetOnSetLock()

ScriptInvoker Entity::GetOnSetLock ( )
inlineprotected

Definition at line 1082 of file EntityAI.c.

1083 {
1084 if (!m_OnSetLock)
1086 return m_OnSetLock;
1087 }
ref ScriptInvoker m_OnSetLock
Definition EntityAI.c:154

◆ GetOnViewIndexChanged()

ScriptInvoker Entity::GetOnViewIndexChanged ( )
inlineprotected

Definition at line 1075 of file EntityAI.c.

1076 {
1079 return m_OnViewIndexChanged;
1080 }
ref ScriptInvoker m_OnViewIndexChanged
Definition EntityAI.c:152

◆ GetPairDevice()

EntityAI Entity::GetPairDevice ( )
protected

◆ GetPersistentID()

proto void Entity::GetPersistentID ( out int b1,
out int b2,
out int b3,
out int b4 )
protected

Returns blocks of bits of persistence id of this entity. This id stays the same even after server restart.

◆ GetQuantity()

float Entity::GetQuantity ( )
inlineprotected

Definition at line 1948 of file EntityAI.c.

1949 {
1950 return 0;
1951 }

◆ GetQuantityMax()

int Entity::GetQuantityMax ( )
inlineprotected

Definition at line 1953 of file EntityAI.c.

1954 {
1955 return 0;
1956 }

◆ GetQuickBarBonus()

int Entity::GetQuickBarBonus ( )
inlineprotected

Definition at line 1965 of file EntityAI.c.

1966 {
1967 return 0;
1968 }

◆ GetRadius()

proto native float Entity::GetRadius ( )
private

◆ GetRemotelyActivatedItemBehaviour()

RemotelyActivatedItemBehaviour Entity::GetRemotelyActivatedItemBehaviour ( )
protected

Remotely controlled devices helpers.

◆ GetSingleInventoryItemWeightEx()

float Entity::GetSingleInventoryItemWeightEx ( )
inlineprotected

Definition at line 2656 of file EntityAI.c.

2656{}

◆ GetSlotsCountCorrect()

int Entity::GetSlotsCountCorrect ( )
inlineprotected

Definition at line 1588 of file EntityAI.c.

1589 {
1590 if (GetInventory())
1591 return GetInventory().GetAttachmentSlotsCount();
1592 else
1593 return -1;
1594 }

◆ GetSoundLength()

proto native float Entity::GetSoundLength ( )
private

◆ GetSpotLightAngle()

proto native float Entity::GetSpotLightAngle ( )
private

◆ GetSuitableFinisherHitComponents()

array< string > Entity::GetSuitableFinisherHitComponents ( )
inlineprotected

Definition at line 2808 of file EntityAI.c.

2809 {
2810 Debug.LogError("EntityAI: SuitableFinisherHitComponents not set for that entity (" + GetType() + ")");
2811 return null;
2812 }

References GetType(), and Debug::LogError().

◆ GetTargetQuantityMax()

int Entity::GetTargetQuantityMax ( int attSlotID = -1)
inlineprotected

Definition at line 1960 of file EntityAI.c.

1961 {
1962 return 0;
1963 }

◆ GetTemperature()

float Entity::GetTemperature ( )
inlineprotected

Definition at line 1976 of file EntityAI.c.

1977 {
1978 return 0;
1979 }

◆ GetTemperatureInit()

float Entity::GetTemperatureInit ( )
inlineprotected

Definition at line 1981 of file EntityAI.c.

1982 {
1983 return 0;
1984 }

◆ GetTemperatureMax()

float Entity::GetTemperatureMax ( )
inlineprotected

Definition at line 1991 of file EntityAI.c.

1992 {
1993 return 0;
1994 }

◆ GetTemperatureMin()

float Entity::GetTemperatureMin ( )
inlineprotected

Definition at line 1986 of file EntityAI.c.

1987 {
1988 return 0;
1989 }

◆ GetTurnableValveIndex()

int Entity::GetTurnableValveIndex ( int pComponentIndex)
protected

◆ GetUniversalTemperatureSource()

UTemperatureSource Entity::GetUniversalTemperatureSource ( )
inlineprotected

Definition at line 3110 of file EntityAI.c.

3111 {
3113 }
UTemperatureSource m_UniversalTemperatureSource
Definition EntityAI.c:132

◆ GetUniversalTemperatureSourcePosition()

vector Entity::GetUniversalTemperatureSourcePosition ( )
inlineprotected

Definition at line 3120 of file EntityAI.c.

3121 {
3122 return GetPosition();
3123 }

References GetPosition.

◆ GetViewIndex()

int Entity::GetViewIndex ( )
inlineprotected

Returns item preview index !!!! IF OVERRIDING with more dynamic events call GetOnViewIndexChanged() in constructor on client !!!!

Definition at line 2740 of file EntityAI.c.

2741 {
2742 if (MemoryPointExists("invView2"))
2743 {
2744#ifdef PLATFORM_WINDOWS
2746 GetInventory().GetCurrentInventoryLocation(il);
2747 InventoryLocationType type = il.GetType();
2748 switch (type)
2749 {
2750 case InventoryLocationType.CARGO:
2751 {
2752 return 0;
2753 }
2754 case InventoryLocationType.ATTACHMENT:
2755 {
2756 return 1;
2757 }
2758 case InventoryLocationType.HANDS:
2759 {
2760 return 0;
2761 }
2762 case InventoryLocationType.GROUND:
2763 {
2764 return 1;
2765 }
2766 case InventoryLocationType.PROXYCARGO:
2767 {
2768 return 0;
2769 }
2770 default:
2771 {
2772 return 0;
2773 }
2774 }
2775#endif
2776
2777#ifdef PLATFORM_CONSOLE
2778 return 1;
2779#endif
2780 }
2781 return 0;
2782 }

◆ GetWeight()

int Entity::GetWeight ( )
inlineprotected

Definition at line 2573 of file EntityAI.c.

2574 {
2575 return GetWeightEx();
2576 }

◆ GetWeightEx()

float Entity::GetWeightEx ( bool forceRecalc = false)
inlineprotected

returns overall weight of the entity, 'forceRecalc = true' is meant to be used only when debugging, using it in gameplay code is higly inadvisable as it bypasses the weight caching and has adverse effect on performance

Definition at line 2632 of file EntityAI.c.

2633 {
2634 if (m_WeightDirty || forceRecalc)//recalculate
2635 {
2638
2639#ifdef DEVELOPER
2640 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
2641 WeightDebug.GetWeightDebug(this).SetWeight(m_WeightEx);
2642 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_DIRTY)
2643 {
2644 Print("ent:" + this + " - Dirty Recalc");
2645 if (WeightDebug.m_VerbosityFlags & WeightDebugType.DUMP_STACK)
2646 DumpStack();
2647 }
2648#endif
2649 }
2650
2651 return m_WeightEx;
2652 }
void ClearWeightDirty()
Definition EntityAI.c:2578
float GetWeightSpecialized(bool forceRecalc=false)
returns weight of the entity in a way that's specific to the entity type and is internal to the weigh...
Definition EntityAI.c:2625
float m_WeightEx
Definition EntityAI.c:126
proto void DumpStack()
Prints current call stack (stack trace)
proto void Print(void var)
Prints content of variable to console/log.

References DumpStack(), GetWeightSpecialized(), and Print().

◆ GetWeightSpecialized()

float Entity::GetWeightSpecialized ( bool forceRecalc = false)
inlineprotected

returns weight of the entity in a way that's specific to the entity type and is internal to the weight system calculation, to obtain entity's weight, use the 'GetWeightEx' method instead

Definition at line 2625 of file EntityAI.c.

2626 {
2628 }
float GetInventoryAndCargoWeight(bool forceRecalc=false)
Definition EntityAI.c:2601

◆ GetWet()

float Entity::GetWet ( )
inlineprotected

Definition at line 1902 of file EntityAI.c.

1903 {
1904 return 0;
1905 }

◆ GetWetInit()

float Entity::GetWetInit ( )
inlineprotected

Definition at line 1917 of file EntityAI.c.

1918 {
1919 return 0;
1920 }

◆ GetWetLevel()

EWetnessLevel Entity::GetWetLevel ( )
protected

◆ GetWetLevelInternal()

static EWetnessLevel Entity::GetWetLevelInternal ( float wetness)
inlinestaticprotected

Definition at line 1934 of file EntityAI.c.

1935 {
1937 return EWetnessLevel.DRY;
1938 else if (wetness < GameConstants.STATE_WET)
1939 return EWetnessLevel.DAMP;
1941 return EWetnessLevel.WET;
1943 return EWetnessLevel.SOAKING;
1944 return EWetnessLevel.DRENCHED;
1945 }
EWetnessLevel
Definition EntityAI.c:2
const float STATE_DAMP
Definition constants.c:784
const float STATE_SOAKING_WET
Definition constants.c:782
const float STATE_DRENCHED
Definition constants.c:781
const float STATE_WET
Definition constants.c:783

References GameConstants::STATE_DAMP, GameConstants::STATE_DRENCHED, GameConstants::STATE_SOAKING_WET, and GameConstants::STATE_WET.

◆ GetWetMax()

float Entity::GetWetMax ( )
inlineprotected

Definition at line 1907 of file EntityAI.c.

1908 {
1909 return 0;
1910 }

◆ GetWetMin()

float Entity::GetWetMin ( )
inlineprotected

Definition at line 1912 of file EntityAI.c.

1913 {
1914 return 0;
1915 }

◆ GetWetWeightModifier()

float Entity::GetWetWeightModifier ( )
inlineprotected

Definition at line 2552 of file EntityAI.c.

2553 {
2555 }
static array< float > GetWetnessWeightModifiers()
EWetnessLevel GetWetLevel()

References GetWetLevel(), and CfgGameplayHandler::GetWetnessWeightModifiers().

◆ HasAnyCargo()

bool Entity::HasAnyCargo ( )
inlineprotected

is this container empty or not, checks only cargo

Definition at line 543 of file EntityAI.c.

544 {
545 CargoBase cargo = GetInventory().GetCargo();
546
547 if (!cargo) return false; //this is not a cargo container
548
549 if (cargo.GetItemCount() > 0)
550 return true;
551 else
552 return false;
553 }

◆ HasBayonetAttached()

bool Entity::HasBayonetAttached ( )
inlineprotected

Definition at line 2974 of file EntityAI.c.

2974{};

◆ HasButtstockAttached()

bool Entity::HasButtstockAttached ( )
inlineprotected

Definition at line 2978 of file EntityAI.c.

2978{};

◆ HasComponent()

bool Entity::HasComponent ( int comp_type)
inlineprivate

IsComponentExist.

Definition at line 260 of file EntityAI.c.

261 {
263 return m_ComponentsBank.IsComponentAlreadyExist(comp_type);
264
265 return false;
266 }

◆ HasEnergyManager()

bool Entity::HasEnergyManager ( )
inlineprotected

If this item has class EnergyManager in its config then it returns true. Otherwise returns false.

Definition at line 2450 of file EntityAI.c.

2451 {
2453 }

References COMP_TYPE_ENERGY_MANAGER.

◆ HasFlammableMaterial()

bool Entity::HasFlammableMaterial ( )
inlineprotected

Override this method to return TRUE when this item has or can provide fire. Evaluated on server and client.

Definition at line 417 of file EntityAI.c.

418 {
419 return false;
420 }

◆ HasInternalExclusionConflicts()

bool Entity::HasInternalExclusionConflicts ( int targetSlot)
inlineprivate

checks if any attachment or item state would interfere with this being attached into a different slot (Headgear -> Mask)

Definition at line 3444 of file EntityAI.c.

3445 {
3447 if (targetSlotValues) //can be null, if so, no conflict
3448 {
3449 set<int> additionalValues = new set<int>(); //NOT slot values
3452
3453 int countTarget = targetSlotValues.Count();
3454 for (int i = 0; i < countTarget; i++)
3455 {
3456 if (additionalValues.Find(targetSlotValues[i]) != -1)
3457 return true;
3458 }
3459 }
3460 return false;
3461 }
set< int > GetAttachmentExclusionMaskGlobal()
Global mask value, independent of slot-specific behavior!
Definition EntityAI.c:3432
set< int > GetAttachmentExclusionMaskChildren()
Mask value coming from the item's attachments.
Definition EntityAI.c:3438

◆ HasTurnableValveBehavior()

bool Entity::HasTurnableValveBehavior ( )
protected

Turnable Valve behaviour.

◆ HasWetness()

bool Entity::HasWetness ( )
inlineprotected

Definition at line 1922 of file EntityAI.c.

1923 {
1924 return GetWetMax() - GetWetMin() != 0;
1925 }
float GetWetMin()
Definition EntityAI.c:1912
float GetWetMax()
Definition EntityAI.c:1907

References GetWetMax(), and GetWetMin().

◆ HeightCheckOverride()

float Entity::HeightCheckOverride ( )
inlineprotected

used as script-side override of distance for specific height checks

Definition at line 520 of file EntityAI.c.

521 {
522 return 0.0;
523 }

◆ HeightStartCheckOverride()

float Entity::HeightStartCheckOverride ( )
inlineprotected

used as script-side override of start pos for specific height checks

Definition at line 526 of file EntityAI.c.

527 {
528 return 0.0;
529 }

◆ HideAllSelections()

void Entity::HideAllSelections ( )
inlineprotected

Sets all animation values to 1, making them INVISIBLE if they are configured in models.cfg in such way. These selections must also be defined in the entity's config class in 'AnimationSources'.

Definition at line 1195 of file EntityAI.c.

1196 {
1197 string cfg_path = "cfgVehicles " + GetType() + " AnimationSources";
1198
1199 if (GetGame().ConfigIsExisting(cfg_path))
1200 {
1201 int selections = GetGame().ConfigGetChildrenCount(cfg_path);
1202
1203 for (int i = 0; i < selections; i++)
1204 {
1205 string selection_name;
1206 GetGame().ConfigGetChildName(cfg_path, i, selection_name);
1208 }
1209 }
1210 }
void HideSelection(string selection_name)
Hides selection of the given name. Must be configed in config.cpp and models.cfg.
Definition EntityAI.c:2385

References GetGame(), and GetType().

◆ HideSelection()

void Entity::HideSelection ( string selection_name)
inlineprotected

Hides selection of the given name. Must be configed in config.cpp and models.cfg.

Definition at line 2385 of file EntityAI.c.

2386 {
2387 if (!ToDelete())
2388 {
2389 SetAnimationPhase(selection_name, 1); // 1 = hide, 0 = unhide!
2390 }
2391 }

◆ IgnoreOutOfReachCondition()

Entity::IgnoreOutOfReachCondition ( )
inlineprotected
Returns
if true, attachment condition for out of reach (inventory) will be ignored

Definition at line 1558 of file EntityAI.c.

1559 {
1560 return GetHierarchyRootPlayer() == GetGame().GetPlayer();
1561 }

References GetGame().

◆ IncreaseLifetime()

proto native void Entity::IncreaseLifetime ( )
protected

Reset economy lifetime to default (seconds)

◆ IncreaseLifetimeUp()

void Entity::IncreaseLifetimeUp ( )
inlineprotected

Reset economy lifetime to default across entity hierarchy all the way to the topmost entity.

Definition at line 2419 of file EntityAI.c.

2420 {
2422 if (GetHierarchyParent())
2423 GetHierarchyParent().IncreaseLifetimeUp();
2424 }
proto native void IncreaseLifetime()
Reset economy lifetime to default (seconds)

◆ InitAttachmentExclusionValues()

void Entity::InitAttachmentExclusionValues ( )
inlineprivate

Definition at line 3150 of file EntityAI.c.

3151 {
3155
3156 int count = GetInventory().GetSlotIdCount();
3157 //no sense in performing inits for something that cannot be attached anywhere (hand/lefthand and some other 'special' slots are the reason for creating 'new' sets above)
3158 if (count == 0)
3159 return;
3160
3164 }
void InitGlobalExclusionValues()
override to init part of the mask, independent of slot-specific behavior
void InitLegacyConfigExclusionValues()
Definition EntityAI.c:3189
void InitInherentSlotExclusionMap()
map stored on instance to better respond to various state changes
Definition EntityAI.c:3167

◆ InitDamageZoneDisplayNameMapping()

void Entity::InitDamageZoneDisplayNameMapping ( )
inlineprivate

Initialize map of damage zone display names for more optimized retrieval.

Definition at line 310 of file EntityAI.c.

311 {
312 string path_base;
313 string path;
314 string component_name;
315
316 if (IsWeapon())
318 else if (IsMagazine())
320 else
322
323 path_base = string.Format("%1 %2 DamageSystem DamageZones", path_base, GetType());
324
325 if (!GetGame().ConfigIsExisting(path_base))
326 {
327 component_name = GetDisplayName();
328 GetGame().FormatRawConfigStringKeys(component_name);
329 m_DamageDisplayNameMap.Insert("".Hash(), component_name);
330 }
331 else
332 {
334 GetDamageZones(zone_names);
335
336 for (int i = 0; i < zone_names.Count(); i++)
337 {
338 path = string.Format("%1 %2 displayName", path_base, zone_names[i]);
339
340 if (GetGame().ConfigIsExisting(path) && GetGame().ConfigGetTextRaw(path, component_name))
341 {
342 GetGame().FormatRawConfigStringKeys(component_name);
344 }
345 }
346 }
347 }
array< string > TStringArray
Definition EnScript.c:666
const string CFG_VEHICLESPATH
Definition constants.c:209
const string CFG_WEAPONSPATH
Definition constants.c:210
const string CFG_MAGAZINESPATH
Definition constants.c:211
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.

References CFG_MAGAZINESPATH, CFG_VEHICLESPATH, CFG_WEAPONSPATH, string::Format(), GetGame(), GetType(), and path.

◆ InitDamageZoneMapping()

void Entity::InitDamageZoneMapping ( )
inlineprivate

Initializes script-side map of damage zones and their components (named selections in models)

Definition at line 303 of file EntityAI.c.

304 {
306 DamageSystem.GetDamageZoneMap(this, m_DamageZoneMap);
307 }
map< string, ref array< string > > DamageZoneMap

◆ InitGlobalExclusionValues()

void Entity::InitGlobalExclusionValues ( )
protected

override to init part of the mask, independent of slot-specific behavior

◆ InitInherentSlotExclusionMap()

void Entity::InitInherentSlotExclusionMap ( )
inlineprivate

map stored on instance to better respond to various state changes

Definition at line 3167 of file EntityAI.c.

3168 {
3169 int count = GetInventory().GetSlotIdCount();
3170 //starting with the INVALID slot, so it is always in the map of attachable items
3172
3173 int slotId;
3174 for (int i = 0; i < count; i++)
3175 {
3176 slotId = GetInventory().GetSlotId(i);
3178 }
3179 }
void SetAttachmentExclusionMaskSlot(int slotId, set< int > values)
sets values for specific slot
Definition EntityAI.c:3368
set< int > GetAttachmentExclusionInitSlotValue(int slotId)
override this to modify slot behavior for specific items, or just set 'm_AttachmentExclusionMaskGloba...
Definition EntityAI.c:3182

References InventorySlots::INVALID.

◆ InitLegacyConfigExclusionValues()

void Entity::InitLegacyConfigExclusionValues ( )
inlineprotected

Definition at line 3189 of file EntityAI.c.

3190 {
3192
3193 //adding implicit slot info AFTER the check is performed
3195
3198 }
void InitLegacySlotExclusionValuesImplicit()
adding base one-directional relations between headgear, masks, eyewear, and headstraps (exception)
Definition EntityAI.c:3227
bool InitLegacyExclusionCheck()
Definition EntityAI.c:3201
void InitLegacySlotExclusionValuesDerived()
Definition EntityAI.c:3280

◆ InitLegacyExclusionCheck()

bool Entity::InitLegacyExclusionCheck ( )
inlineprotected

Definition at line 3201 of file EntityAI.c.

3202 {
3203 //first check the globals
3204 if (m_AttachmentExclusionMaskGlobal.Count() > 0)
3205 return false;
3206
3207 //now the map
3208 int count = m_AttachmentExclusionSlotMap.Count();
3209 if (count > 1) //more than InventorySlots.INVALID
3210 {
3211 for (int i = 0; i < count; i++)
3212 {
3213 int countSet = m_AttachmentExclusionSlotMap.GetElement(i).Count();
3214 if (countSet > 0) //SOMETHING is defined
3215 return false;
3216 }
3217 }
3218
3219 return true;
3220 }

◆ InitLegacySlotExclusionValuesDerived()

void Entity::InitLegacySlotExclusionValuesDerived ( )
inlineprotected

Definition at line 3280 of file EntityAI.c.

3281 {
3282 int slotId;
3283 int slotCount = GetInventory().GetSlotIdCount();
3284 for (int i = 0; i < slotCount; i++)
3285 {
3286 slotId = GetInventory().GetSlotId(i);
3287 set<int> tmp;
3288 switch (slotId)
3289 {
3290 case InventorySlots.HEADGEAR:
3291 {
3292 tmp = new set<int>;
3294 if (ConfigGetBool("noNVStrap"))
3295 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_HEADGEAR);
3296 if (ConfigGetBool("noMask"))
3297 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADGEAR);
3298 if (ConfigGetBool("noEyewear"))
3299 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_HEADGEAR);
3301 break;
3302 }
3303
3304 case InventorySlots.MASK:
3305 {
3306 tmp = new set<int>;
3308 if (ConfigGetBool("noNVStrap"))
3309 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_MASK);
3310 if (ConfigGetBool("noHelmet"))
3311 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_MASK);
3312 if (ConfigGetBool("noEyewear"))
3313 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_MASK);
3315 break;
3316 }
3317
3318 case InventorySlots.EYEWEAR:
3319 {
3320 tmp = new set<int>;
3322 if (ConfigGetBool("isStrap"))
3323 {
3324 if (ConfigGetBool("noHelmet"))
3325 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_HEADSTRAP);
3326 if (ConfigGetBool("noMask"))
3327 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADSTRAP);
3328 }
3329 else
3330 {
3331 if (ConfigGetBool("noHelmet"))
3332 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_EYEWEWEAR);
3333 if (ConfigGetBool("noMask"))
3334 tmp.Insert(EAttExclusions.LEGACY_MASK_EYEWEWEAR);
3335 }
3337 break;
3338 }
3339 }
3340 }
3341 }

◆ InitLegacySlotExclusionValuesImplicit()

Entity::InitLegacySlotExclusionValuesImplicit ( )
inlineprotected

adding base one-directional relations between headgear, masks, eyewear, and headstraps (exception)

Note
: 'InitLegacyConfigExclusionValues' adds them the other way if the item does not have any script-side exclusions AND has some legacy config parameter.

Definition at line 3227 of file EntityAI.c.

3228 {
3229 int slotId;
3230 int slotCount = GetInventory().GetSlotIdCount();
3231 for (int i = 0; i < slotCount; i++)
3232 {
3233 slotId = GetInventory().GetSlotId(i);
3234 set<int> tmp;
3235 switch (slotId)
3236 {
3237 case InventorySlots.HEADGEAR:
3238 {
3239 tmp = new set<int>;
3241 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_MASK);
3242 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_HEADSTRAP);
3243 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_EYEWEWEAR);
3245 break;
3246 }
3247
3248 case InventorySlots.MASK:
3249 {
3250 tmp = new set<int>;
3252 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADGEAR);
3253 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADSTRAP);
3254 tmp.Insert(EAttExclusions.LEGACY_MASK_EYEWEWEAR);
3256 break;
3257 }
3258
3259 case InventorySlots.EYEWEAR:
3260 {
3261 tmp = new set<int>;
3263 if (ConfigGetBool("isStrap"))
3264 {
3265 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_HEADGEAR);
3266 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_MASK);
3267 }
3268 else
3269 {
3270 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_HEADGEAR);
3271 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_MASK);
3272 }
3274 break;
3275 }
3276 }
3277 }
3278 }

◆ InsertAgent()

void Entity::InsertAgent ( int agent,
float count = 1 )
protected

◆ InterpolateTo()

static proto native void Entity::InterpolateTo ( Camera targetCamera,
float time,
int type )
staticprivate

Interpolation between camera instances (current camera becomes targetCamera at the end of interpolation)

Parameters
targetCamerato which camera we want to interpolate
timetrue interpolation time
type0 = without dynamics 1 = first half - acceleration, second half deceleration 2 = first third - acceleration, second third - linear movement, last third - deceleration

◆ IsActive()

proto native bool Entity::IsActive ( )
private

Is this camera active?

Returns
bool true if this camera is active

◆ IsAnimal()

bool Entity::IsAnimal ( )
inlineprotected

Definition at line 583 of file EntityAI.c.

584 {
585 return false;
586 }

◆ IsBasebuildingKit()

bool Entity::IsBasebuildingKit ( )
inlineprotected

Definition at line 448 of file EntityAI.c.

449 {
450 return false;
451 }

◆ IsBeingPlaced()

bool Entity::IsBeingPlaced ( )
inlineprotected

Definition at line 1438 of file EntityAI.c.

1439 {
1440 return false;
1441 }

◆ IsDestructionBehaviour()

bool Entity::IsDestructionBehaviour ( )
inlineprivate

Definition at line 254 of file EntityAI.c.

255 {
256 return false;
257 }

◆ IsEmpty()

bool Entity::IsEmpty ( )
inlineprotected

is this container empty or not, checks both cargo and attachments

Definition at line 532 of file EntityAI.c.

533 {
534 return (!HasAnyCargo() && GetInventory().AttachmentCount() == 0);
535 }
bool HasAnyCargo()
is this container empty or not, checks only cargo
Definition EntityAI.c:543

◆ IsEnabled()

proto native bool Entity::IsEnabled ( )
private

◆ IsEntityAI()

override bool Entity::IsEntityAI ( )
inlineprotected

Definition at line 571 of file EntityAI.c.

571{ return true; }

◆ IsExclusionFlagPresent()

bool Entity::IsExclusionFlagPresent ( set< int > values)
inlineprotected

checks 'this' if the incoming flag is present for the current state (slot behavior and others)

Definition at line 3464 of file EntityAI.c.

3465 {
3466 int slotId;
3467 string slotName;
3468 GetInventory().GetCurrentAttachmentSlotInfo(slotId, slotName); //if currently attached, treat it accordingly
3469
3471 int count = values.Count();
3472 for (int i = 0; i < count; i++)
3473 {
3474 if (currentSlotValuesAll.Find(values[i]) != -1)
3475 return true;
3476 }
3477 return false;
3478 }
PlayerSpawnPreset slotName
set< int > GetAttachmentExclusionMaskAll(int slotId)
Slot-specific, children (attachments), and additional (state etc.) masks combined.
Definition EntityAI.c:3413

References slotName.

◆ IsExclusionFlagPresentRecursive()

bool Entity::IsExclusionFlagPresentRecursive ( set< int > values,
int targetSlot )
inlineprotected

Gets flag from what is effectively an owner.

Definition at line 3481 of file EntityAI.c.

3482 {
3483 if (values && values.Count() != 0)
3484 {
3486 GetInventory().GetCurrentInventoryLocation(lcn);
3487 EntityAI parent = GetHierarchyParent();
3490 {
3491 if (parent && parent != this) //we reached root if false
3492 return parent.IsExclusionFlagPresentRecursive(passThis, lcn.GetSlot());
3493 }
3495 }
3496
3497 return false;
3498 }
bool CheckExclusionAccessCondition(int occupiedSlot, int targetSlot, set< int > value, inout set< int > adjustedValue)
Definition EntityAI.c:3501
bool IsExclusionFlagPresent(set< int > values)
checks 'this' if the incoming flag is present for the current state (slot behavior and others)
Definition EntityAI.c:3464

◆ IsFlareVisible()

proto native bool Entity::IsFlareVisible ( )
private

◆ IsHeavyBehaviour()

bool Entity::IsHeavyBehaviour ( )
inlineprotected

returns item behaviour of item (more in ItemBase)

Definition at line 2833 of file EntityAI.c.

2834 {
2835 return false;
2836 }

◆ IsHologram()

override bool Entity::IsHologram ( )
inlineprotected

Definition at line 1443 of file EntityAI.c.

1444 {
1445 return false;
1446 }

◆ IsIgnited()

bool Entity::IsIgnited ( )
inlineprotected

Override this method and make it so it returns whenever this item is on fire right now or not. Evaluated on Server and Client.

Definition at line 435 of file EntityAI.c.

436 {
437 if (m_EM)
438 return m_EM.IsWorking();
439 return false;
440 }
bool IsWorking()
Energy manager: Returns true if this device is working right now.

References ComponentEnergyManager::IsWorking().

◆ IsIgnoredByConstruction()

bool Entity::IsIgnoredByConstruction ( )
inlineprotected

Definition at line 598 of file EntityAI.c.

599 {
600 return IsDamageDestroyed();
601 }

References IsDamageDestroyed().

◆ IsInitialized()

bool Entity::IsInitialized ( )
inlineprotected

Definition at line 214 of file EntityAI.c.

215 {
216 return m_Initialized;
217 }

References m_Initialized.

◆ IsInventoryVisible()

bool Entity::IsInventoryVisible ( )
inlineprotected

Definition at line 573 of file EntityAI.c.

574 {
575 return !(GetParent() || GetHierarchyParent());
576 }
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:389

References GetParent().

◆ IsLockedInSlot()

Entity::IsLockedInSlot ( )
inlineprotected
Returns
true if entity is locked in attachment slot

Definition at line 1610 of file EntityAI.c.

1611 {
1612 EntityAI parent = GetHierarchyParent();
1613 if (parent)
1614 {
1616 GetInventory().GetCurrentInventoryLocation(inventory_location);
1617
1618 return parent.GetInventory().GetSlotLock(inventory_location.GetSlot());
1619 }
1620
1621 return false;
1622 }

◆ IsManagingArrows()

bool Entity::IsManagingArrows ( )
inlineprotected

Definition at line 3550 of file EntityAI.c.

3551 {
3552 return false;
3553 }

◆ IsOneHandedBehaviour()

bool Entity::IsOneHandedBehaviour ( )
inlineprotected

returns item behaviour of item (more in ItemBase)

Definition at line 2839 of file EntityAI.c.

2840 {
2841 return false;
2842 }

◆ IsPilotLight()

proto native bool Entity::IsPilotLight ( )
protected

◆ IsPlayer()

bool Entity::IsPlayer ( )
inlineprotected

Definition at line 578 of file EntityAI.c.

579 {
580 return false;
581 }

◆ IsPreparedToDelete()

bool Entity::IsPreparedToDelete ( )
inlineprotected

Definition at line 675 of file EntityAI.c.

676 {
677 return m_PreparedToDelete;
678 }
bool m_PreparedToDelete
Definition EntityAI.c:103

◆ IsPrepareToDelete()

bool Entity::IsPrepareToDelete ( )
inlineprotected

Definition at line 687 of file EntityAI.c.

688 {
689 return false;
690 }

◆ IsRefresherSignalingViable()

bool Entity::IsRefresherSignalingViable ( )
inlineprivate

Definition at line 286 of file EntityAI.c.

287 {
288 if (IsRuined())
289 return false;
290 return m_RefresherViable;
291 }
bool m_RefresherViable
Definition EntityAI.c:104

◆ IsSetForDeletion()

bool Entity::IsSetForDeletion ( )
inlineprotected

Definition at line 657 of file EntityAI.c.

658 {
659 return IsPreparedToDelete() || m_PendingDelete || ToDelete() || IsPendingDeletion();
660 }
bool IsPreparedToDelete()
Definition EntityAI.c:675
bool IsPendingDeletion()
Get whether the Effect is queued up for being cleaned up.
Definition Effect.c:249

References IsPendingDeletion().

◆ IsSimpleHiddenSelectionVisible()

proto native bool Entity::IsSimpleHiddenSelectionVisible ( int index)
protected

◆ IsSkinned()

bool Entity::IsSkinned ( )
inlineprotected

Skinning.

Definition at line 395 of file EntityAI.c.

396 {
397 return GetCompBS() && GetCompBS().IsSkinned();
398 }
ComponentBodyStaging GetCompBS()
Use this to access Body Staging component on dead character. Returns NULL if the given object lacks s...
Definition EntityAI.c:2429

◆ IsTakeable()

bool Entity::IsTakeable ( )
inlineprotected

Definition at line 1579 of file EntityAI.c.

1580 {
1581 return false;
1582 }

◆ IsTargetIgnitionSuccessful()

bool Entity::IsTargetIgnitionSuccessful ( EntityAI item_target)
inlineprotected

Final evaluation just before the target item is actually ignited. Evaluated on Server.

Definition at line 484 of file EntityAI.c.

485 {
486 return true;
487 }

◆ IsThisIgnitionSuccessful()

bool Entity::IsThisIgnitionSuccessful ( EntityAI item_source = NULL)
inlineprotected

Final evaluation just before this item is actually ignited from fire source. Evaluated on Server.

Definition at line 490 of file EntityAI.c.

491 {
492 return true;
493 }

◆ IsTwoHandedBehaviour()

bool Entity::IsTwoHandedBehaviour ( )
inlineprotected

returns item behaviour of item (more in ItemBase)

Definition at line 2845 of file EntityAI.c.

2846 {
2847 return false;
2848 }

◆ IsUniversalTemperatureSource()

bool Entity::IsUniversalTemperatureSource ( )
inlineprotected

Universal Temperature Sources Helpers.

Definition at line 3105 of file EntityAI.c.

3106 {
3108 }
UTemperatureSource GetUniversalTemperatureSource()
Definition EntityAI.c:3110

◆ IsValveTurnable()

bool Entity::IsValveTurnable ( int pValveIndex)
protected

◆ IsVisibleDuringDaylight()

proto native bool Entity::IsVisibleDuringDaylight ( )
private

◆ IsZombie()

bool Entity::IsZombie ( )
inlineprotected

Definition at line 588 of file EntityAI.c.

589 {
590 return false;
591 }

◆ IsZombieMilitary()

bool Entity::IsZombieMilitary ( )
inlineprotected

Definition at line 593 of file EntityAI.c.

594 {
595 return false;
596 }

◆ KeepHealthOnReplace()

bool Entity::KeepHealthOnReplace ( )
inlineprotected

Definition at line 907 of file EntityAI.c.

908 {
909 return false;
910 }

◆ LocalDropEntity()

bool Entity::LocalDropEntity ( notnull EntityAI item)
inlineprotected

Definition at line 1812 of file EntityAI.c.

1813 {
1814 return false;
1815 }

◆ LocalTakeEntityAsAttachment()

bool Entity::LocalTakeEntityAsAttachment ( notnull EntityAI item)
inlineprotected

Definition at line 1798 of file EntityAI.c.

1799 {
1800 return GetInventory().TakeEntityAsAttachment(InventoryMode.LOCAL, item);
1801 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22

◆ LocalTakeEntityAsAttachmentEx()

bool Entity::LocalTakeEntityAsAttachmentEx ( notnull EntityAI item,
int slot )
inlineprotected

Definition at line 1731 of file EntityAI.c.

1732 {
1733 return GetInventory().TakeEntityAsAttachmentEx(InventoryMode.LOCAL, item, slot);
1734 }

◆ LocalTakeEntityToCargo()

bool Entity::LocalTakeEntityToCargo ( notnull EntityAI item)
inlineprotected

Definition at line 1667 of file EntityAI.c.

1668 {
1669 return GetInventory().TakeEntityToCargo(InventoryMode.LOCAL, item);
1670 }

◆ LocalTakeEntityToCargoEx()

bool Entity::LocalTakeEntityToCargoEx ( notnull EntityAI item,
int idx,
int row,
int col )
inlineprotected

Definition at line 1701 of file EntityAI.c.

1702 {
1703 return GetInventory().TakeEntityToCargoEx(InventoryMode.LOCAL, item, idx, row, col);
1704 }

◆ LocalTakeEntityToInventory()

bool Entity::LocalTakeEntityToInventory ( FindInventoryLocationType flags,
notnull EntityAI item )
inlineprotected

Definition at line 1634 of file EntityAI.c.

1635 {
1636 return GetInventory().TakeEntityToInventory(InventoryMode.LOCAL, flags, item);
1637 }

◆ LocalTakeEntityToTargetAttachment()

bool Entity::LocalTakeEntityToTargetAttachment ( notnull EntityAI target,
notnull EntityAI item )
inlineprotected

Definition at line 1763 of file EntityAI.c.

1764 {
1765 return GetInventory().TakeEntityAsTargetAttachment(InventoryMode.LOCAL, target, item);
1766 }

◆ LocalTakeEntityToTargetAttachmentEx()

bool Entity::LocalTakeEntityToTargetAttachmentEx ( notnull EntityAI target,
notnull EntityAI item,
int slot )
inlineprotected

Definition at line 1747 of file EntityAI.c.

1748 {
1749 return GetInventory().TakeEntityAsTargetAttachmentEx(InventoryMode.LOCAL, target, item, slot);
1750 }

◆ LocalTakeEntityToTargetCargo()

bool Entity::LocalTakeEntityToTargetCargo ( notnull EntityAI target,
notnull EntityAI item )
inlineprotected

Definition at line 1683 of file EntityAI.c.

1684 {
1685 return GetInventory().TakeEntityToTargetCargo(InventoryMode.LOCAL, target, item);
1686 }

◆ LocalTakeEntityToTargetCargoEx()

bool Entity::LocalTakeEntityToTargetCargoEx ( notnull CargoBase cargo,
notnull EntityAI item,
int row,
int col )
inlineprotected

Definition at line 1713 of file EntityAI.c.

1714 {
1715 return GetInventory().TakeEntityToTargetCargoEx(InventoryMode.LOCAL, cargo, item, row, col);
1716 }

◆ LocalTakeEntityToTargetInventory()

bool Entity::LocalTakeEntityToTargetInventory ( notnull EntityAI target,
FindInventoryLocationType flags,
notnull EntityAI item )
inlineprotected

Definition at line 1649 of file EntityAI.c.

1650 {
1651 return GetInventory().TakeEntityToTargetInventory(InventoryMode.LOCAL, target, flags, item);
1652 }

◆ LocalTakeToDst()

bool Entity::LocalTakeToDst ( notnull InventoryLocation src,
notnull InventoryLocation dst )
inlineprotected

Definition at line 1779 of file EntityAI.c.

1780 {
1781 return GetInventory().TakeToDst(InventoryMode.LOCAL, src, dst);
1782 }

◆ Log()

void Entity::Log ( string msg,
string fnc_name = "n/a" )
inlineprotected

Log.

Definition at line 377 of file EntityAI.c.

378 {
379 Debug.Log(msg, "Object", "n/a", fnc_name, this.GetType());
380 }
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:133

References GetType(), and Debug::Log().

◆ LogError()

void Entity::LogError ( string msg,
string fnc_name = "n/a" )
inlineprotected

LogError.

Definition at line 389 of file EntityAI.c.

390 {
391 Debug.LogError(msg, "Object", "n/a", fnc_name, this.GetType());
392 }

References GetType(), and Debug::LogError().

◆ LogWarning()

void Entity::LogWarning ( string msg,
string fnc_name = "n/a" )
inlineprotected

LogWarning.

Definition at line 383 of file EntityAI.c.

384 {
385 Debug.LogWarning(msg, "Object", "n/a", fnc_name, this.GetType());
386 }

References GetType(), and Debug::LogWarning().

◆ LookAt()

proto native void Entity::LookAt ( vector targetPos)
private

Orientation change by lookAt point.

Parameters
targetPoswhere to look at

◆ MaxLifetimeRefreshCalc()

void Entity::MaxLifetimeRefreshCalc ( )
inlineprivate

Calculates if the max lifetime is higher than refresher frequency (i.e. gets kept alive by refresher)

Definition at line 269 of file EntityAI.c.

270 {
271 if ((!GetGame().IsMultiplayer() || GetGame().IsServer()) && GetEconomyProfile())
272 {
273 float lifetime = GetEconomyProfile().GetLifetime();
274 int frequency = GetCEApi().GetCEGlobalInt("FlagRefreshFrequency");
275 if (frequency <= 0)
277
278 if (frequency <= lifetime)
279 {
280 m_RefresherViable = true;
282 }
283 }
284 }
proto native CEApi GetCEApi()
Get the CE API.
proto native void SetSynchDirty()
Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take ef...
const int REFRESHER_FREQUENCY_DEFAULT
Definition constants.c:880

References GetCEApi(), GetGame(), and GameConstants::REFRESHER_FREQUENCY_DEFAULT.

◆ OnAction()

bool Entity::OnAction ( int action_id,
Man player,
ParamsReadContext ctx )
inlineprotected

Definition at line 2669 of file EntityAI.c.

2670 {
2671 if (action_id == EActions.FIX_ENTITY)
2672 {
2673#ifdef DIAG_DEVELOPER
2674 FixEntity();
2675#endif
2676 }
2677 else if (action_id == EActions.GET_TOTAL_WEIGHT) //Prints total weight of item + its contents
2678 {
2679 WeightDebug.ClearWeightDebug();
2680#ifndef SERVER
2681 Debug.Log("======================== " + GetType() + " =================================");
2682#endif
2683 Debug.Log("Weight:" + GetWeightEx().ToString());
2684 Debug.Log("Weight excluding cargo and attachments:" + GetSingleInventoryItemWeightEx());
2685 Debug.Log("----------------------------------------------------------------------------------------------");
2686 }
2687 else if (action_id == EActions.GET_TOTAL_WEIGHT_RECALC) //Prints total weight of item + its contents
2688 {
2689 WeightDebug.ClearWeightDebug();
2690 WeightDebug.SetVerbosityFlags(WeightDebugType.RECALC_FORCED);
2691#ifndef SERVER
2692 Debug.Log("======================== " + GetType() + " RECALC ===========================");
2693#endif
2694 Debug.Log("Weight:" + GetWeightEx(true).ToString());
2695 Debug.Log("Weight excluding cargo and attachments:" + GetSingleInventoryItemWeightEx());
2696 WeightDebug.PrintAll(this);
2697 Debug.Log("----------------------------------------------------------------------------------------------");
2698 WeightDebug.SetVerbosityFlags(0);
2699 }
2700 else if (action_id == EActions.GET_PLAYER_WEIGHT) //Prints total weight of item + its contents
2701 {
2702 WeightDebug.ClearWeightDebug();
2703#ifndef SERVER
2704 Debug.Log("======================== PLAYER: " + player + " ===========================");
2705#endif
2706 Debug.Log("New overall weight Player:" + player.GetWeightEx().ToString());
2707
2708 Debug.Log("----------------------------------------------------------------------------------------------");
2709 }
2710 else if (action_id == EActions.GET_PLAYER_WEIGHT_RECALC) //Prints total weight of item + its contents
2711 {
2712 WeightDebug.ClearWeightDebug();
2713 WeightDebug.SetVerbosityFlags(WeightDebugType.RECALC_FORCED);
2714#ifndef SERVER
2715 Debug.Log("======================== PLAYER RECALC: " + player + " ===========================");
2716#endif
2717 Debug.Log("New overall weight Player:" + player.GetWeightEx(true).ToString());
2718 WeightDebug.PrintAll(player);
2719 Debug.Log("----------------------------------------------------------------------------------------------");
2720 WeightDebug.SetVerbosityFlags(0);
2721 }
2722 return false;
2723 }
proto string ToString()
float GetSingleInventoryItemWeightEx()
Definition EntityAI.c:2656

References GetSingleInventoryItemWeightEx(), GetType(), Debug::Log(), and ToString().

◆ OnAttachmentRuined()

void Entity::OnAttachmentRuined ( EntityAI attachment)
inlineprotected

Called when some attachment of this parent is ruined. Called on server and client side.

Definition at line 922 of file EntityAI.c.

923 {
924 // ...
925 }

◆ OnBeforeTryDelete()

void Entity::OnBeforeTryDelete ( )
protected

◆ OnBinLoadItemsDropped()

void Entity::OnBinLoadItemsDropped ( )
inlineprotected

Called when an item fails to get loaded into the inventory of an entity and gets dropped.

Definition at line 1188 of file EntityAI.c.

1189 {
1191 GetHierarchyRootPlayer().SetProcessUIWarning(true);
1192 }

◆ OnCargoChanged()

void Entity::OnCargoChanged ( )
inlineprotected

Definition at line 1577 of file EntityAI.c.

1577{ }

◆ OnCEUpdate()

void Entity::OnCEUpdate ( )
inlineprotected

Central economy calls this function whenever going over all the entities.

void OnCEUpdate()
{
// dont forget to propagate this call trough class hierarchy! - always at the start of the function
super.OnCEUpdate();
// use m_ElapsedSinceLastUpdate for time-related purposes
}
void OnCEUpdate()
Central economy calls this function whenever going over all the entities.
Definition EntityAI.c:2865

Definition at line 2865 of file EntityAI.c.

2866 {
2867 float currentTime = GetGame().GetTickTime();
2868 if (m_LastUpdatedTime == 0)
2870
2873 }

References GetGame().

◆ OnDamageDestroyed()

void Entity::OnDamageDestroyed ( int oldLevel)
protected

Called when the health gets to the min value, 'oldLevel' is previous health level, 'oldLevel' -1 means this entity was just spawned.

◆ OnDebugButtonPressClient()

void Entity::OnDebugButtonPressClient ( int button_index)
inlineprotected

Definition at line 2350 of file EntityAI.c.

2350{} //DEPRICATED, USE GetDebugActions / OnAction

◆ OnDebugButtonPressServer()

void Entity::OnDebugButtonPressServer ( int button_index)
inlineprotected

Definition at line 2351 of file EntityAI.c.

2351{} //DEPRICATED, USE GetDebugActions / OnAction

◆ OnDebugSpawn()

void Entity::OnDebugSpawn ( )
inlineprotected

Definition at line 2880 of file EntityAI.c.

2881 {
2883 ConfigGetTextArray("Attachments", slots);
2884
2886 ConfigGetTextArray("magazines", mags);
2887
2888 //-------
2889
2891
2894 all_paths.Insert(CFG_WEAPONSPATH);
2895
2896 string config_path;
2897 string child_name;
2898 int scope;
2899 string path;
2900 int consumable_count;
2901
2902 for (int i = 0; i < all_paths.Count(); i++)
2903 {
2904 config_path = all_paths.Get(i);
2905 int children_count = GetGame().ConfigGetChildrenCount(config_path);
2906
2907 for (int x = 0; x < children_count; x++)
2908 {
2909 GetGame().ConfigGetChildName(config_path, x, child_name);
2910 path = config_path + " " + child_name;
2911 scope = GetGame().ConfigGetInt(config_path + " " + child_name + " scope");
2912 bool should_check = 1;
2913 if (config_path == "CfgVehicles" && scope == 0)
2914 should_check = 0;
2915
2916 if (should_check)
2917 {
2918 string inv_slot;
2919 GetGame().ConfigGetText(config_path + " " + child_name + " inventorySlot", inv_slot);
2920 for (int z = 0; z < slots.Count(); z++)
2921 {
2922 if (slots.Get(z) == inv_slot)
2923 {
2924 this.GetInventory().CreateInInventory(child_name);
2925 continue;
2926 //Print("matching attachment: " + child_name + " for inv. slot name:" +inv_slot);
2927 }
2928 }
2929 }
2930 }
2931 }
2932 };
Icon x

References CFG_MAGAZINESPATH, CFG_VEHICLESPATH, CFG_WEAPONSPATH, GetGame(), path, and x.

◆ OnDebugSpawnEx()

void Entity::OnDebugSpawnEx ( DebugSpawnParams params)
inlineprotected

Definition at line 2875 of file EntityAI.c.

2876 {
2877 OnDebugSpawn();
2878 }
void OnDebugSpawn()
Definition EntityAI.c:2880

References OnDebugSpawn.

◆ OnEnergyAdded()

void Entity::OnEnergyAdded ( )
inlineprotected

Energy manager event: Called when energy was added on this device. ALWAYS CALL super.OnEnergyAdded() !!!

Definition at line 2491 of file EntityAI.c.

2491{}

◆ OnEnergyConsumed()

void Entity::OnEnergyConsumed ( )
inlineprotected

Energy manager event: Called when energy was consumed on this device. ALWAYS CALL super.OnEnergyConsumed() !!!

Definition at line 2488 of file EntityAI.c.

2488{}

◆ OnExplosionEffects()

override void Entity::OnExplosionEffects ( Object source,
Object directHit,
int componentIndex,
string surface,
vector pos,
vector surfNormal,
float energyFactor,
float explosionFactor,
bool isWater,
string ammoType )
inlineprotected

Definition at line 778 of file EntityAI.c.

779 {
781#ifndef SERVER
782 g_Game.GetWorld().AddEnvShootingSource(pos, 1.0);
783#endif
784 if (m_DestructionBehaviourObj && m_DestructionBehaviourObj.HasExplosionDamage())
786 }
DayZGame g_Game
Definition DayZGame.c:3528

References g_Game.

◆ OnHologramBeingPlaced()

void Entity::OnHologramBeingPlaced ( Man player)
protected

◆ OnIgnitedTarget()

void Entity::OnIgnitedTarget ( EntityAI target_item)
inlineprotected

Executed on Server when this item ignites some target item.

Definition at line 460 of file EntityAI.c.

461 {
462
463 }

◆ OnIgnitedTargetFailed()

void Entity::OnIgnitedTargetFailed ( EntityAI target_item)
inlineprotected

Executed on Server when this item failed to ignite target item.

Definition at line 472 of file EntityAI.c.

473 {
474
475 }

◆ OnIgnitedThis()

void Entity::OnIgnitedThis ( EntityAI fire_source)
inlineprotected

Executed on Server when some item ignited this one.

Definition at line 466 of file EntityAI.c.

467 {
468
469 }

◆ OnIgnitedThisFailed()

void Entity::OnIgnitedThisFailed ( EntityAI fire_source)
inlineprotected

Executed on Server when some item failed to ignite this one.

Definition at line 478 of file EntityAI.c.

479 {
480
481 }

◆ OnInitEnergy()

void Entity::OnInitEnergy ( )
inlineprotected

Energy manager event: Object's initialization. Energy Manager is fully initialized by this point.

Definition at line 2485 of file EntityAI.c.

2485{}

◆ OnInventoryInit()

void Entity::OnInventoryInit ( )
inlineprotected

Definition at line 738 of file EntityAI.c.

739 {
741 }
void InitAttachmentExclusionValues()
Definition EntityAI.c:3150

◆ OnIsPlugged()

void Entity::OnIsPlugged ( EntityAI source_device)
inlineprotected

Energy manager event: Called when this device is plugged into some energy source.

Definition at line 2473 of file EntityAI.c.

2473{}

◆ OnIsUnplugged()

void Entity::OnIsUnplugged ( EntityAI last_energy_source)
inlineprotected

Energy manager event: Called when this device is UNPLUGGED from the energy source.

Definition at line 2476 of file EntityAI.c.

2476{}

◆ OnItemAttachmentSlotChanged()

void Entity::OnItemAttachmentSlotChanged ( notnull InventoryLocation oldLoc,
notnull InventoryLocation newLoc )
inlineprotected

Definition at line 791 of file EntityAI.c.

791{}

◆ OnItemLocationChanged()

void Entity::OnItemLocationChanged ( EntityAI old_owner,
EntityAI new_owner )
inlineprotected

Definition at line 789 of file EntityAI.c.

789{ }

◆ OnMovedInsideCargo()

void Entity::OnMovedInsideCargo ( EntityAI container)
inlineprotected

Called when this item enters cargo of some container.

Definition at line 1126 of file EntityAI.c.

1127 {
1128 if (m_EM)
1130 }
void HandleMoveInsideCargo(EntityAI container)

References ComponentEnergyManager::HandleMoveInsideCargo().

◆ OnMovedWithinCargo()

void Entity::OnMovedWithinCargo ( EntityAI container)
inlineprotected

Called when this item moves within cargo of some container.

Definition at line 1139 of file EntityAI.c.

1140 {
1141
1142 }

◆ OnOwnSocketReleased()

void Entity::OnOwnSocketReleased ( EntityAI device)
inlineprotected

Energy manager event: When something is UNPLUGGED from this device.

Definition at line 2482 of file EntityAI.c.

2482{}

◆ OnOwnSocketTaken()

void Entity::OnOwnSocketTaken ( EntityAI device)
inlineprotected

Energy manager event: When something is plugged into this device.

Definition at line 2479 of file EntityAI.c.

2479{}

◆ OnPlacementCancelled()

void Entity::OnPlacementCancelled ( Man player)
protected

◆ OnPlacementComplete()

void Entity::OnPlacementComplete ( Man player,
vector position = "0 0 0",
vector orientation = "0 0 0" )
protected

◆ OnPlacementStarted()

void Entity::OnPlacementStarted ( Man player)
protected

◆ OnRemovedFromCargo()

void Entity::OnRemovedFromCargo ( EntityAI container)
inlineprotected

Called when this item exits cargo of some container.

Definition at line 1133 of file EntityAI.c.

1134 {
1135
1136 }

◆ OnRPC()

override void Entity::OnRPC ( PlayerIdentity sender,
int rpc_type,
ParamsReadContext ctx )
inlineprotected

Definition at line 2494 of file EntityAI.c.

2495 {
2496 super.OnRPC(sender, rpc_type, ctx);
2497
2498 if (GetGame().IsClient())
2499 {
2500 switch (rpc_type)
2501 {
2502 // BODY STAGING - server => client synchronization of skinned state.
2503 case ERPCs.RPC_BS_SKINNED_STATE:
2504 {
2506 if (ctx.Read(p_skinned_state))
2507 {
2508 float state = p_skinned_state.param1;
2509 if (state && GetCompBS())
2511 }
2512 break;
2513 }
2514
2515 case ERPCs.RPC_EXPLODE_EVENT:
2516 {
2517 OnExplodeClient();
2518 break;
2519 }
2520 }
2521 }
2522 }
ERPCs
Definition ERPCs.c:2

References GetGame().

◆ OnStoreLoad()

bool Entity::OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprotected

Called when data is loaded from persistence (on server side).

void OnStoreLoad(ParamsReadContext ctx, int version)
{
// dont forget to propagate this call trough class hierarchy!
if ( !super.OnStoreLoad(ctx, version) )
return false;
// read data loaded from game database (format and order of reading must be the same as writing!)
int a;
if ( !ctx.Read(a) )
return false;
float b;
if ( !ctx.Read(b) )
return false;
return true;
}
bool OnStoreLoad(ParamsReadContext ctx, int version)
Called when data is loaded from persistence (on server side).
Definition EntityAI.c:2192
Serialization general interface. Serializer API works with:
Definition Serializer.c:56

Definition at line 2192 of file EntityAI.c.

2193 {
2194 // Restoring of energy related states
2195
2196 if (m_EM)
2197 {
2198 // Load energy amount
2199 float f_energy = 0;
2200 if (!ctx.Read(f_energy))
2201 f_energy = 0;
2203
2204 // Load passive/active state
2205 bool b_is_passive = false;
2206 if (!ctx.Read(b_is_passive))
2207 return false;
2209
2210 // Load ON/OFF state
2211 bool b_is_on = false;
2212 if (!ctx.Read(b_is_on))
2213 {
2214 m_EM.SwitchOn();
2215 return false;
2216 }
2217
2218 // Load plugged/unplugged state
2219 bool b_is_plugged = false;
2220 if (!ctx.Read(b_is_plugged))
2221 return false;
2222
2223 // ENERGY SOURCE
2224 if (version <= 103)
2225 {
2226 // Load energy source ID low
2227 int i_energy_source_ID_low = 0; // Even 0 can be valid ID!
2228 if (!ctx.Read(i_energy_source_ID_low))
2229 return false;
2230
2231 // Load energy source ID high
2232 int i_energy_source_ID_high = 0; // Even 0 can be valid ID!
2233 if (!ctx.Read(i_energy_source_ID_high))
2234 return false;
2235 }
2236 else
2237 {
2238 int b1 = 0;
2239 int b2 = 0;
2240 int b3 = 0;
2241 int b4 = 0;
2242
2243 if (!ctx.Read(b1)) return false;
2244 if (!ctx.Read(b2)) return false;
2245 if (!ctx.Read(b3)) return false;
2246 if (!ctx.Read(b4)) return false;
2247
2248 if (b_is_plugged)
2249 {
2250 // Because function GetEntityByPersitentID() cannot be called here, ID values must be stored and used later.
2252 m_EM.RestorePlugState(true);
2253 }
2254 }
2255
2256 if (b_is_on)
2257 m_EM.SwitchOn();
2258 }
2259 return true;
2260 }
void SwitchOn()
Energy manager: Switches ON the device so it starts doing its work if it has enough energy.
void SetPassiveState(bool state=true)
Energy manager: Changes the status of this device. When it's passive (true), the main timer and OnWor...
void StoreEnergySourceIDs(int b1, int b2, int b3, int b4)
void SetEnergy(float new_energy)
Energy manager: Sets stored energy for this device. It ignores the min/max limit!

References ComponentEnergyManager::RestorePlugState(), ComponentEnergyManager::SetEnergy(), ComponentEnergyManager::SetPassiveState(), ComponentEnergyManager::StoreEnergySourceIDs(), and ComponentEnergyManager::SwitchOn().

◆ OnStoreSave()

void Entity::OnStoreSave ( ParamsWriteContext ctx)
inlineprotected

Engine calls this function to collect data from entity to store for persistence (on server side).

{
// dont forget to propagate this call trough class hierarchy!
super.OnStoreSave(ctx);
// write any data (using params) you want to store
int a = 5;
float b = 6.0;
ctx.Write(a);
ctx.Write(b);
}
void OnStoreSave(ParamsWriteContext ctx)
Engine calls this function to collect data from entity to store for persistence (on server side).
Definition EntityAI.c:2133

Definition at line 2133 of file EntityAI.c.

2134 {
2135 // Saving of energy related states
2136 if (m_EM)
2137 {
2138 // Save energy amount
2139 ctx.Write(m_EM.GetEnergy());
2140
2141 // Save passive/active state
2142 ctx.Write(m_EM.IsPassive());
2143
2144 // Save ON/OFF state
2145 ctx.Write(m_EM.IsSwitchedOn());
2146
2147 // Save plugged/unplugged state
2148 ctx.Write(m_EM.IsPlugged());
2149
2150 // ENERGY SOURCE
2151 // Save energy source IDs
2153 int b1 = 0;
2154 int b2 = 0;
2155 int b3 = 0;
2156 int b4 = 0;
2157
2158 if (energy_source)
2159 energy_source.GetPersistentID(b1, b2, b3, b4);
2160
2161 ctx.Write(b1); // Save energy source block 1
2162 ctx.Write(b2); // Save energy source block 2
2163 ctx.Write(b3); // Save energy source block 3
2164 ctx.Write(b4); // Save energy source block 4
2165 }
2166 }
float GetEnergy()
Energy manager: Returns the amount of stored energy this device has.
bool IsPlugged()
Energy manager: Returns true if this device is plugged into some other device (even if they are OFF o...
EntityAI GetEnergySource()
Energy manager: Returns the energy source this device is plugged into.
bool IsPassive()
Energy manager: Returns true if this device is set to be passive. False if otherwise.
bool IsSwitchedOn()
Energy manager: Returns state of the switch. Whenever the device is working or not does not matter....

References ComponentEnergyManager::GetEnergy(), ComponentEnergyManager::GetEnergySource(), ComponentEnergyManager::IsPassive(), ComponentEnergyManager::IsPlugged(), and ComponentEnergyManager::IsSwitchedOn().

◆ OnSwitchOff()

void Entity::OnSwitchOff ( )
inlineprotected

Energy manager event: Called when the device is switched OFF.

Definition at line 2470 of file EntityAI.c.

2470{}

◆ OnSwitchOn()

void Entity::OnSwitchOn ( )
inlineprotected

Energy manager event: Called when the device is switched on.

Definition at line 2467 of file EntityAI.c.

2467{}

◆ OnVariablesSynchronized()

void Entity::OnVariablesSynchronized ( )
inlineprotected

Called on clients after receiving synchronization data from server.

Definition at line 2268 of file EntityAI.c.

2269 {
2270 if (m_EM)
2271 {
2272 if (GetGame().IsMultiplayer())
2273 {
2274 bool is_on = m_EM.IsSwitchedOn();
2275
2277 {
2278 if (is_on)
2279 m_EM.SwitchOn();
2280 else
2281 m_EM.SwitchOff();
2282 }
2283
2286
2287 EntityAI energy_source = EntityAI.Cast(GetGame().GetObjectByNetworkId(id_low, id_High));
2288
2289 if (energy_source)
2290 {
2292
2293 if (!esem)
2294 {
2295 string object = energy_source.GetType();
2296 Error("Synchronization error! Object " + object + " has no instance of the Energy Manager component!");
2297 }
2298
2300
2301 }
2302 else
2303 m_EM.UnplugThis();
2304
2307 }
2308 }
2309 }
void UnplugThis()
Energy manager: Unplugs this device from its power source.
void SwitchOff()
Energy manager: Switches OFF the device.

References ComponentEnergyManager::DeviceUpdate(), Error(), ComponentEnergyManager::GetEnergySourceNetworkIDHigh(), ComponentEnergyManager::GetEnergySourceNetworkIDLow(), GetGame(), ComponentEnergyManager::GetPreviousSwitchState(), ComponentEnergyManager::IsSwitchedOn(), ComponentEnergyManager::PlugThisInto(), ComponentEnergyManager::StartUpdates(), ComponentEnergyManager::SwitchOff(), ComponentEnergyManager::SwitchOn(), and ComponentEnergyManager::UnplugThis().

◆ OnWasAttached()

void Entity::OnWasAttached ( EntityAI parent,
int slot_id )
protected

◆ OnWasDetached()

void Entity::OnWasDetached ( EntityAI parent,
int slot_id )
inlineprotected

Definition at line 1567 of file EntityAI.c.

1568 {
1569 if (!IsFlagSet(EntityFlags.VISIBLE))
1570 {
1571 SetInvisible(false);
1572 OnInvisibleSet(false);
1573 SetInvisibleRecursive(false, parent);
1574 }
1575 }
void SetInvisibleRecursive(bool invisible, EntityAI parent=null, array< int > attachments=null)
Definition EntityAI.c:2981
EntityFlags
Entity flags.
Definition EnEntity.c:114

◆ OnWetChanged()

void Entity::OnWetChanged ( float newVal,
float oldVal )
protected

◆ OnWetLevelChanged()

void Entity::OnWetLevelChanged ( EWetnessLevel newLevel,
EWetnessLevel oldLevel )
protected

◆ OnWork()

void Entity::OnWork ( float consumed_energy)
inlineprotected

Energy manager event: Called every device update if its supposed to do some work. The update can be every second or at random, depending on its manipulation.

Definition at line 2461 of file EntityAI.c.

2461{}

◆ OnWorkStart()

void Entity::OnWorkStart ( )
inlineprotected

Energy manager event: Called only once when this device starts doing its work.

Definition at line 2458 of file EntityAI.c.

2458{}

◆ OnWorkStop()

void Entity::OnWorkStop ( )
inlineprotected

Energy manager event: Called when the device stops working (was switched OFF or ran out of energy)

Definition at line 2464 of file EntityAI.c.

2464{}

◆ PairRemote()

void Entity::PairRemote ( notnull EntityAI trigger)
protected

◆ PlacementCanBeRotated()

bool Entity::PlacementCanBeRotated ( )
inlineprotected

Should return false if you want to disable hologram rotation.

Definition at line 454 of file EntityAI.c.

455 {
456 return true;
457 }

◆ PlaceOnSurfaceRotated()

proto native void Entity::PlaceOnSurfaceRotated ( out vector trans[4],
vector pos,
float dx = 0,
float dz = 0,
float fAngle = 0,
bool align = false )
protected

◆ PredictiveDropEntity()

bool Entity::PredictiveDropEntity ( notnull EntityAI item)
inlineprotected

Definition at line 1807 of file EntityAI.c.

1808 {
1809 return false;
1810 }

◆ PredictiveTakeEntityAsAttachment()

bool Entity::PredictiveTakeEntityAsAttachment ( notnull EntityAI item)
inlineprotected

Put item into as attachment.

Definition at line 1791 of file EntityAI.c.

1792 {
1793 if (GetGame().IsMultiplayer())
1794 return GetInventory().TakeEntityAsAttachment(InventoryMode.JUNCTURE, item);
1795 else
1796 return GetInventory().TakeEntityAsAttachment(InventoryMode.PREDICTIVE, item);
1797 }

References GetGame().

◆ PredictiveTakeEntityAsAttachmentEx()

bool Entity::PredictiveTakeEntityAsAttachmentEx ( notnull EntityAI item,
int slot )
inlineprotected

Returns if item can be added as attachment on specific slot. Note that slot index IS NOT slot ID! Slot ID is defined in DZ/data/config.cpp.

Definition at line 1724 of file EntityAI.c.

1725 {
1726 if (GetGame().IsMultiplayer())
1727 return GetInventory().TakeEntityAsAttachmentEx(InventoryMode.JUNCTURE, item, slot);
1728 else
1729 return GetInventory().TakeEntityAsAttachmentEx(InventoryMode.PREDICTIVE, item, slot);
1730 }

References GetGame().

◆ PredictiveTakeEntityToCargo()

bool Entity::PredictiveTakeEntityToCargo ( notnull EntityAI item)
inlineprotected

Put item into into cargo.

Definition at line 1660 of file EntityAI.c.

1661 {
1662 if (GetGame().IsMultiplayer())
1663 return GetInventory().TakeEntityToCargo(InventoryMode.JUNCTURE, item);
1664 else
1665 return GetInventory().TakeEntityToCargo(InventoryMode.PREDICTIVE, item);
1666 }

References GetGame().

◆ PredictiveTakeEntityToCargoEx()

bool Entity::PredictiveTakeEntityToCargoEx ( notnull EntityAI item,
int idx,
int row,
int col )
inlineprotected

Put item into into cargo on specific cargo location.

Definition at line 1694 of file EntityAI.c.

1695 {
1696 if (GetGame().IsMultiplayer())
1697 return GetInventory().TakeEntityToCargoEx(InventoryMode.JUNCTURE, item, idx, row, col);
1698 else
1699 return GetInventory().TakeEntityToCargoEx(InventoryMode.PREDICTIVE, item, idx, row, col);
1700 }

References GetGame().

◆ PredictiveTakeEntityToInventory()

bool Entity::PredictiveTakeEntityToInventory ( FindInventoryLocationType flags,
notnull EntityAI item )
inlineprotected

Put item anywhere into this entity (as attachment or into cargo, recursively)

Definition at line 1627 of file EntityAI.c.

1628 {
1629 if (GetGame().IsMultiplayer())
1630 return GetInventory().TakeEntityToInventory(InventoryMode.JUNCTURE, flags, item);
1631 else
1632 return GetInventory().TakeEntityToInventory(InventoryMode.PREDICTIVE, flags, item);
1633 }

References GetGame().

◆ PredictiveTakeEntityToTargetAttachment()

bool Entity::PredictiveTakeEntityToTargetAttachment ( notnull EntityAI target,
notnull EntityAI item )
inlineprotected

Definition at line 1756 of file EntityAI.c.

1757 {
1758 if (GetGame().IsMultiplayer())
1759 return GetInventory().TakeEntityAsTargetAttachment(InventoryMode.JUNCTURE, target, item);
1760 else
1761 return GetInventory().TakeEntityAsTargetAttachment(InventoryMode.PREDICTIVE, target, item);
1762 }

References GetGame().

◆ PredictiveTakeEntityToTargetAttachmentEx()

bool Entity::PredictiveTakeEntityToTargetAttachmentEx ( notnull EntityAI target,
notnull EntityAI item,
int slot )
inlineprotected

Definition at line 1740 of file EntityAI.c.

1741 {
1742 if (GetGame().IsMultiplayer())
1743 return GetInventory().TakeEntityAsTargetAttachmentEx(InventoryMode.JUNCTURE, target, item, slot);
1744 else
1745 return GetInventory().TakeEntityAsTargetAttachmentEx(InventoryMode.PREDICTIVE, target, item, slot);
1746 }

References GetGame().

◆ PredictiveTakeEntityToTargetCargo()

bool Entity::PredictiveTakeEntityToTargetCargo ( notnull EntityAI target,
notnull EntityAI item )
inlineprotected

Definition at line 1676 of file EntityAI.c.

1677 {
1678 if (GetGame().IsMultiplayer())
1679 return GetInventory().TakeEntityToTargetCargo(InventoryMode.JUNCTURE, target, item);
1680 else
1681 return GetInventory().TakeEntityToTargetCargo(InventoryMode.PREDICTIVE, target, item);
1682 }

References GetGame().

◆ PredictiveTakeEntityToTargetCargoEx()

bool Entity::PredictiveTakeEntityToTargetCargoEx ( notnull CargoBase cargo,
notnull EntityAI item,
int row,
int col )
inlineprotected

Definition at line 1706 of file EntityAI.c.

1707 {
1708 if (GetGame().IsMultiplayer())
1709 return GetInventory().TakeEntityToTargetCargoEx(InventoryMode.JUNCTURE, cargo, item, row, col);
1710 else
1711 return GetInventory().TakeEntityToTargetCargoEx(InventoryMode.PREDICTIVE, cargo, item, row, col);
1712 }

References GetGame().

◆ PredictiveTakeEntityToTargetInventory()

bool Entity::PredictiveTakeEntityToTargetInventory ( notnull EntityAI target,
FindInventoryLocationType flags,
notnull EntityAI item )
inlineprotected

Definition at line 1642 of file EntityAI.c.

1643 {
1644 if (GetGame().IsMultiplayer())
1645 return GetInventory().TakeEntityToTargetInventory(InventoryMode.JUNCTURE, target, flags, item);
1646 else
1647 return GetInventory().TakeEntityToTargetInventory(InventoryMode.PREDICTIVE, target, flags, item);
1648 }

References GetGame().

◆ PredictiveTakeToDst()

bool Entity::PredictiveTakeToDst ( notnull InventoryLocation src,
notnull InventoryLocation dst )
inlineprotected

Definition at line 1772 of file EntityAI.c.

1773 {
1774 if (GetGame().IsMultiplayer())
1775 return GetInventory().TakeToDst(InventoryMode.JUNCTURE, src, dst);
1776 else
1777 return GetInventory().TakeToDst(InventoryMode.PREDICTIVE, src, dst);
1778 }

References GetGame().

◆ ProcessInvulnerabilityCheck()

void Entity::ProcessInvulnerabilityCheck ( string servercfg_param)
inlineprotected

Definition at line 2952 of file EntityAI.c.

2953 {
2954 if (GetGame() && GetGame().IsMultiplayer() && GetGame().IsServer())
2955 {
2956 int invulnerability;
2957 switch (servercfg_param)
2958 {
2959 case "disableContainerDamage":
2961 break;
2962
2963 case "disableBaseDamage":
2965 break;
2966 }
2967
2968 if (invulnerability > 0)
2969 SetAllowDamage(false);
2970 }
2971 }
static bool GetDisableBaseDamage()
static bool GetDisableContainerDamage()

References CfgGameplayHandler::GetDisableBaseDamage(), CfgGameplayHandler::GetDisableContainerDamage(), and GetGame().

◆ ProcessMeleeItemDamage()

override EntityAI Entity::ProcessMeleeItemDamage ( int mode = 0)
inlineprotected

Definition at line 2934 of file EntityAI.c.

2935 {
2936 if (GetGame().IsServer())
2937 AddHealth("", "Health", -MELEE_ITEM_DAMAGE);
2938 return this;
2939 }
const float MELEE_ITEM_DAMAGE
Definition constants.c:599

References GetGame(), and MELEE_ITEM_DAMAGE.

◆ PropagateExclusionValueRecursive()

void Entity::PropagateExclusionValueRecursive ( set< int > values,
int slotId )
inlineprivate

Definition at line 3376 of file EntityAI.c.

3377 {
3378 if (values && values.Count() != 0)
3379 {
3382 GetInventory().GetCurrentInventoryLocation(lcn);
3384 {
3386 EntityAI parent = GetHierarchyParent();
3387 if (parent)
3388 parent.PropagateExclusionValueRecursive(passThis, lcn.GetSlot());
3389 }
3390 }
3391 }

◆ RegisterNetSyncVariableBool()

Entity::RegisterNetSyncVariableBool ( string variableName)
protected

registers bool variable synchronized over network

Parameters
[in]variableNamewhich variable should be synchronized

◆ RegisterNetSyncVariableBoolSignal()

Entity::RegisterNetSyncVariableBoolSignal ( string variableName)
protected

when bool variable is true, it's sent to clients and become false again

Parameters
[in]variableNamewhich variable should be synchronized

◆ RegisterNetSyncVariableFloat()

Entity::RegisterNetSyncVariableFloat ( string variableName,
float minValue = 0,
float maxValue = 0,
int precision = 1 )
protected

registers float variable synchronized over network

Parameters
[in]variableNamewhich variable should be synchronized
[in]minValueminimal value used for quantization (when minValue == maxValue, no quatization is done)
[in]maxValuemaximal value used for quantization (when minValue == maxValue, no quatization is done)
[in]precisionprecision in number of digits after decimal point

◆ RegisterNetSyncVariableInt()

Entity::RegisterNetSyncVariableInt ( string variableName,
int minValue = 0,
int maxValue = 0 )
protected

registers int variable synchronized over network

Parameters
[in]variableNamewhich variable should be synchronized
[in]minValueminimal value used for quantization (when minValue == maxValue, no quatization is done)
[in]maxValuemaximal value used for quantization (when minValue == maxValue, no quatization is done)

◆ RegisterNetSyncVariableObject()

Entity::RegisterNetSyncVariableObject ( string variableName)
protected

registers object variable synchronized over network, only synchronizes if network id is assigned. Doesn't handle object despawn on client

Parameters
[in]variableNamewhich variable should be synchronized

◆ RegisterTransportHit()

void Entity::RegisterTransportHit ( Transport transport)
inlineprotected

Definition at line 3042 of file EntityAI.c.

3043 {
3045 {
3048 Car car;
3049 float damage;
3051
3052 // a different attempt to solve hits from "standing" car to the players
3053 if (Car.CastTo(car, transport))
3054 {
3055 if (car.GetSpeedometerAbsolute() > 2)
3056 {
3058 ProcessDirectDamage(DT_CUSTOM, transport, "", "TransportHit", "0 0 0", damage);
3059 }
3060 else
3062
3063 // compute impulse and apply only if the body dies
3064 if (IsDamageDestroyed() && car.GetSpeedometerAbsolute() > 3)
3065 {
3067 impulse[1] = 40 * 1.5;
3069 }
3070 }
3071 else //old solution just in case if somebody use it
3072 {
3073 // avoid damage because of small movements
3074 if (m_TransportHitVelocity.Length() > 0.1)
3075 {
3077 ProcessDirectDamage(DT_CUSTOM, transport, "", "TransportHit", "0 0 0", damage);
3078 }
3079 else
3081
3082 // compute impulse and apply only if the body dies
3084 {
3086 impulse[1] = 40 * 1.5;
3088 }
3089 }
3090 }
3091 }
bool m_TransportHitRegistered
Definition EntityAI.c:136
vector m_TransportHitVelocity
Definition EntityAI.c:137
proto native float Length()
Returns length of vector (magnitude)
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto void dBodyApplyImpulse(notnull IEntity body, vector impulse)
Applies impuls on a rigidbody (origin)

References dBodyApplyImpulse(), GetVelocity(), IsDamageDestroyed(), and vector::Length().

◆ RemoveAgent()

void Entity::RemoveAgent ( int agent_id)
protected

◆ RemoveAllAgents()

void Entity::RemoveAllAgents ( )
protected

◆ RemoveAllAgentsExcept()

void Entity::RemoveAllAgentsExcept ( int agent_to_keep)
protected

◆ ReplaceOnDeath()

bool Entity::ReplaceOnDeath ( )
inlineprotected

Definition at line 897 of file EntityAI.c.

898 {
899 return false;
900 }

◆ ServerDropEntity()

bool Entity::ServerDropEntity ( notnull EntityAI item)
inlineprotected

Definition at line 1817 of file EntityAI.c.

1818 {
1819 return false;
1820 }

◆ ServerTakeEntityAsAttachment()

bool Entity::ServerTakeEntityAsAttachment ( notnull EntityAI item)
inlineprotected

Definition at line 1802 of file EntityAI.c.

1803 {
1804 return GetInventory().TakeEntityAsAttachment(InventoryMode.SERVER, item);
1805 }

◆ ServerTakeEntityAsAttachmentEx()

bool Entity::ServerTakeEntityAsAttachmentEx ( notnull EntityAI item,
int slot )
inlineprotected

Definition at line 1735 of file EntityAI.c.

1736 {
1737 return GetInventory().TakeEntityAsAttachmentEx(InventoryMode.SERVER, item, slot);
1738 }

◆ ServerTakeEntityToCargo()

bool Entity::ServerTakeEntityToCargo ( notnull EntityAI item)
inlineprotected

Definition at line 1671 of file EntityAI.c.

1672 {
1673 return GetInventory().TakeEntityToCargo(InventoryMode.SERVER, item);
1674 }

◆ ServerTakeEntityToInventory()

bool Entity::ServerTakeEntityToInventory ( FindInventoryLocationType flags,
notnull EntityAI item )
inlineprotected

Definition at line 1638 of file EntityAI.c.

1639 {
1640 return GetInventory().TakeEntityToInventory(InventoryMode.SERVER, flags, item);
1641 }

◆ ServerTakeEntityToTargetAttachment()

bool Entity::ServerTakeEntityToTargetAttachment ( notnull EntityAI target,
notnull EntityAI item )
inlineprotected

Definition at line 1767 of file EntityAI.c.

1768 {
1769 return GetInventory().TakeEntityAsTargetAttachment(InventoryMode.SERVER, target, item);
1770 }

◆ ServerTakeEntityToTargetAttachmentEx()

bool Entity::ServerTakeEntityToTargetAttachmentEx ( notnull EntityAI target,
notnull EntityAI item,
int slot )
inlineprotected

Definition at line 1751 of file EntityAI.c.

1752 {
1753 return GetInventory().TakeEntityAsTargetAttachmentEx(InventoryMode.SERVER, target, item, slot);
1754 }

◆ ServerTakeEntityToTargetCargo()

bool Entity::ServerTakeEntityToTargetCargo ( notnull EntityAI target,
notnull EntityAI item )
inlineprotected

Definition at line 1687 of file EntityAI.c.

1688 {
1689 return GetInventory().TakeEntityToTargetCargo(InventoryMode.SERVER, target, item);
1690 }

◆ ServerTakeEntityToTargetCargoEx()

bool Entity::ServerTakeEntityToTargetCargoEx ( notnull CargoBase cargo,
notnull EntityAI item,
int row,
int col )
inlineprotected

Definition at line 1717 of file EntityAI.c.

1718 {
1719 return GetInventory().TakeEntityToTargetCargoEx(InventoryMode.SERVER, cargo, item, row, col);
1720 }

◆ ServerTakeEntityToTargetInventory()

bool Entity::ServerTakeEntityToTargetInventory ( notnull EntityAI target,
FindInventoryLocationType flags,
notnull EntityAI item )
inlineprotected

Definition at line 1653 of file EntityAI.c.

1654 {
1655 return GetInventory().TakeEntityToTargetInventory(InventoryMode.SERVER, target, flags, item);
1656 }

◆ ServerTakeToDst()

bool Entity::ServerTakeToDst ( notnull InventoryLocation src,
notnull InventoryLocation dst )
inlineprotected

Definition at line 1783 of file EntityAI.c.

1784 {
1785 return GetInventory().TakeToDst(InventoryMode.SERVER, src, dst);
1786 }

◆ SetActive()

proto native void Entity::SetActive ( bool active)
private

Sets this camera as active.

◆ SetAITargetCallbacks()

proto native void Entity::SetAITargetCallbacks ( AbstractAITargetCallbacks callbacks)
protected

◆ SetAmbientAlpha()

proto native void Entity::SetAmbientAlpha ( float pAlpha)
private

◆ SetAmbientColor()

proto native void Entity::SetAmbientColor ( float pRed,
float pGreen,
float pBlue )
private

◆ SetAmbientColorV()

proto native void Entity::SetAmbientColorV ( vector pColorVector)
private

◆ SetAsSkinned()

void Entity::SetAsSkinned ( )
inlineprotected

Definition at line 400 of file EntityAI.c.

401 {
402 if (GetCompBS())
404 }

◆ SetAttachmentExclusionMaskGlobal()

void Entity::SetAttachmentExclusionMaskGlobal ( set< int > values)
inlineprotected

Definition at line 3361 of file EntityAI.c.

◆ SetAttachmentExclusionMaskSlot()

void Entity::SetAttachmentExclusionMaskSlot ( int slotId,
set< int > values )
inlineprotected

sets values for specific slot

Definition at line 3368 of file EntityAI.c.

3369 {
3372 else
3373 ErrorEx("m_AttachmentExclusionSlotMap not available! Fill the 'inventorySlot[]' in the " + this + " config file.");
3374 }

References ErrorEx.

◆ SetBayonetAttached()

void Entity::SetBayonetAttached ( bool pState,
int slot_idx = -1 )
inlineprotected

Definition at line 2973 of file EntityAI.c.

2973{};

◆ SetBrightness()

proto native void Entity::SetBrightness ( float pValue)
private

◆ SetButtstockAttached()

void Entity::SetButtstockAttached ( bool pState,
int slot_idx = -1 )
inlineprotected

Definition at line 2977 of file EntityAI.c.

2977{};

◆ SetCastShadow()

proto native void Entity::SetCastShadow ( bool pState)
private

◆ SetDiffuseAlpha()

proto native void Entity::SetDiffuseAlpha ( float pAlpha)
private

◆ SetDiffuseColor()

proto native void Entity::SetDiffuseColor ( float pRed,
float pGreen,
float pBlue )
private

◆ SetDiffuseColorV()

proto native void Entity::SetDiffuseColorV ( vector pColorVector)
private

◆ SetEnabled()

proto native void Entity::SetEnabled ( bool pState)
private

◆ SetFlareRelPosition()

proto native void Entity::SetFlareRelPosition ( vector pPosition)
private

◆ SetFlareVisible()

proto native void Entity::SetFlareVisible ( bool pState)
private

◆ SetFocus()

proto native void Entity::SetFocus ( float distance,
float blur )
private

Depth of Field settings.

Parameters
distanceDOF distance parameter
blurDOF blur parameter

◆ SetFOV()

proto native void Entity::SetFOV ( float fov)
private

Field of View settings.

Parameters
fovFOV angle in radians

◆ SetFromProjectile()

void Entity::SetFromProjectile ( ProjectileStoppedInfo info)
inlineprotected

Definition at line 3560 of file EntityAI.c.

3561 {
3562 }

◆ SetHeatHazePower()

proto native void Entity::SetHeatHazePower ( float pValue)
private

◆ SetHeatHazeRadius()

proto native void Entity::SetHeatHazeRadius ( float pValue)
private

◆ SetInvisibleRecursive()

void Entity::SetInvisibleRecursive ( bool invisible,
EntityAI parent = null,
array< int > attachments = null )
inlineprotected

Definition at line 2981 of file EntityAI.c.

2982 {
2985 if (attachments)
2987 else
2988 {
2989 for (int i = 0; i < GetInventory().GetAttachmentSlotsCount(); i++)
2990 attachmentsArray.Insert(GetInventory().GetAttachmentSlotId(i));
2991 }
2992
2993 EntityAI item;
2994
2995 foreach (int slot : attachmentsArray)
2996 {
2997 if (parent)
2998 item = parent.GetInventory().FindAttachment(slot);
2999 else
3000 item = this;//GetInventory().FindAttachment(slot);
3001
3002 if (item)
3003 {
3004 if (item.GetInventory().AttachmentCount() > 0)
3005 {
3006 for (i = 0; i < item.GetInventory().GetAttachmentSlotsCount(); i++)
3007 childrenAtt.Insert(item.GetInventory().GetAttachmentSlotId(i));
3008
3010 }
3011
3012 item.SetInvisible(invisible);
3013 item.OnInvisibleSet(invisible);
3014 }
3015 }
3016 }

◆ SetLifetime()

proto native void Entity::SetLifetime ( float fLifeTime)
protected

Set (override) remaining economy lifetime (seconds)

◆ SetLifetimeMax()

proto native void Entity::SetLifetimeMax ( float fLifeTime)
protected

Set (override) max economy lifetime per entity instance (seconds)

◆ SetLightType()

proto native void Entity::SetLightType ( int pType)
private

◆ SetNearPlane()

proto native void Entity::SetNearPlane ( float nearPlane)
private

set near plane of camera

Parameters
nearPlaneclamped internally to 0.01m

◆ SetObjectMaterial()

proto native void Entity::SetObjectMaterial ( int index,
string mat_name )
protected

Change material in hiddenSelections.

◆ SetObjectTexture()

proto native void Entity::SetObjectTexture ( int index,
string texture_name )
protected

Change texture in hiddenSelections.

◆ SetPersistentPairID()

void Entity::SetPersistentPairID ( int id)
inlineprotected

Definition at line 3134 of file EntityAI.c.

3135 {
3137 if (raib)
3138 raib.SetPersistentPairID(id);
3139 }
RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
Remotely controlled devices helpers.

References GetRemotelyActivatedItemBehaviour().

◆ SetPilotLight()

proto native void Entity::SetPilotLight ( bool isOn)
protected

◆ SetPrepareToDelete()

void Entity::SetPrepareToDelete ( )
inlineprotected

Definition at line 670 of file EntityAI.c.

671 {
672 m_PreparedToDelete = true;
673 }

◆ SetPulseCoef()

proto native void Entity::SetPulseCoef ( float pState)
private

◆ SetQuantityToMinimum()

void Entity::SetQuantityToMinimum ( )
protected

◆ SetRadius()

proto native void Entity::SetRadius ( float pValue)
private

◆ SetSimpleHiddenSelectionState()

proto native void Entity::SetSimpleHiddenSelectionState ( int index,
bool state )
protected

Simple hidden selection state; 0 == hidden.

◆ SetSpotLightAngle()

proto native void Entity::SetSpotLightAngle ( float pValue)
private

◆ SetSynchDirty()

proto native void Entity::SetSynchDirty ( )
protected

Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take effect only in MP on server side)

◆ SetTakeable()

void Entity::SetTakeable ( bool pState)
protected

◆ SetTemperature()

void Entity::SetTemperature ( float value,
bool allow_client = false )
inlineprotected

Definition at line 1972 of file EntityAI.c.

1972{};

◆ SetTemperatureMax()

void Entity::SetTemperatureMax ( )
inlineprotected

Definition at line 1974 of file EntityAI.c.

1974{};

◆ SetUniversalTemperatureSource()

void Entity::SetUniversalTemperatureSource ( UTemperatureSource uts)
inlineprotected

Definition at line 3115 of file EntityAI.c.

3116 {
3118 }

◆ SetViewIndex()

void Entity::SetViewIndex ( int index)
inlineprotected

Sets item preview index.

Definition at line 2731 of file EntityAI.c.

2732 {
2734
2735 if (GetGame().IsServer())
2736 SetSynchDirty();
2737 }
int m_ViewIndex
Definition EntityAI.c:2728

References GetGame().

◆ SetVisibleDuringDaylight()

proto native void Entity::SetVisibleDuringDaylight ( bool pState)
private

◆ SetWeightDirty()

void Entity::SetWeightDirty ( )
inlineprotected

Definition at line 2584 of file EntityAI.c.

2585 {
2586#ifdef DEVELOPER
2587 if (WeightDebug.m_VerbosityFlags & WeightDebugType.SET_DIRTY_FLAG)
2588 {
2589 Print("---------------------------------------");
2590 Print("ent:" + this + " - SetWeightDirty");
2591 if (WeightDebug.m_VerbosityFlags & WeightDebugType.DUMP_STACK)
2592 DumpStack();
2593 Print("---------------------------------------");
2594 }
2595#endif
2596 m_WeightDirty = 1;
2597 if (GetHierarchyParent())
2598 GetHierarchyParent().SetWeightDirty();
2599 }

References DumpStack(), and Print().

◆ SetWet()

void Entity::SetWet ( float value,
bool allow_client = false )
protected

◆ SetWetMax()

void Entity::SetWetMax ( )
protected

◆ ShowAllSelections()

void Entity::ShowAllSelections ( )
inlineprotected

Sets all animation values to 0, making them VISIBLE if they are configured in models.cfg in such way. These selections must also be defined in the entity's config class in 'AnimationSources'.

Definition at line 1213 of file EntityAI.c.

1214 {
1215 string cfg_path = "cfgVehicles " + GetType() + " AnimationSources";
1216
1217 if (GetGame().ConfigIsExisting(cfg_path))
1218 {
1219 int selections = GetGame().ConfigGetChildrenCount(cfg_path);
1220
1221 for (int i = 0; i < selections; i++)
1222 {
1223 string selection_name;
1224 GetGame().ConfigGetChildName(cfg_path, i, selection_name);
1226 }
1227 }
1228 }
void ShowSelection(string selection_name)
Shows selection of the given name. Must be configed in config.hpp and models.cfg.
Definition EntityAI.c:2394

References GetGame(), and GetType().

◆ ShowSelection()

void Entity::ShowSelection ( string selection_name)
inlineprotected

Shows selection of the given name. Must be configed in config.hpp and models.cfg.

Definition at line 2394 of file EntityAI.c.

2395 {
2396 if (!ToDelete())
2397 {
2398 SetAnimationPhase(selection_name, 0); // 1 = hide, 0 = unhide!
2399 }
2400 }

◆ SoundHardBushFallingPlay()

void Entity::SoundHardBushFallingPlay ( )
inlineprotected

Definition at line 3030 of file EntityAI.c.

3031 {
3032 EffectSound sound = SEffectManager.PlaySound("hardBushFall_SoundSet", GetPosition());
3033 sound.SetAutodestroy(true);
3034 }
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.

References GetPosition, and SEffectManager::PlaySound().

◆ SoundHardTreeFallingPlay()

void Entity::SoundHardTreeFallingPlay ( )
inlineprotected

Definition at line 3018 of file EntityAI.c.

3019 {
3020 EffectSound sound = SEffectManager.PlaySound("hardTreeFall_SoundSet", GetPosition());
3021 sound.SetAutodestroy(true);
3022 }

References GetPosition, and SEffectManager::PlaySound().

◆ SoundSoftBushFallingPlay()

void Entity::SoundSoftBushFallingPlay ( )
inlineprotected

Definition at line 3036 of file EntityAI.c.

3037 {
3038 EffectSound sound = SEffectManager.PlaySound("softBushFall_SoundSet", GetPosition());
3039 sound.SetAutodestroy(true);
3040 }

References GetPosition, and SEffectManager::PlaySound().

◆ SoundSoftTreeFallingPlay()

void Entity::SoundSoftTreeFallingPlay ( )
inlineprotected

Definition at line 3024 of file EntityAI.c.

3025 {
3026 EffectSound sound = SEffectManager.PlaySound("softTreeFall_SoundSet", GetPosition());
3027 sound.SetAutodestroy(true);
3028 }

References GetPosition, and SEffectManager::PlaySound().

◆ SpawnEntityOnGround()

EntityAI Entity::SpawnEntityOnGround ( string object_name,
vector mat[4] )
inlineprotected

Definition at line 1882 of file EntityAI.c.

1883 {
1885 il.SetGround(NULL, mat);
1887 }
const int ECE_PLACE_ON_SURFACE
const int RF_DEFAULT
EntityAI SpawnEntity(string object_name, notnull InventoryLocation inv_loc, int iSetupFlags, int iRotation)
Definition gameplay.c:1466

References ECE_PLACE_ON_SURFACE, RF_DEFAULT, and SpawnEntity().

◆ SpawnEntityOnGroundPos()

EntityAI Entity::SpawnEntityOnGroundPos ( string object_name,
vector pos )
inlineprotected

Definition at line 1871 of file EntityAI.c.

1872 {
1874 vector mat[4];
1876 mat[3] = pos;
1877 il.SetGround(NULL, mat);
1879 }
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
Definition EnMath3D.c:233

References ECE_PLACE_ON_SURFACE, Math3D::MatrixIdentity4(), RF_DEFAULT, and SpawnEntity().

◆ SpawnInInventoryOrGroundPos()

EntityAI Entity::SpawnInInventoryOrGroundPos ( string object_name,
GameInventory inv,
vector pos )
inlineprotected

Definition at line 1857 of file EntityAI.c.

1858 {
1859 if (inv)
1860 {
1861 EntityAI res = inv.CreateInInventory(object_name);
1862 if (res)
1863 return res;
1864 }
1865
1867 }
EntityAI SpawnEntityOnGroundPos(string object_name, vector pos)
Definition EntityAI.c:1871

◆ SwitchItemSelectionTexture()

void Entity::SwitchItemSelectionTexture ( EntityAI item,
string slot_name )
protected

◆ SwitchItemSelectionTextureEx()

void Entity::SwitchItemSelectionTextureEx ( EItemManipulationContext context,
Param par = null )
protected

◆ SwitchLight()

proto native void Entity::SwitchLight ( bool isOn)
protected

◆ TranslateSlotFromSelection()

bool Entity::TranslateSlotFromSelection ( string selection_name,
out int slot_id )
inlineprotected

Definition at line 3099 of file EntityAI.c.

3100 {
3101 return false;
3102 }

◆ TryDelete()

bool Entity::TryDelete ( )
inlineprotected

Definition at line 692 of file EntityAI.c.

693 {
694 if (!IsPrepareToDelete())
695 {
696 Debug.Log("TryDelete - not ready for deletion");
697 return false;
698 }
699
700 if (GetGame().HasInventoryJunctureItem(this))
701 {
702 Debug.Log("TryDelete - deferred call");
703 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(TryDelete, DELETE_CHECK_DELAY, false);
704 return false;
705 }
706
708 Debug.Log("TryDelete - OnBeforeTryDelete end");
709 DeleteSafe();
710 Debug.Log("TryDelete - DeleteSafe end");
711
712 return true;
713 }
void OnBeforeTryDelete()

References CALL_CATEGORY_SYSTEM, GetGame(), IsPrepareToDelete(), and Debug::Log().

◆ UnpairRemote()

void Entity::UnpairRemote ( )
protected

◆ UpdateNetSyncVariableFloat()

proto native void Entity::UpdateNetSyncVariableFloat ( string variableName,
float minValue = 0,
float maxValue = 0,
int precision = 1 )
protected

◆ UpdateNetSyncVariableInt()

proto native void Entity::UpdateNetSyncVariableInt ( string variableName,
float minValue = 0,
float maxValue = 0 )
protected

◆ UpdateWeight()

void Entity::UpdateWeight ( WeightUpdateType updateType = WeightUpdateType.FULL,
float weightAdjustment = 0 )
protected

Member Data Documentation

◆ DEAD_REPLACE_DELAY

const int Entity::DEAD_REPLACE_DELAY = 2000
private

Definition at line 115 of file EntityAI.c.

◆ DELETE_CHECK_DELAY

const int Entity::DELETE_CHECK_DELAY = 100
private

Definition at line 116 of file EntityAI.c.

◆ m_AttachmentExclusionMaskChildren

ref set<int> Entity::m_AttachmentExclusionMaskChildren
private

Definition at line 108 of file EntityAI.c.

◆ m_AttachmentExclusionMaskGlobal

ref set<int> Entity::m_AttachmentExclusionMaskGlobal
private

Definition at line 107 of file EntityAI.c.

◆ m_AttachmentExclusionSlotMap

ref map<int, ref set<int> > Entity::m_AttachmentExclusionSlotMap
private

Definition at line 106 of file EntityAI.c.

◆ m_AttachmentsWithAttachments

ref array<EntityAI> Entity::m_AttachmentsWithAttachments
private

Definition at line 119 of file EntityAI.c.

◆ m_AttachmentsWithCargo

ref array<EntityAI> Entity::m_AttachmentsWithCargo
private

Definition at line 118 of file EntityAI.c.

◆ m_CanDisplayWeight

bool Entity::m_CanDisplayWeight
protected

Definition at line 128 of file EntityAI.c.

◆ m_ComponentsBank

ref ComponentsBank Entity::m_ComponentsBank
private

Definition at line 225 of file EntityAI.c.

◆ m_ConfigWeight

float Entity::m_ConfigWeight = ConfigGetInt("weight")
private

Definition at line 127 of file EntityAI.c.

◆ m_DamageDisplayNameMap

ref map<int, string> Entity::m_DamageDisplayNameMap = new map<int, string>
private

Definition at line 123 of file EntityAI.c.

◆ m_DamageZoneMap

ref DamageZoneMap Entity::m_DamageZoneMap
protected

Definition at line 122 of file EntityAI.c.

◆ m_DeathSyncSent

bool Entity::m_DeathSyncSent
private

Definition at line 101 of file EntityAI.c.

◆ m_DestructionBehaviourObj

ref DestructionEffectBase Entity::m_DestructionBehaviourObj
private

Definition at line 110 of file EntityAI.c.

◆ m_ElapsedSinceLastUpdate

float Entity::m_ElapsedSinceLastUpdate
protected

Definition at line 130 of file EntityAI.c.

◆ m_EM

ComponentEnergyManager Entity::m_EM
private

Definition at line 226 of file EntityAI.c.

◆ m_HiddenSelectionsData

ref HiddenSelectionsData Entity::m_HiddenSelectionsData
private

Definition at line 113 of file EntityAI.c.

◆ m_Initialized

bool Entity::m_Initialized = false
protected

Definition at line 135 of file EntityAI.c.

◆ m_KilledByHeadshot

bool Entity::m_KilledByHeadshot
private

Definition at line 102 of file EntityAI.c.

◆ m_KillerData

ref KillerData Entity::m_KillerData
private

Definition at line 112 of file EntityAI.c.

◆ m_LastUpdatedTime

float Entity::m_LastUpdatedTime
private

Definition at line 129 of file EntityAI.c.

◆ m_OldLocation

ref InventoryLocation Entity::m_OldLocation
private

Definition at line 120 of file EntityAI.c.

◆ m_OnAttachmentReleaseLock

ref ScriptInvoker Entity::m_OnAttachmentReleaseLock
protected

Definition at line 160 of file EntityAI.c.

◆ m_OnAttachmentSetLock

ref ScriptInvoker Entity::m_OnAttachmentSetLock
protected

Definition at line 158 of file EntityAI.c.

◆ m_OnHitByInvoker

ref ScriptInvoker Entity::m_OnHitByInvoker
protected

Definition at line 162 of file EntityAI.c.

◆ m_OnItemAddedIntoCargo

ref ScriptInvoker Entity::m_OnItemAddedIntoCargo
protected

Definition at line 144 of file EntityAI.c.

◆ m_OnItemAttached

ref ScriptInvoker Entity::m_OnItemAttached
protected

Definition at line 140 of file EntityAI.c.

◆ m_OnItemDetached

ref ScriptInvoker Entity::m_OnItemDetached
protected

Definition at line 142 of file EntityAI.c.

◆ m_OnItemFlipped

ref ScriptInvoker Entity::m_OnItemFlipped
protected

Definition at line 150 of file EntityAI.c.

◆ m_OnItemMovedInCargo

ref ScriptInvoker Entity::m_OnItemMovedInCargo
protected

Definition at line 148 of file EntityAI.c.

◆ m_OnItemRemovedFromCargo

ref ScriptInvoker Entity::m_OnItemRemovedFromCargo
protected

Definition at line 146 of file EntityAI.c.

◆ m_OnKilledInvoker

ref ScriptInvoker Entity::m_OnKilledInvoker
protected

Definition at line 164 of file EntityAI.c.

◆ m_OnReleaseLock

ref ScriptInvoker Entity::m_OnReleaseLock
protected

Definition at line 156 of file EntityAI.c.

◆ m_OnSetLock

ref ScriptInvoker Entity::m_OnSetLock
protected

Definition at line 154 of file EntityAI.c.

◆ m_OnViewIndexChanged

ref ScriptInvoker Entity::m_OnViewIndexChanged
protected

Definition at line 152 of file EntityAI.c.

◆ m_PendingDelete

bool Entity::m_PendingDelete = false
protected

Definition at line 134 of file EntityAI.c.

◆ m_PreparedToDelete

bool Entity::m_PreparedToDelete = false
private

Definition at line 103 of file EntityAI.c.

◆ m_RefresherViable

bool Entity::m_RefresherViable = false
private

Definition at line 104 of file EntityAI.c.

◆ m_TransportHitRegistered

bool Entity::m_TransportHitRegistered = false
protected

Definition at line 136 of file EntityAI.c.

◆ m_TransportHitVelocity

vector Entity::m_TransportHitVelocity
protected

Definition at line 137 of file EntityAI.c.

◆ m_UniversalTemperatureSource

UTemperatureSource Entity::m_UniversalTemperatureSource
protected

Definition at line 132 of file EntityAI.c.

◆ m_ViewIndex

int Entity::m_ViewIndex = 0
protected

view index Item view index is used to setup which camera will be used in item view widget in inventory. With this index you can setup various camera angles for different item states (e.g. fireplace, weapons).

Definition at line 2728 of file EntityAI.c.

◆ m_Weight

float Entity::m_Weight
private

Definition at line 125 of file EntityAI.c.

◆ m_WeightDirty

bool Entity::m_WeightDirty = 1
private

Definition at line 105 of file EntityAI.c.

◆ m_WeightEx

float Entity::m_WeightEx
private

Definition at line 126 of file EntityAI.c.


The documentation for this class was generated from the following files: