DIFF

class EntityAISource

EntityAI Entity ObjectTyped Object IEntity Managed

Derived classes
View all 1,897 descendants

All members, including inherited

Constructors 2

void ~EntityAI()

Constants 2

const int DEAD_REPLACE_DELAY = 250
Referenced by EEKilled()
const int DELETE_CHECK_DELAY = 100
Referenced by CheckForDestroy(), and TryDelete()

Members 64

bool m_PreparedToDelete = false
bool m_RefresherViable = false
bool m_WeightDirty = 1
protected bool m_RoofAbove = false
Referenced by IsRoofAbove(), and SetRoofAbove()
private ref map<int,ref set<int>> m_AttachmentExclusionSlotMap

own masks for different slots <slot,mask>. Kept on instance to better respond to various state changes

private ref set<int> m_AttachmentExclusionMaskGlobal

additional mask values and simple item values. Independent of slot-specific behavior!

private ref set<int> m_AttachmentExclusionMaskChildren

additional mask values and simple item values

ref DestructionEffectBase m_DestructionBehaviourObj
ref array<EntityAI> m_AttachmentsWithCargo
ref array<EntityAI> m_AttachmentsWithAttachments
private ref map<int, string> m_DamageDisplayNameMap = new map<int, string>

values are localization keys as strings, use 'Widget.TranslateString' method to get the localized one

float m_Weight
float m_WeightEx
Referenced by GetWeightEx()
protected bool m_CanDisplayWeight
Referenced by CanDisplayWeight(), and EntityAI()
private float m_LastUpdatedTime

CE update time

protected float m_ElapsedSinceLastUpdate

CE update time

protected float m_PreviousRoofTestTime = 0
protected UTemperatureSource m_UniversalTemperatureSource
bool m_PendingDelete = false
bool m_TransportHitRegistered = false
vector m_TransportHitVelocity
int m_VariablesMask

this holds information about which vars have been changed from their default values

float m_VarTemperatureInit
float m_VarTemperatureMin
float m_VarTemperatureMax
float m_VarTemperatureFreezeThreshold
float m_VarTemperatureThawThreshold
float m_VarTemperatureFreezeTime
float m_VarTemperatureThawTime
float m_VarTemperatureOverheatTime
float m_VarHeatPermeabilityCoef
protected bool m_IsFrozen
protected bool m_IsFrozenLocal
protected float m_OverheatProgress
protected ref ScriptInvoker m_OnItemAttached
protected ref ScriptInvoker m_OnItemDetached
protected ref ScriptInvoker m_OnItemAddedIntoCargo
protected ref ScriptInvoker m_OnItemRemovedFromCargo
protected ref ScriptInvoker m_OnItemMovedInCargo
protected ref ScriptInvoker m_OnItemFlipped
Referenced by GetOnItemFlipped()
protected ref ScriptInvoker m_OnViewIndexChanged
protected ref ScriptInvoker m_OnSetLock
Referenced by GetOnSetLock()
protected ref ScriptInvoker m_OnReleaseLock
Referenced by GetOnReleaseLock()
protected ref ScriptInvoker m_OnAttachmentSetLock
protected ref ScriptInvoker m_OnAttachmentReleaseLock
protected ref ScriptInvoker m_OnHitByInvoker
Referenced by EEHitBy(), and GetOnHitByInvoker()
protected ref ScriptInvoker m_OnKilledInvoker
Referenced by EEKilled(), and GetOnKilledInvoker()
private ref map<eAgents, float> m_BloodInfectionChanceCached

cache blood infection chance (cfgVehicles-><entity>->Skinning->BloodInfectionSettings)

private ref ComponentsBank m_ComponentsBank
int m_ViewIndex = 0

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).

Referenced by SetViewIndex()

Methods 479

int GetHideIconMask()

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

Component CreateComponent(int comp_type, string extended_class_name = "")

CreateComponent

References 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)

Referenced by EEInit()
override void SetDebugItem()DEVELOPER
void InitDamageZoneMapping()

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

Referenced by EntityAI()
void InitDamageZoneDisplayNameMapping()

Initialize map of damage zone display names for more optimized retrieval

Referenced by EntityAI()
float ConvertNonlethalDamage(float damage)

DEPRECATED - for legacy purposes

map<int, string> GetEntityDamageDisplayNameMap()
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 IsSkinned()
Referenced by CanBeSkinnedWith()
bool CanBeSkinnedWith(EntityAI tool)
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 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 OnHologramBeingPlaced(Man player)
void OnPlacementComplete(Man player, vector position = "0 0 0", vector orientation = "0 0 0")
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 IsSplitable()

returns just the configured 'canBeSplit' bool

bool HasAnyCargo()

is this container empty or not, checks only cargo

Referenced by IsEmpty()
array<EntityAI> GetAttachmentsWithCargo()
array<EntityAI> GetAttachmentsWithAttachments()
void CheckForRoofLimited(float timeTresholdMS = 3000)

Roof check for entity, limited by time (anti-spam solution)

void RemoveAgent(int agent_id)
void RemoveAllAgents()
void RemoveAllAgentsExcept(int agent_to_keep)
bool IsIgnoredByConstruction()
override void Delete()

Delete this object in next frame

Returns: void

ItemBase item = g_Game.GetPlayer().CreateInInventory("GrenadeRGD5");
item.Delete();
void DeleteOnClient()
void DeleteSave()
References DeleteSafe()
override bool CanBeActionTarget()
bool IsPreparedToDelete()
Referenced by IsSetForDeletion()
bool IsPrepareToDelete()
void OnBeforeTryDelete()
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)

void OnInventoryInit()
Referenced by GameInventory.Init()
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 OnChildItemReceived(InventoryItem item)
void OnItemAttachmentSlotChanged(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 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 SetTakeable(bool pState)
bool ReplaceOnDeath()
Referenced by EEKilled()
string GetDeadItemName()
bool KeepHealthOnReplace()
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 SwitchItemSelectionTexture(EntityAI item, string slot_name)
ScriptInvoker GetOnHitByInvoker()
References m_OnHitByInvoker
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

Referenced by EECargoOut()
void OnMovedWithinCargo(EntityAI container)

Called when this item moves within cargo of some container

Referenced by EECargoMove()
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)

Returns: true if action allowed

Note: return scriptConditionExecute(this, attachment, "CanReceiveAttachment");
bool CanLoadAttachment(EntityAI attachment)

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

Returns: true if action allowed

Note: return scriptConditionExecute(this, attachment, "CanLoadAsAttachment");
bool CanPutAsAttachment(EntityAI parent)

calls this->CanPutAsAttachment(parent)

in parent
target entity this is trying to attach to

Returns: true if action allowed

Note: engine code is scriptConditionExecute(this, parent, "CanPutAsAttachment")
References IsHologram()
bool CanSwitchDuringAttach(EntityAI 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 CombineItemsEx(EntityAI entity2, bool use_stack_max = false)
void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void CombineItemsClient(EntityAI entity2, bool use_stack_max = false)
void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
bool CanReceiveItemIntoCargo(EntityAI item)

calls this->CanReceiveItemIntoCargo(item)

Returns: true if action allowed

Note: return scriptConditionExecute(this, item, "CanReceiveItemIntoCargo");
bool CanLoadItemIntoCargo(EntityAI item)

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");
bool CanPutInCargo(EntityAI parent)

calls this->CanPutInCargo(parent)

Returns: true if action allowed

Note: return scriptConditionExecute(this, parent, "CanPutInCargo");
References IsHologram()
bool CanSwapItemInCargo(EntityAI child_entity, EntityAI new_entity)

calls this->CanSwapItemInCargo(child_entity, new_entity)

Returns: true if action allowed

Note: return ScriptConditionExecute(GetOwner(), child_entity, "CanSwapItemInCargo", new_entity);
bool CanReleaseCargo(EntityAI cargo)

calls this->CanReleaseCargo(cargo)

Returns: true if action allowed

Note: return scriptConditionExecute(this, cargo, "CanReleaseCargo");
bool CanRemoveFromCargo(EntityAI parent)

calls this->CanRemoveFromCargo(parent)

Returns: true if action allowed

Note: return scriptConditionExecute(this, parent, "CanRemoveFromCargo");
bool CanReceiveItemIntoHands(EntityAI item_to_hands)

calls this->CanReceiveItemIntoHands(item_to_hands)

Returns: true if action allowed

Note: scriptConditionExecute(this, item_to_hands, "CanReceiveItemIntoHands");
bool CanSaveItemInHands(EntityAI item_in_hands)
bool CanReleaseFromHands(EntityAI handheld)

calls this->CanReleaseFromHands(handheld)

Returns: true if action allowed

Note: scriptConditionExecute(this, handheld, "CanReleaseFromHands");
bool CanRemoveFromHands(EntityAI parent)

calls this->CanRemoveFromHands(parent)

Returns: true if action allowed

Note: return scriptConditionExecute(this, parent, "CanRemoveFromHands");
bool CanAssignToQuickbar()

Returns: true if item can be assigned to quickbar safely

bool CanAssignAttachmentsToQuickbar()

Returns: true if attached item can be assigned to quickbar safely

bool IgnoreOutOfReachCondition()

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

void OnWasAttached(EntityAI parent, int slot_id)
void OnWasDetached(EntityAI parent, int slot_id)
void OnCargoChanged()
proto native GameInventory GetInventory()
proto native void CreateAndInitInventory()
proto native void DestroyInventory()
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 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 PredictiveTakeEntityAsAttachment(notnull EntityAI item)

Put item into as attachment

bool ServerTakeEntityAsAttachment(notnull EntityAI item)
bool PredictiveDropEntity(notnull EntityAI item)
bool LocalDropEntity(notnull EntityAI item)
bool ServerDropEntity(notnull EntityAI item)
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 SpawnEntityOnGround(string object_name, vector mat[4])
void SetWet(float value, bool allow_client = false)
void AddWet(float value)
void SetWetMax()
float GetWetMax()
Referenced by HasWetness()
float GetWetMin()
Referenced by HasWetness()
float GetWetInit()
void OnWetChanged(float newVal, float oldVal)
void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
EWetnessLevel GetWetLevel()
bool HasQuantity()
bool SetQuantity(float value, bool destroy_config = true, bool destroy_forced = false, bool allow_client = false, bool clamp_to_stack_max = true)
void SetQuantityNormalized(float value, bool destroy_config = true, bool destroy_forced = false)
float GetQuantityNormalized()
int GetQuantityMin()
void SetQuantityToMinimum()
int GetQuickBarBonus()
bool UseConfigInitTemperature()
References Object.IsAlive(), IsAnimal(), Object.IsCorpse()
Show 2 more, Object.IsMan(), and IsZombie()
Referenced by InitTemperature()
void SetTemperature(float value, bool allow_client = false)

not really deprecated, but missing context info from TemperatureData. Default values used instead.

void AddTemperature(float value)
Referenced by ItemBase.OnAction()
void RefreshTemperatureAccess(TemperatureData data)

refreshes access without setting temperature, keeps the source locked in

void SetTemperatureMax()

presumably for debug purposes?

float GetTemperatureInit()
float GetTemperatureMin()
bool GetCookingTargetTemperature(out float temperature)

specifically for cooking system, to get heat source target temperatures

float GetHeatPermeabilityCoef()

Returns temperature change speed multiplier for this item and all its children (multiplicative interaction)

NoteValues > 1 accelerate, values in <0,1) interval decelerate. Values < 0 should not be used here, but I'm not your mom.
protected void SetFreezeThawProgress(float val)

0->1 when freezing, 1->0 when thawing

void OnFreezeStateChangeClient()
bool CanItemOverheat()

Overheat time CAN be 0, GameConstants.TEMPERATURE_TIME_OVERHEAT_MIN is ignored if so

float GetItemOverheatThreshold()

if undefined, max temperature used as default

float GetItemOverheatTime()

any configured value >= 0 will simulate overheating

bool IsItemOverheated()
float GetItemOverheatProgress()
void SetItemOverheatProgress(float val, float deltaTime = 0)
protected void OnItemOverheatStart()

override to implement desired overheat behavior on entity

protected void OnItemOverheat(float deltaTime)

note, that the deltaTime could be reverse-calculated and not totally accurate

protected void OnItemOverheatEnd()
void SetLiquidType(int value, bool allow_client = false)
int GetLiquidType()
void SetColor(int r, int g, int b, int a)
void GetColor(out int r, out int g, out int b, out int a)
void SetStoreLoad(bool value)
bool IsStoreLoad()
void SetStoreLoadedQuantity(float value)
float GetStoreLoadedQuantity()
void SetCleanness(int value, bool allow_client = false)
int GetCleanness()
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)

applies correct rotation according to WRUtils::EntityPlacementRotation(type->GetRotationFlags())

out trans
the transform to apply the correct rotation on
in pos
position to check
in dx
up vector x to align to
in dz
up vector z to align to
in fAngle
angle to position
in align
align to surface
proto native void RegisterNetSyncVariableBoolSignal(string variableName)

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

in variableName
which variable should be synchronized
proto native void RegisterNetSyncVariableInt(string variableName, int minValue = 0, int maxValue = 0)

registers int variable synchronized over network

in variableName
which variable should be synchronized
in minValue
minimal value used for quantization (when minValue == maxValue, no quatization is done)
in maxValue
maximal value used for quantization (when minValue == maxValue, no quatization is done)
Referenced by AnniversaryMusicSource.AnniversaryMusicSource(), BaseBuildingBase.BaseBuildingBase(), Battery9V.Battery9V()
Show 45 more, BatteryCharger.BatteryCharger(), Bottle_Base.Bottle_Base(), CarScript.CarScript(), Chemlight_ColorBase.Chemlight_ColorBase(), ClaymoreMine.ClaymoreMine(), ClockBase.Init(), CombinationLock.CombinationLock(), ContaminatedArea_DynamicBase.ContaminatedArea_DynamicBase(), ContaminatedTrigger_Dynamic.ContaminatedTrigger_Dynamic(), EasterEgg.EasterEgg(), Edible_Base.Edible_Base(), EffectArea.EffectArea(), EffecterBase.EffecterBase(), EffectTrigger.EffectTrigger(), EntityAI(), Fence.Fence(), FireplaceBase.FireplaceBase(), FireplaceIndoor.FireplaceIndoor(), FireworksLauncher.FireworksLauncher(), FryingPan.FryingPan(), GardenBase.GardenBase(), GeyserTrigger.GeyserTrigger(), HescoBox.HescoBox(), ImprovisedExplosive.ImprovisedExplosive(), ItemBase.InitItemVariables(), ItemOptics.ItemOptics(), Land_Underground_EntranceBase.Land_Underground_EntranceBase(), Land_Underground_WaterReservoir.Init(), Land_WarheadStorage_Main.Land_WarheadStorage_Main(), Land_WarheadStorage_PowerStation.Land_WarheadStorage_PowerStation(), OvenIndoor.OvenIndoor(), ParticleEffecter.ParticleEffecter(), PlantBase.PlantBase(), Plastic_Explosive.Plastic_Explosive(), PlayerBase.Init(), PowerGeneratorBase.PowerGeneratorBase(), RemoteDetonatorTrigger.RemoteDetonatorTrigger(), Roadflare.Roadflare(), SmokeGrenadeBase.SmokeGrenadeBase(), TentBase.TentBase(), TrapSpawnBase.TrapSpawnBase(), TripwireTrap.TripwireTrap(), UndergroundTriggerCarrier.UndergroundTriggerCarrier(), VehicleBattery.VehicleBattery(), and ZombieBase.Init()
proto native void RegisterNetSyncVariableFloat(string variableName, float minValue = 0, float maxValue = 0, int precision = 1)

registers float variable synchronized over network

in variableName
which variable should be synchronized
in minValue
minimal value used for quantization (when minValue == maxValue, no quatization is done)
in maxValue
maximal value used for quantization (when minValue == maxValue, no quatization is done)
in precision
precision in number of digits after decimal point
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

in variableName
which variable should be synchronized
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 bool IsSimpleHiddenSelectionVisible(int index)
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 void SetRequiredSimulation(bool req)
proto native bool IsRequiredSimulation()
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).

void OnStoreSave(ParamsWriteContext ctx)
{
	// 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);
}
bool OnStoreLoad(ParamsReadContext ctx, int version)

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;
}
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.

bool IsVariableSet(int variable)

'true' if this variable has ever been changed from default

References m_VariablesMask
void RemoveItemVariable(int variable)

Removes variable from variable mask, making it appear as though the variable has never been changed from default

References m_VariablesMask
void TransferVariablesFloat(array<float> float_vars)
void SaveVariables(ParamsWriteContext ctx)
Referenced by OnStoreSave()
void WriteVarsToCTX(ParamsWriteContext ctx)

Writes to storage CTX

bool ReadVarsFromCTX(ParamsReadContext ctx, int version = -1)

Reads from storage CTX

void SerializeNumericalVars(array<float> floats_out)
proto native void SetAITargetCallbacks(AbstractAITargetCallbacks callbacks)
override void EOnFrame(IEntity other, float timeSlice)
void GetDebugButtonNames(out string button1, out string button2, out string button3, out string button4)
void OnDebugButtonPressClient(int button_index)
void OnDebugButtonPressServer(int button_index)
Referenced by ItemBase.OnAction()
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

Referenced by ActionUnplugThisByCord.OnExecuteServer(), ActionViewBinoculars.ExitOptics(), ActionViewOptics.ExitOptics()
Show 43 more, BarbedWire.OnInventoryEnter(), BatteryCharger.OnInventoryEnter(), BatteryCharger.OnInventoryExit(), BatteryCharger.OnOwnSocketReleased(), BatteryCharger.OnOwnSocketTaken(), BatteryCharger.OnSwitchOff(), BatteryCharger.OnSwitchOn(), ClaymoreMine.UpdateVisuals(), ComponentEnergyManager.PlugInDevice(), ComponentEnergyManager.UnplugCordFromSocket(), ComponentEnergyManager.UnplugDevice(), ComponentEnergyManager.UpdateSelections(), ComponentEnergyManager.UpdateSocketSelections(), ShowAllSelections(), Flag_Base.Flag_Base(), Flag_Base.OnWasAttached(), Flag_Base.OnWasDetached(), GardenBase.SetSlotTextureDigged(), GardenBase.SetSlotTextureFertilized(), GardenBase.UpdateSlotTexture(), HescoBox.Fill(), HescoBox.Fold(), HescoBox.Unfold(), HuntingOptic.ShowSelection(), ItemMap.SetMapStateOpen(), ItemOptics.OnOpticExit(), KazuarOptic.UpdateSelectionVisibility(), Magnum_Base.ShowBullet(), MetalWire.UpdateAllSelections(), PileOfWoodenPlanks.UpdateSelections(), PlantBase.UpdatePlant(), PowerGeneratorBase.EEItemAttached(), Roadflare.OnInventoryEnter(), Roadflare.OnInventoryExit(), Roadflare.UpdateModelSelections(), SmershVest.EEItemAttached(), Spotlight.UpdateAllSelections(), StarlightOptic.UpdateSelectionVisibility(), TripodBase.OnDebugSpawn(), TripodBase.OnWasAttached(), TripodBase.OnWasDetached(), TripwireTrap.UpdateProxySelections(), and WeaponChambering_MultiMuzzleMagnum.OnExit()
proto void GetPersistentID(out int b1, out int b2, out int b3, out int b4)

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

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

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

Referenced by IsSkinned(), OnRPC(), and SetAsSkinned()

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.

References Class.Cast(), GetComponent(), HasComponent()
Show 1 more, m_EM
bool HasEnergyManager()

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

References HasComponent()
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() !!!

int GetWeight()
References GetWeightEx()
void ClearWeightDirty()
References m_WeightDirty
Referenced by GetWeightEx()
protected 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

float GetSingleInventoryItemWeightEx()
Referenced by OnAction()
void SetViewIndex(int index)

Sets item preview index

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<string> GetSuitableFinisherHitComponents()
string GetAttachmentSoundType()

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

bool IsOneHandedBehaviour()

returns item behaviour of item (more in ItemBase)

Referenced by SlotToAnimType()
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 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
}
string GetInvulnerabilityTypeString()
int GetBayonetAttachmentIdx()
void SetButtstockAttached(bool pState, int slot_idx = -1)
int GetButtstockAttachmentIdx()
void SoundHardTreeFallingPlay()
void SoundSoftTreeFallingPlay()
void SoundHardBushFallingPlay()
void SoundSoftBushFallingPlay()
bool GetInventoryHandAnimation(notnull InventoryLocation loc, out int value)
Referenced by SlotToAnimType()
bool TranslateSlotFromSelection(string selection_name, out int slot_id)
void SetUniversalTemperatureSource(UTemperatureSource uts)
vector GetUniversalTemperatureSourcePosition()
void PairRemote(notnull EntityAI trigger)
void UnpairRemote()
bool HasTurnableValveBehavior()

Turnable Valve behaviour

bool IsValveTurnable(int pValveIndex)
int GetTurnableValveIndex(int pComponentIndex)
void ExecuteActionsConnectedToValve(int pValveIndex)
private void InitInherentSlotExclusionMap()

map stored on instance to better respond to various state changes

protected bool InitLegacyExclusionCheck()
protected void InitLegacySlotExclusionValuesImplicit()

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.
protected void ClearSingleExclusionValueGlobal(EAttExclusions value)

to help with item staging exclusions

protected void SetAttachmentExclusionMaskGlobal(set<int> values)
protected void SetAttachmentExclusionMaskSlot(int slotId, set<int> values)

sets values for specific slot

set<int> GetAttachmentExclusionMaskAll(int slotId)

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

set<int> GetAttachmentExclusionMaskSlot(int slotId)

Specific slot behavior

set<int> GetAttachmentExclusionMaskGlobal()

Global mask value, independent of slot-specific behavior!

set<int> GetAttachmentExclusionMaskChildren()

Mask value coming from the item's attachments

private bool HasInternalExclusionConflicts(int targetSlot)

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

protected bool IsExclusionFlagPresent(set<int> values)

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

protected bool CheckExclusionAccessCondition(int occupiedSlot, int targetSlot, set<int> value, inout set<int> adjustedValue)
protected void AdjustExclusionAccessCondition(int occupiedSlot, int testedSlot, set<int> value, inout set<int> adjustedValue)

if we want to filter

protected bool CheckExclusionAccessPropagation(int occupiedSlot, int targetSlot, set<int> value, inout set<int> adjustedValue)

special propagation contition

protected 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.

void ClearInventory()
protected void NotifyPlayerInventoryLoadChanged(EntityAI entity)
Referenced by EEAmmoChanged()
void NotifyPlayerLoadChanged(EntityAI owner)
void UpdateWeight(WeightUpdateType updateType = WeightUpdateType.FULL, float weightAdjustment = 0)