10enum SurfaceAnimationBone
35enum EItemManipulationContext
43enum EInventoryIconVisibility
55 OCCUPANCY_INVALID = -1,
57 LEGACY_EYEWEAR_HEADGEAR,
59 LEGACY_HEADSTRAP_HEADGEAR,
60 LEGACY_HEADSTRAP_MASK,
62 LEGACY_HEADGEAR_EYEWEWEAR,
63 LEGACY_HEADGEAR_HEADSTRAP,
65 LEGACY_MASK_EYEWEWEAR,
66 LEGACY_MASK_HEADSTRAP,
68 EXCLUSION_HEADGEAR_HELMET_0,
70 EXCLUSION_HEADSTRAP_0,
75 EXCLUSION_GLASSES_REGULAR_0,
76 EXCLUSION_GLASSES_TIGHT_0,
79 SHAVING_HEADGEAR_ATT_0,
85 bool m_KilledByHeadshot;
86 bool m_PreparedToDelete =
false;
87 bool m_RefresherViable =
false;
88 bool m_WeightDirty = 1;
90 private ref set<int> m_AttachmentExclusionMaskGlobal;
91 private ref set<int> m_AttachmentExclusionMaskChildren;
98 const int DEAD_REPLACE_DELAY = 2000;
99 const int DELETE_CHECK_DELAY = 100;
110 float m_ConfigWeight = ConfigGetInt(
"weight");
111 protected bool m_CanDisplayWeight;
112 private float m_LastUpdatedTime;
113 protected float m_ElapsedSinceLastUpdate;
115 protected UTemperatureSource m_UniversalTemperatureSource;
117 bool m_PendingDelete =
false;
119 bool m_TransportHitRegistered =
false;
120 vector m_TransportHitVelocity;
149 string param_access_energy_sys =
"CfgVehicles " + type +
" EnergyManager ";
152 if (is_electic_device)
155 RegisterNetSyncVariableBool(
"m_EM.m_IsSwichedOn");
156 RegisterNetSyncVariableBool(
"m_EM.m_CanWork");
157 RegisterNetSyncVariableBool(
"m_EM.m_IsPlugged");
158 RegisterNetSyncVariableInt(
"m_EM.m_EnergySourceNetworkIDLow");
159 RegisterNetSyncVariableInt(
"m_EM.m_EnergySourceNetworkIDHigh");
160 RegisterNetSyncVariableFloat(
"m_EM.m_Energy");
164 RegisterNetSyncVariableInt(
"m_ViewIndex", 0, 99 );
166 RegisterNetSyncVariableBool(
"m_RefresherViable");
170 m_LastUpdatedTime = 0.0;
171 m_ElapsedSinceLastUpdate = 0.0;
173 m_CanDisplayWeight = ConfigGetBool(
"displayWeight");
175 InitDamageZoneMapping();
176 InitDamageZoneDisplayNameMapping();
201 return EInventoryIconVisibility.ALWAYS;
208 Component CreateComponent(
int comp_type,
string extended_class_name=
"")
210 return GetComponent(comp_type, extended_class_name);
214 Component GetComponent(
int comp_type,
string extended_class_name=
"")
216 if ( m_ComponentsBank == NULL )
219 return m_ComponentsBank.GetComponent(comp_type, extended_class_name);
223 bool DeleteComponent(
int comp_type)
225 return m_ComponentsBank.DeleteComponent(comp_type);
228 string GetDestructionBehaviour()
233 bool IsDestructionBehaviour()
239 bool HasComponent(
int comp_type)
241 if ( m_ComponentsBank )
242 return m_ComponentsBank.IsComponentAlreadyExist(comp_type);
248 void MaxLifetimeRefreshCalc()
250 if ( (!
GetGame().IsMultiplayer() ||
GetGame().IsServer()) && GetEconomyProfile() )
252 float lifetime = GetEconomyProfile().GetLifetime();
253 int frequency =
GetCEApi().GetCEGlobalInt(
"FlagRefreshFrequency");
254 if ( frequency <= 0 )
259 if ( frequency <= lifetime )
261 m_RefresherViable =
true;
273 return m_RefresherViable;
277 override void SetDebugItem()
279 super.SetDebugItem();
286 void InitDamageZoneMapping()
289 DamageSystem.GetDamageZoneMap(
this,m_DamageZoneMap);
293 void InitDamageZoneDisplayNameMapping()
297 string component_name;
303 else if ( IsMagazine() )
312 path_base =
string.
Format(
"%1 %2 DamageSystem DamageZones", path_base,
GetType() );
314 if ( !
GetGame().ConfigIsExisting(path_base) )
316 component_name = GetDisplayName();
318 m_DamageDisplayNameMap.Insert(
"".Hash(), component_name );
323 GetDamageZones( zone_names );
325 for (
int i = 0; i < zone_names.Count(); i++ )
327 path =
string.
Format(
"%1 %2 displayName", path_base, zone_names[i] );
332 m_DamageDisplayNameMap.Insert( zone_names[i].Hash(), component_name );
340 return m_DamageZoneMap;
345 return m_DamageDisplayNameMap;
349 bool CanDisplayWeight()
351 return m_CanDisplayWeight;
355 void Log(
string msg,
string fnc_name =
"n/a")
361 void LogWarning(
string msg,
string fnc_name =
"n/a")
367 void LogError(
string msg,
string fnc_name =
"n/a")
375 return GetCompBS() && GetCompBS().IsSkinned();
381 GetCompBS().SetAsSkinned();
384 bool CanBeSkinnedWith(
EntityAI tool)
386 if ( !IsSkinned() && tool )
407 bool CanIgniteItem(
EntityAI ignite_target = NULL)
426 bool IsBasebuildingKit()
432 bool PlacementCanBeRotated()
438 void OnIgnitedTarget(
EntityAI target_item)
450 void OnIgnitedTargetFailed(
EntityAI target_item)
456 void OnIgnitedThisFailed(
EntityAI fire_source)
462 bool IsTargetIgnitionSuccessful(
EntityAI item_target)
468 bool IsThisIgnitionSuccessful(
EntityAI item_source = NULL)
477 void OnHologramBeingPlaced(
Man player ) { }
486 Man attached_to =
Man.Cast( GetHierarchyParent() );
487 if (!attached_to || attached_to == player )
507 string CanBePlacedFailMessage(
Man player,
vector position )
519 float HeightCheckOverride()
525 float HeightStartCheckOverride()
533 return (!HasAnyCargo() && GetInventory().AttachmentCount() == 0);
544 CargoBase cargo = GetInventory().GetCargo();
546 if(!cargo)
return false;
560 return m_AttachmentsWithCargo;
565 return m_AttachmentsWithAttachments;
574 override bool IsEntityAI() {
return true; }
578 return !(
GetParent() || GetHierarchyParent() );
596 bool IsZombieMilitary()
608 if (ai && ai.IsBeingBackstabbed())
618 bool CanBeBackstabbed()
631 override void Delete()
633 m_PendingDelete =
true;
637 void DeleteOnClient()
645 if (GetHierarchyRootPlayer() == null)
652 GetHierarchyRootPlayer().JunctureDeleteItem(
this );
654 GetHierarchyRootPlayer().AddItemToDelete(
this );
664 bool IsSetForDeletion()
666 return IsPreparedToDelete() || m_PendingDelete || ToDelete() ||
IsPendingDeletion();
669 void SetPrepareToDelete()
671 m_PreparedToDelete =
true;
674 bool IsPreparedToDelete()
676 return m_PreparedToDelete;
680 void CheckForDestroy()
698 if (
GetGame().HasInventoryJunctureItem(
this) )
709 void OnBeforeTryDelete() {}
712 proto native
EntityAI GetHierarchyRoot();
715 proto native
Man GetHierarchyRootPlayer();
718 proto native
EntityAI GetHierarchyParent();
724 int GetHierarchyLevel(
int lvl = 0)
726 if (!GetHierarchyParent())
730 return GetHierarchyParent().GetHierarchyLevel(lvl+1);
734 void OnInventoryInit()
736 InitAttachmentExclusionValues();
744 GetInventory().EEInit();
745 m_AttachmentsWithCargo.Clear();
746 m_AttachmentsWithAttachments.Clear();
747 for (
int i = 0; i < GetInventory().AttachmentCount(); i++ )
749 EntityAI attachment = GetInventory().GetAttachmentFromIndex( i );
752 if ( attachment.GetInventory().GetCargo() )
754 m_AttachmentsWithCargo.Insert( attachment );
757 if ( attachment.GetInventory().GetAttachmentSlotsCount() > 0 )
759 m_AttachmentsWithAttachments.Insert( attachment );
765 MaxLifetimeRefreshCalc();
771 m_PendingDelete =
true;
772 GetInventory().EEDelete(parent);
778 override void OnExplosionEffects(
Object source,
Object directHit,
int componentIndex,
string surface,
vector pos,
vector surfNormal,
float energyFactor,
float explosionFactor,
bool isWater,
string ammoType)
780 super.OnExplosionEffects(source, directHit, componentIndex, surface, pos, surfNormal, energyFactor, explosionFactor, isWater, ammoType);
782 g_Game.GetWorld().AddEnvShootingSource(pos, 1.0);
784 if (m_DestructionBehaviourObj && m_DestructionBehaviourObj.HasExplosionDamage())
786 m_DestructionBehaviourObj.OnExplosionEffects(source, directHit, componentIndex, surface, pos, surfNormal, energyFactor, explosionFactor, isWater, ammoType);
797 EntityAI old_owner = oldLoc.GetParent();
798 EntityAI new_owner = newLoc.GetParent();
811 Error(
"EntityAI::EEItemLocationChanged - detached, but old_owner is null");
819 Error(
"EntityAI::EEItemLocationChanged - attached, but new_owner is null");
829 void EEParentedFrom(
EntityAI parent)
838 m_LastUpdatedTime = 0.0;
840 if (GetInventory() && newParent == null)
842 GetInventory().ResetFlipCargo();
854 EntityAI parent = GetHierarchyParent();
860 parent.OnAttachmentRuined(
this);
866 AttemptDestructionBehaviour(oldLevel,newLevel, zone);
873 void AttemptDestructionBehaviour(
int oldLevel,
int newLevel,
string zone)
875 if (IsDestructionBehaviour() && GetDestructionBehaviour())
877 typename destType = GetDestructionBehaviour().ToType();
881 if (!m_DestructionBehaviourObj)
886 if (m_DestructionBehaviourObj)
893 ErrorEx(
"Incorrect destruction behaviour type, make sure the class returned in 'GetDestructionBehaviour()' is a valid type inheriting from 'DestructionEffectBase'");
931 dead_entity.SetHealth(GetHealth());
958 PropagateExclusionValueRecursive(item.GetAttachmentExclusionMaskAll(slotId),slotId);
961 if ( m_ComponentsBank != NULL )
965 if ( m_ComponentsBank.IsComponentAlreadyExist(comp_key) )
967 m_ComponentsBank.GetComponent(comp_key).Event_OnItemAttached(item, slot_name);
973 if ( m_EM && item.GetCompEM())
976 if ( item.GetInventory().GetCargo() )
977 m_AttachmentsWithCargo.Insert( item );
979 if ( item.GetInventory().GetAttachmentSlotsCount() > 0 )
980 m_AttachmentsWithAttachments.Insert( item );
982 if ( m_OnItemAttached )
983 m_OnItemAttached.Invoke( item, slot_name,
this );
986 void SwitchItemSelectionTexture(
EntityAI item,
string slot_name);
987 void SwitchItemSelectionTextureEx(EItemManipulationContext context,
Param par = null);
993 ClearExclusionValueRecursive(item.GetAttachmentExclusionMaskAll(slotId),slotId);
996 if ( m_ComponentsBank != NULL )
1000 if ( m_ComponentsBank.IsComponentAlreadyExist(comp_key) )
1002 m_ComponentsBank.GetComponent(comp_key).Event_OnItemDetached(item, slot_name);
1008 if (m_EM && item.GetCompEM())
1011 if ( m_AttachmentsWithCargo.Find( item ) > -1 )
1012 m_AttachmentsWithCargo.RemoveItem( item );
1014 if ( m_AttachmentsWithAttachments.Find( item ) > -1 )
1015 m_AttachmentsWithAttachments.RemoveItem( item );
1018 if ( m_OnItemDetached )
1019 m_OnItemDetached.Invoke( item, slot_name,
this );
1026 if( m_OnItemAddedIntoCargo )
1027 m_OnItemAddedIntoCargo.Invoke( item,
this );
1029 item.OnMovedInsideCargo(
this);
1036 if( m_OnItemRemovedFromCargo )
1037 m_OnItemRemovedFromCargo.Invoke( item,
this );
1039 item.OnRemovedFromCargo(
this);
1044 if( m_OnItemMovedInCargo )
1045 m_OnItemMovedInCargo.Invoke( item,
this );
1046 item.OnMovedWithinCargo(
this);
1051 if( !m_OnItemAttached )
1053 return m_OnItemAttached;
1058 if( !m_OnItemDetached )
1060 return m_OnItemDetached;
1065 if( !m_OnItemAddedIntoCargo )
1067 return m_OnItemAddedIntoCargo;
1072 if( !m_OnItemRemovedFromCargo )
1074 return m_OnItemRemovedFromCargo;
1079 if( !m_OnItemMovedInCargo )
1081 return m_OnItemMovedInCargo;
1086 if( !m_OnItemFlipped )
1088 return m_OnItemFlipped;
1093 if( !m_OnViewIndexChanged )
1095 return m_OnViewIndexChanged;
1107 if( !m_OnReleaseLock )
1109 return m_OnReleaseLock;
1114 if( !m_OnAttachmentSetLock )
1116 return m_OnAttachmentSetLock;
1121 if( !m_OnAttachmentReleaseLock )
1123 return m_OnAttachmentReleaseLock;
1135 void OnRemovedFromCargo(
EntityAI container)
1141 void OnMovedWithinCargo(
EntityAI container)
1166 bool is_attachment =
false;
1168 if (potential_energy_source)
1169 is_attachment = GetInventory().HasAttachment(potential_energy_source);
1171 if ( !is_attachment && potential_energy_source )
1172 is_attachment = potential_energy_source.GetInventory().HasAttachment(
this);
1174 if ( potential_energy_source && potential_energy_source.GetCompEM() && !is_attachment )
1190 void OnBinLoadItemsDropped()
1192 if ( GetHierarchyRootPlayer() )
1195 GetHierarchyRootPlayer().SetProcessUIWarning(
true);
1200 void HideAllSelections()
1202 string cfg_path =
"cfgVehicles " +
GetType() +
" AnimationSources";
1204 if (
GetGame().ConfigIsExisting(cfg_path) )
1208 for (
int i = 0; i < selections; i++)
1210 string selection_name;
1212 HideSelection(selection_name);
1218 void ShowAllSelections()
1220 string cfg_path =
"cfgVehicles " +
GetType() +
" AnimationSources";
1222 if (
GetGame().ConfigIsExisting(cfg_path) )
1226 for (
int i = 0; i < selections; i++)
1228 string selection_name;
1230 ShowSelection(selection_name);
1244 EntityAI currentAtt = GetInventory().FindAttachment(slotId);
1245 bool hasInternalConflict = attachment.HasInternalExclusionConflicts(slotId);
1248 set<int> diff = attachment.GetAttachmentExclusionMaskAll(slotId);
1249 diff.RemoveItems(currentAtt.GetAttachmentExclusionMaskAll(slotId));
1250 if (diff.Count() == 0)
1252 return !hasInternalConflict;
1256 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(diff,slotId);
1259 return !hasInternalConflict && !IsExclusionFlagPresentRecursive(attachment.GetAttachmentExclusionMaskAll(slotId),slotId);
1286 bool CanSwitchDuringAttach(
EntityAI parent)
1298 if( attachment && attachment.GetInventory() && GetInventory() )
1301 attachment.GetInventory().GetCurrentInventoryLocation( il );
1305 return !GetInventory().GetSlotLock( slot );
1316 bool CanDetachAttachment (
EntityAI parent)
1321 bool CanCombineAttachment(notnull
EntityAI e,
int slot,
bool stack_max_limit =
false)
1323 EntityAI att = GetInventory().FindAttachment(slot);
1325 return att.CanBeCombined(e,
true, stack_max_limit);
1329 bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false )
1345 if (GetInventory() && GetInventory().GetCargo())
1346 return GetInventory().GetCargo().CanReceiveItemIntoCargo(item));
1381 if (GetInventory() && GetInventory().GetCargo())
1382 return GetInventory().GetCargo().CanSwapItemInCargo(child_entity, new_entity));
1393 bool CanReleaseCargo (
EntityAI cargo)
1437 bool CanReceiveItemIntoHands (
EntityAI item_to_hands)
1452 bool CanSaveItemInHands (
EntityAI item_in_hands)
1474 bool CanReleaseFromHands (
EntityAI handheld)
1496 Debug.
LogWarning(
"Obsolete function - use CanDisplayAttachmentSlot with slot id parameter");
1512 bool CanDisplayAnyAttachmentSlot()
1514 int count = GetInventory().GetAttachmentSlotsCount();
1516 for (
int i = 0; i < count; i++)
1518 slotID = GetInventory().GetAttachmentSlotId(i);
1556 bool CanAssignAttachmentsToQuickbar()
1575 void OnCargoChanged() { }
1583 proto native
void CreateAndInitInventory ();
1584 proto native
void DestroyInventory ();
1586 int GetSlotsCountCorrect()
1588 if( GetInventory() )
1589 return GetInventory().GetAttachmentSlotsCount();
1594 EntityAI FindAttachmentBySlotName(
string slot_name)
1600 return GetInventory().FindAttachment(slot_id);
1608 bool IsLockedInSlot()
1610 EntityAI parent = GetHierarchyParent();
1614 GetInventory().GetCurrentInventoryLocation( inventory_location );
1616 return parent.GetInventory().GetSlotLock( inventory_location.
GetSlot() );
1627 if (
GetGame().IsMultiplayer() )
1628 return GetInventory().TakeEntityToInventory(
InventoryMode.JUNCTURE, flags, item);
1630 return GetInventory().TakeEntityToInventory(
InventoryMode.PREDICTIVE, flags, item);
1634 return GetInventory().TakeEntityToInventory(
InventoryMode.LOCAL, flags, item);
1638 return GetInventory().TakeEntityToInventory(
InventoryMode.SERVER, flags, item);
1642 if (
GetGame().IsMultiplayer() )
1643 return GetInventory().TakeEntityToTargetInventory(
InventoryMode.JUNCTURE, target, flags, item);
1645 return GetInventory().TakeEntityToTargetInventory(
InventoryMode.PREDICTIVE, target, flags, item);
1649 return GetInventory().TakeEntityToTargetInventory(
InventoryMode.LOCAL, target, flags, item);
1653 return GetInventory().TakeEntityToTargetInventory(
InventoryMode.SERVER, target, flags, item);
1660 if (
GetGame().IsMultiplayer() )
1661 return GetInventory().TakeEntityToCargo(
InventoryMode.JUNCTURE, item);
1663 return GetInventory().TakeEntityToCargo(
InventoryMode.PREDICTIVE, item);
1667 return GetInventory().TakeEntityToCargo(
InventoryMode.LOCAL, item);
1671 return GetInventory().TakeEntityToCargo(
InventoryMode.SERVER, item);
1676 if (
GetGame().IsMultiplayer() )
1677 return GetInventory().TakeEntityToTargetCargo(
InventoryMode.JUNCTURE, target, item);
1679 return GetInventory().TakeEntityToTargetCargo(
InventoryMode.PREDICTIVE, target, item);
1683 return GetInventory().TakeEntityToTargetCargo(
InventoryMode.LOCAL, target, item);
1687 return GetInventory().TakeEntityToTargetCargo(
InventoryMode.SERVER, target, item);
1692 bool PredictiveTakeEntityToCargoEx (notnull
EntityAI item,
int idx,
int row,
int col)
1694 if (
GetGame().IsMultiplayer() )
1695 return GetInventory().TakeEntityToCargoEx(
InventoryMode.JUNCTURE, item, idx, row, col);
1697 return GetInventory().TakeEntityToCargoEx(
InventoryMode.PREDICTIVE, item, idx, row, col);
1699 bool LocalTakeEntityToCargoEx (notnull
EntityAI item,
int idx,
int row,
int col)
1701 return GetInventory().TakeEntityToCargoEx(
InventoryMode.LOCAL, item, idx, row, col);
1706 if (
GetGame().IsMultiplayer() )
1707 return GetInventory().TakeEntityToTargetCargoEx(
InventoryMode.JUNCTURE, cargo, item, row, col);
1709 return GetInventory().TakeEntityToTargetCargoEx(
InventoryMode.PREDICTIVE, cargo, item, row, col);
1713 return GetInventory().TakeEntityToTargetCargoEx(
InventoryMode.LOCAL, cargo, item, row, col);
1717 return GetInventory().TakeEntityToTargetCargoEx(
InventoryMode.SERVER, cargo, item, row, col);
1724 if (
GetGame().IsMultiplayer() )
1725 return GetInventory().TakeEntityAsAttachmentEx(
InventoryMode.JUNCTURE, item, slot);
1727 return GetInventory().TakeEntityAsAttachmentEx(
InventoryMode.PREDICTIVE, item, slot);
1731 return GetInventory().TakeEntityAsAttachmentEx(
InventoryMode.LOCAL, item, slot);
1735 return GetInventory().TakeEntityAsAttachmentEx(
InventoryMode.SERVER, item, slot);
1740 if (
GetGame().IsMultiplayer() )
1741 return GetInventory().TakeEntityAsTargetAttachmentEx(
InventoryMode.JUNCTURE, target, item, slot);
1743 return GetInventory().TakeEntityAsTargetAttachmentEx(
InventoryMode.PREDICTIVE, target, item, slot);
1747 return GetInventory().TakeEntityAsTargetAttachmentEx(
InventoryMode.LOCAL, target, item, slot);
1751 return GetInventory().TakeEntityAsTargetAttachmentEx(
InventoryMode.SERVER, target, item, slot);
1756 if (
GetGame().IsMultiplayer() )
1757 return GetInventory().TakeEntityAsTargetAttachment(
InventoryMode.JUNCTURE, target, item);
1759 return GetInventory().TakeEntityAsTargetAttachment(
InventoryMode.PREDICTIVE, target, item);
1763 return GetInventory().TakeEntityAsTargetAttachment(
InventoryMode.LOCAL, target, item);
1767 return GetInventory().TakeEntityAsTargetAttachment(
InventoryMode.SERVER, target, item);
1772 if (
GetGame().IsMultiplayer() )
1773 return GetInventory().TakeToDst(
InventoryMode.JUNCTURE, src, dst);
1775 return GetInventory().TakeToDst(
InventoryMode.PREDICTIVE, src, dst);
1779 return GetInventory().TakeToDst(
InventoryMode.LOCAL, src, dst);
1783 return GetInventory().TakeToDst(
InventoryMode.SERVER, src, dst);
1791 if (
GetGame().IsMultiplayer() )
1792 return GetInventory().TakeEntityAsAttachment(
InventoryMode.JUNCTURE, item);
1794 return GetInventory().TakeEntityAsAttachment(
InventoryMode.PREDICTIVE, item);
1798 return GetInventory().TakeEntityAsAttachment(
InventoryMode.LOCAL, item);
1802 return GetInventory().TakeEntityAsAttachment(
InventoryMode.SERVER, item);
1812 EntityAI GetAttachmentByType(
typename type)
1814 for (
int i = 0; i < GetInventory().AttachmentCount(); i++ )
1816 EntityAI attachment = GetInventory().GetAttachmentFromIndex( i );
1817 if ( attachment && attachment.IsInherited( type ) )
1826 EntityAI GetAttachmentByConfigTypeName(
string type)
1828 for (
int i = 0; i < GetInventory().AttachmentCount(); i++ )
1830 EntityAI attachment = GetInventory().GetAttachmentFromIndex ( i );
1831 if ( attachment.IsKindOf ( type ) )
1870 void SetWet(
float value,
bool allow_client =
false) {};
1871 void AddWet(
float value) {};
1980 return m_HiddenSelectionsData;
1984 int GetHiddenSelectionIndex(
string selection )
1986 if (m_HiddenSelectionsData)
1995 if (m_HiddenSelectionsData)
1996 return m_HiddenSelectionsData.m_HiddenSelections;
1998 return super.GetHiddenSelections();
2004 if (m_HiddenSelectionsData)
2005 return m_HiddenSelectionsData.m_HiddenSelectionsTextures;
2007 return super.GetHiddenSelectionsTextures();
2013 if (m_HiddenSelectionsData)
2014 return m_HiddenSelectionsData.m_HiddenSelectionsMaterials;
2016 return super.GetHiddenSelectionsMaterials();
2030 proto native
void PlaceOnSurfaceRotated(out
vector trans[4],
vector pos,
float dx = 0,
float dz = 0,
float fAngle = 0,
bool align =
false);
2038 proto native
void RegisterNetSyncVariableBool(
string variableName);
2046 proto native
void RegisterNetSyncVariableBoolSignal(
string variableName);
2056 proto native
void RegisterNetSyncVariableInt(
string variableName,
int minValue = 0,
int maxValue = 0);
2067 proto native
void RegisterNetSyncVariableFloat(
string variableName,
float minValue = 0,
float maxValue = 0,
int precision = 1);
2069 proto native
void UpdateNetSyncVariableInt(
string variableName,
float minValue = 0,
float maxValue = 0);
2070 proto native
void UpdateNetSyncVariableFloat(
string variableName,
float minValue = 0,
float maxValue = 0,
int precision = 1);
2072 proto native
void SwitchLight(
bool isOn);
2075 proto native
void SetSimpleHiddenSelectionState(
int index,
bool state);
2076 proto native
bool IsSimpleHiddenSelectionVisible(
int index);
2079 proto native
void SetObjectTexture(
int index,
string texture_name);
2081 proto native
void SetObjectMaterial(
int index,
string mat_name);
2083 proto native
bool IsPilotLight();
2084 proto native
void SetPilotLight(
bool isOn);
2130 energy_source.GetPersistentID(b1, b2, b3, b4);
2172 if ( !ctx.
Read( f_energy ) )
2177 bool b_is_passive =
false;
2178 if ( !ctx.
Read( b_is_passive ) )
2183 bool b_is_on =
false;
2184 if ( !ctx.
Read( b_is_on ) )
2191 bool b_is_plugged =
false;
2192 if ( !ctx.
Read( b_is_plugged ) )
2196 if ( version <= 103 )
2199 int i_energy_source_ID_low = 0;
2200 if ( !ctx.
Read( i_energy_source_ID_low ) )
2204 int i_energy_source_ID_high = 0;
2205 if ( !ctx.
Read( i_energy_source_ID_high ) )
2215 if ( !ctx.
Read(b1) )
return false;
2216 if ( !ctx.
Read(b2) )
return false;
2217 if ( !ctx.
Read(b3) )
return false;
2218 if ( !ctx.
Read(b4) )
return false;
2237 proto native
void SetSynchDirty();
2246 if (
GetGame().IsMultiplayer() )
2269 string object = energy_source.GetType();
2270 Error(
"Synchronization error! Object " +
object +
" has no instance of the Energy Manager component!");
2291 if ( m_ComponentsBank != NULL )
2295 if ( m_ComponentsBank.IsComponentAlreadyExist(comp_key) )
2297 m_ComponentsBank.GetComponent(comp_key).Event_OnFrame(other, timeSlice);
2305 string text =
string.
Empty;
2307 text +=
"Weight: " + GetWeightEx() +
"\n";
2308 text +=
"Disabled: " + GetIsSimulationDisabled() +
"\n";
2310 text +=
"CE Lifetime default: " + (
int)GetEconomyProfile().GetLifetime() +
"\n";
2311 text +=
"CE Lifetime remaining: " + (
int)GetLifetime() +
"\n";
2318 text +=
"Switched On: " + compEM.
IsSwitchedOn() +
"\n";
2319 text +=
"Is Working: " + compEM.
IsWorking() +
"\n";
2326 void GetDebugButtonNames(out
string button1, out
string button2, out
string button3, out
string button4)
2335 void OnDebugButtonPressClient(
int button_index)
2345 Shape DebugBBoxDraw()
2350 void DebugBBoxSetColor(
int color)
2355 void DebugBBoxDelete()
2360 Shape DebugDirectionDraw(
float distance = 1)
2365 void DebugDirectionSetColor(
int color)
2370 void DebugDirectionDelete()
2376 void HideSelection(
string selection_name )
2380 SetAnimationPhase ( selection_name, 1 );
2385 void ShowSelection(
string selection_name )
2389 SetAnimationPhase ( selection_name, 0 );
2395 proto
void GetPersistentID( out
int b1, out
int b2, out
int b3, out
int b4 );
2398 proto native
void SetLifetime(
float fLifeTime );
2400 proto native
float GetLifetime();
2402 proto native
void IncreaseLifetime();
2405 proto native
void SetLifetimeMax(
float fLifeTime );
2407 proto native
float GetLifetimeMax();
2410 void IncreaseLifetimeUp()
2413 if (GetHierarchyParent())
2414 GetHierarchyParent().IncreaseLifetimeUp();
2441 bool HasEnergyManager()
2452 void OnWork(
float consumed_energy ) {}
2458 void OnSwitchOn() {}
2461 void OnSwitchOff() {}
2464 void OnIsPlugged(
EntityAI source_device) {}
2467 void OnIsUnplugged(
EntityAI last_energy_source ) {}
2470 void OnOwnSocketTaken(
EntityAI device ) {}
2473 void OnOwnSocketReleased(
EntityAI device ) {}
2476 void OnInitEnergy() {}
2487 super.OnRPC(sender, rpc_type, ctx);
2494 case ERPCs.RPC_BS_SKINNED_STATE:
2496 Param1<bool> p_skinned_state=
new Param1<bool>(
false);
2497 if (ctx.
Read(p_skinned_state))
2499 float state = p_skinned_state.param1;
2500 if (state && GetCompBS())
2501 GetCompBS().SetAsSkinnedClient();
2506 case ERPCs.RPC_EXPLODE_EVENT:
2515 #ifdef DIAG_DEVELOPER
2523 int AttachmentsCount = GetInventory().AttachmentCount();
2524 if (AttachmentsCount > 0)
2526 for (i = 0; i < AttachmentsCount; i++)
2528 GetInventory().GetAttachmentFromIndex(i).FixEntity();
2532 CargoBase cargo = GetInventory().GetCargo();
2536 for (i = 0; i < cargoCount; i++)
2545 float GetWetWeightModifier()
2550 float GetConfigWeightModified()
2552 return m_ConfigWeight * GetWetWeightModifier();
2556 string GetConfigWeightModifiedDebugText()
2558 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
2560 return "(" + m_ConfigWeight +
"(config weight) * " + GetWetWeightModifier() +
"(Wetness Modifier))";
2562 return string.Empty;
2570 return GetWeightEx();
2573 void ClearWeightDirty()
2579 void SetWeightDirty()
2582 if (WeightDebug.m_VerbosityFlags & WeightDebugType.SET_DIRTY_FLAG)
2584 Print(
"---------------------------------------");
2585 Print(
"ent:" +
this +
" - SetWeightDirty");
2586 if (WeightDebug.m_VerbosityFlags & WeightDebugType.DUMP_STACK)
2590 Print(
"---------------------------------------");
2594 if (GetHierarchyParent())
2596 GetHierarchyParent().SetWeightDirty();
2600 float GetInventoryAndCargoWeight(
bool forceRecalc =
false)
2606 int AttachmentsCount = GetInventory().AttachmentCount();
2607 if (AttachmentsCount > 0)
2609 for (i = 0; i < AttachmentsCount; i++)
2611 totalWeight += GetInventory().GetAttachmentFromIndex(i).GetWeightEx(forceRecalc);
2615 CargoBase cargo = GetInventory().GetCargo();
2619 for (i = 0; i < cargoCount; i++)
2621 totalWeight += cargo.
GetItem(i).GetWeightEx(forceRecalc);
2630 return GetInventoryAndCargoWeight(forceRecalc);
2635 float GetWeightEx(
bool forceRecalc =
false)
2637 if (m_WeightDirty || forceRecalc)
2643 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
2645 WeightDebug.GetWeightDebug(
this).SetWeight(m_WeightEx);
2647 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_DIRTY)
2649 Print(
"ent:" +
this +
" - Dirty Recalc");
2650 if (WeightDebug.m_VerbosityFlags & WeightDebugType.DUMP_STACK)
2661 void UpdateWeight(WeightUpdateType updateType = WeightUpdateType.FULL,
float weightAdjustment = 0);
2666 int m_ViewIndex = 0;
2669 void SetViewIndex(
int index )
2671 m_ViewIndex = index;
2682 if ( MemoryPointExists(
"invView2" ) )
2684 #ifdef PLATFORM_WINDOWS
2686 GetInventory().GetCurrentInventoryLocation( il );
2717 #ifdef PLATFORM_CONSOLE
2728 Debug.
LogError(
"EntityAI: HitComponentForAI not set properly for that entity (" +
GetType() +
")");
2736 Debug.
LogError(
"EntityAI: DefaultHitComponent not set properly for that entity (" +
GetType() +
")");
2744 Debug.
LogError(
"EntityAI: DefaultHitPositionComponent not set for that entity (" +
GetType() +
")");
2750 Debug.
LogError(
"EntityAI: SuitableFinisherHitComponents not set for that entity (" +
GetType() +
")");
2808 if (m_LastUpdatedTime == 0)
2809 m_LastUpdatedTime = currentTime;
2811 m_ElapsedSinceLastUpdate = currentTime - m_LastUpdatedTime;
2812 m_LastUpdatedTime = currentTime;
2818 ConfigGetTextArray(
"Attachments", slots);
2821 ConfigGetTextArray(
"magazines", mags);
2835 int consumable_count;
2837 for (
int i = 0; i < all_paths.Count(); i++)
2839 config_path = all_paths.Get(i);
2842 for (
int x = 0;
x < children_count;
x++)
2845 path = config_path +
" " + child_name;
2847 bool should_check = 1;
2848 if ( config_path ==
"CfgVehicles" && scope == 0)
2857 for (
int z = 0; z < slots.Count(); z++)
2859 if (slots.Get(z) == inv_slot)
2861 this.GetInventory().CreateInInventory( child_name );
2871 override EntityAI ProcessMeleeItemDamage(
int mode = 0)
2889 void ProcessInvulnerabilityCheck(
string servercfg_param)
2893 int invulnerability;
2894 switch (servercfg_param)
2896 case "disableContainerDamage":
2900 case "disableBaseDamage":
2905 if (invulnerability > 0)
2907 SetAllowDamage(
false);
2912 void SetBayonetAttached(
bool pState,
int slot_idx = -1) {};
2913 bool HasBayonetAttached() {};
2914 int GetBayonetAttachmentIdx() {};
2916 void SetButtstockAttached(
bool pState,
int slot_idx = -1) {};
2917 bool HasButtstockAttached() {};
2918 int GetButtstockAttachmentIdx() {};
2920 void SetInvisibleRecursive(
bool invisible,
EntityAI parent = null,
array<int> attachments = null)
2925 attachmentsArray.Copy(attachments);
2928 for (
int i = 0; i < GetInventory().GetAttachmentSlotsCount(); i++)
2930 attachmentsArray.Insert(GetInventory().GetAttachmentSlotId(i));
2936 foreach(
int slot : attachmentsArray )
2939 item = parent.GetInventory().FindAttachment(slot);
2945 if( item.GetInventory().AttachmentCount() > 0 )
2947 for(i = 0; i < item.GetInventory().GetAttachmentSlotsCount(); i++)
2949 childrenAtt.Insert(item.GetInventory().GetAttachmentSlotId(i));
2952 SetInvisibleRecursive(invisible,item,childrenAtt);
2955 item.SetInvisible(invisible);
2960 void SoundHardTreeFallingPlay()
2966 void SoundSoftTreeFallingPlay()
2972 void SoundHardBushFallingPlay()
2978 void SoundSoftBushFallingPlay()
2984 void RegisterTransportHit(
Transport transport)
2986 if (!m_TransportHitRegistered)
2988 m_TransportHitRegistered =
true;
2995 if (Car.CastTo(car, transport))
2997 if (car.GetSpeedometerAbsolute() > 2 )
2999 damage = m_TransportHitVelocity.
Length();
3000 ProcessDirectDamage(DT_CUSTOM, transport,
"",
"TransportHit",
"0 0 0", damage);
3004 m_TransportHitRegistered =
false;
3010 impulse = 40 * m_TransportHitVelocity;
3011 impulse[1] = 40 * 1.5;
3018 if (m_TransportHitVelocity.
Length() > 0.1)
3020 damage = m_TransportHitVelocity.
Length();
3021 ProcessDirectDamage(DT_CUSTOM, transport,
"",
"TransportHit",
"0 0 0", damage);
3025 m_TransportHitRegistered =
false;
3031 impulse = 40 * m_TransportHitVelocity;
3032 impulse[1] = 40 * 1.5;
3045 bool TranslateSlotFromSelection(
string selection_name, out
int slot_id)
3051 bool IsUniversalTemperatureSource()
3053 return GetUniversalTemperatureSource() != null && GetUniversalTemperatureSource().IsActive();
3056 UTemperatureSource GetUniversalTemperatureSource()
3058 return m_UniversalTemperatureSource;
3061 void SetUniversalTemperatureSource(UTemperatureSource uts)
3063 m_UniversalTemperatureSource = uts;
3066 vector GetUniversalTemperatureSourcePosition()
3080 void SetPersistentPairID(
int id)
3093 void ExecuteActionsConnectedToValve(
int pValveIndex);
3098 private void InitAttachmentExclusionValues()
3101 m_AttachmentExclusionMaskGlobal =
new set<int>;
3102 m_AttachmentExclusionMaskChildren =
new set<int>();
3104 int count = GetInventory().GetSlotIdCount();
3109 InitInherentSlotExclusionMap();
3110 InitGlobalExclusionValues();
3111 InitLegacyConfigExclusionValues();
3115 private void InitInherentSlotExclusionMap()
3117 int count = GetInventory().GetSlotIdCount();
3122 for (
int i = 0; i < count; i++)
3124 slotId = GetInventory().GetSlotId(i);
3125 SetAttachmentExclusionMaskSlot(slotId,GetAttachmentExclusionInitSlotValue(slotId));
3130 protected set<int> GetAttachmentExclusionInitSlotValue(
int slotId)
3132 set<int> dflt =
new set<int>;
3137 protected void InitLegacyConfigExclusionValues()
3139 bool performLegacyInit = InitLegacyExclusionCheck();
3142 InitLegacySlotExclusionValuesImplicit();
3144 if (performLegacyInit)
3145 InitLegacySlotExclusionValuesDerived();
3149 protected bool InitLegacyExclusionCheck()
3152 if (m_AttachmentExclusionMaskGlobal.Count() > 0)
3156 int count = m_AttachmentExclusionSlotMap.Count();
3159 for (
int i = 0; i < count; i++)
3161 int countSet = m_AttachmentExclusionSlotMap.GetElement(i).Count();
3177 protected void InitLegacySlotExclusionValuesImplicit()
3180 int slotCount = GetInventory().GetSlotIdCount();
3181 for (
int i = 0; i < slotCount; i++)
3183 slotId = GetInventory().GetSlotId(i);
3190 tmp.Copy(GetAttachmentExclusionInitSlotValue(slotId));
3191 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_MASK);
3192 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_HEADSTRAP);
3193 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_EYEWEWEAR);
3194 SetAttachmentExclusionMaskSlot(slotId,tmp);
3201 tmp.Copy(GetAttachmentExclusionInitSlotValue(slotId));
3202 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADGEAR);
3203 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADSTRAP);
3204 tmp.Insert(EAttExclusions.LEGACY_MASK_EYEWEWEAR);
3205 SetAttachmentExclusionMaskSlot(slotId,tmp);
3212 tmp.Copy(GetAttachmentExclusionInitSlotValue(slotId));
3213 if (ConfigGetBool(
"isStrap"))
3215 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_HEADGEAR);
3216 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_MASK);
3220 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_HEADGEAR);
3221 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_MASK);
3223 SetAttachmentExclusionMaskSlot(slotId,tmp);
3230 protected void InitLegacySlotExclusionValuesDerived()
3233 int slotCount = GetInventory().GetSlotIdCount();
3234 for (
int i = 0; i < slotCount; i++)
3236 slotId = GetInventory().GetSlotId(i);
3243 tmp.Copy(GetAttachmentExclusionMaskSlot(slotId));
3244 if (ConfigGetBool(
"noNVStrap"))
3246 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_HEADGEAR);
3248 if (ConfigGetBool(
"noMask"))
3250 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADGEAR);
3252 if (ConfigGetBool(
"noEyewear"))
3254 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_HEADGEAR);
3256 SetAttachmentExclusionMaskSlot(slotId,tmp);
3263 tmp.Copy(GetAttachmentExclusionMaskSlot(slotId));
3264 if (ConfigGetBool(
"noNVStrap"))
3266 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_MASK);
3268 if (ConfigGetBool(
"noHelmet"))
3270 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_MASK);
3272 if (ConfigGetBool(
"noEyewear"))
3274 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_MASK);
3276 SetAttachmentExclusionMaskSlot(slotId,tmp);
3283 tmp.Copy(GetAttachmentExclusionMaskSlot(slotId));
3284 if (ConfigGetBool(
"isStrap"))
3286 if (ConfigGetBool(
"noHelmet"))
3288 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_HEADSTRAP);
3290 if (ConfigGetBool(
"noMask"))
3292 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADSTRAP);
3297 if (ConfigGetBool(
"noHelmet"))
3299 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_EYEWEWEAR);
3301 if (ConfigGetBool(
"noMask"))
3303 tmp.Insert(EAttExclusions.LEGACY_MASK_EYEWEWEAR);
3306 SetAttachmentExclusionMaskSlot(slotId,tmp);
3314 protected void InitGlobalExclusionValues();
3317 protected void AddSingleExclusionValueGlobal(EAttExclusions value)
3319 if (m_AttachmentExclusionMaskGlobal.Find(value) == -1)
3320 m_AttachmentExclusionMaskGlobal.Insert(value);
3324 protected void ClearSingleExclusionValueGlobal(EAttExclusions value)
3326 int idx = m_AttachmentExclusionMaskGlobal.Find(value);
3328 m_AttachmentExclusionMaskGlobal.Remove(idx);
3331 protected void SetAttachmentExclusionMaskGlobal(set<int> values)
3333 m_AttachmentExclusionMaskGlobal.Clear();
3334 m_AttachmentExclusionMaskGlobal.Copy(values);
3338 protected void SetAttachmentExclusionMaskSlot(
int slotId, set<int> values)
3340 if (m_AttachmentExclusionSlotMap)
3342 m_AttachmentExclusionSlotMap.Set(slotId,values);
3345 ErrorEx(
"m_AttachmentExclusionSlotMap not available! Fill the 'inventorySlot[]' in the " +
this +
" config file.");
3348 private void PropagateExclusionValueRecursive(set<int> values,
int slotId)
3350 if (values && values.Count() != 0)
3354 GetInventory().GetCurrentInventoryLocation(lcn);
3355 if (CheckExclusionAccessPropagation(lcn.
GetSlot(), slotId, values, passThis))
3357 m_AttachmentExclusionMaskChildren.InsertSet(passThis);
3358 EntityAI parent = GetHierarchyParent();
3360 parent.PropagateExclusionValueRecursive(passThis,lcn.
GetSlot());
3365 private void ClearExclusionValueRecursive(set<int> values,
int slotId)
3367 if (values && values.Count() != 0)
3371 GetInventory().GetCurrentInventoryLocation(lcn);
3372 if (CheckExclusionAccessPropagation(lcn.
GetSlot(), slotId, values, passThis))
3374 int count = passThis.Count();
3375 for (
int i = 0; i < count; i++)
3377 m_AttachmentExclusionMaskChildren.RemoveItem(passThis[i]);
3379 EntityAI parent = GetHierarchyParent();
3381 parent.ClearExclusionValueRecursive(passThis,lcn.
GetSlot());
3387 set<int> GetAttachmentExclusionMaskAll(
int slotId)
3389 set<int> values =
new set<int>();
3390 set<int> slotValues = GetAttachmentExclusionMaskSlot(slotId);
3392 values.InsertSet(slotValues);
3393 values.InsertSet(m_AttachmentExclusionMaskGlobal);
3394 values.InsertSet(m_AttachmentExclusionMaskChildren);
3400 set<int> GetAttachmentExclusionMaskSlot(
int slotId)
3402 return m_AttachmentExclusionSlotMap.Get(slotId);
3406 set<int> GetAttachmentExclusionMaskGlobal()
3408 return m_AttachmentExclusionMaskGlobal;
3412 set<int> GetAttachmentExclusionMaskChildren()
3414 return m_AttachmentExclusionMaskChildren;
3418 private bool HasInternalExclusionConflicts(
int targetSlot)
3420 set<int> targetSlotValues = GetAttachmentExclusionMaskSlot(targetSlot);
3421 if (targetSlotValues)
3423 set<int> additionalValues =
new set<int>();
3424 additionalValues.InsertSet(GetAttachmentExclusionMaskGlobal());
3425 additionalValues.InsertSet(GetAttachmentExclusionMaskChildren());
3427 int countTarget = targetSlotValues.Count();
3428 for (
int i = 0; i < countTarget; i++)
3430 if (additionalValues.Find(targetSlotValues[i]) != -1)
3440 protected bool IsExclusionFlagPresent(set<int> values)
3444 GetInventory().GetCurrentAttachmentSlotInfo(slotId,slotName);
3446 set<int> currentSlotValuesAll = GetAttachmentExclusionMaskAll(slotId);
3447 int count = values.Count();
3448 for (
int i = 0; i < count; i++)
3450 if (currentSlotValuesAll.Find(values[i]) != -1)
3457 protected bool IsExclusionFlagPresentRecursive(set<int> values,
int targetSlot)
3459 if (values && values.Count() != 0)
3462 GetInventory().GetCurrentInventoryLocation(lcn);
3463 EntityAI parent = GetHierarchyParent();
3465 if (CheckExclusionAccessCondition(lcn.
GetSlot(),targetSlot, values, passThis))
3467 if (parent && parent !=
this)
3469 return parent.IsExclusionFlagPresentRecursive(passThis,lcn.
GetSlot());
3472 return IsExclusionFlagPresent(passThis);
3479 protected bool CheckExclusionAccessCondition(
int occupiedSlot,
int targetSlot, set<int> value, inout set<int> adjustedValue)
3484 if (occupiedException)
3486 adjustedValue = value;
3490 if (targetException)
3492 adjustedValue = null;
3496 AdjustExclusionAccessCondition(occupiedSlot,targetSlot,value,adjustedValue);
3497 return adjustedValue.Count() != 0;
3501 protected void AdjustExclusionAccessCondition(
int occupiedSlot,
int testedSlot, set<int> value, inout set<int> adjustedValue)
3503 adjustedValue = value;
3507 protected bool CheckExclusionAccessPropagation(
int occupiedSlot,
int targetSlot, set<int> value, inout set<int> adjustedValue)
3512 if (targetException)
3514 adjustedValue = null;
3518 AdjustExclusionAccessPropagation(occupiedSlot,targetSlot,value,adjustedValue);
3519 return adjustedValue.Count() != 0;
3523 protected void AdjustExclusionAccessPropagation(
int occupiedSlot,
int testedSlot, set<int> value, inout set<int> adjustedValue)
3525 AdjustExclusionAccessCondition(occupiedSlot,testedSlot,value,adjustedValue);
3544void SetDebugDeveloper_item(
Object entity)
3547 entity.SetDebugItem();
enum EWetnessLevel BUSH_SOFT
enum EWetnessLevel HIDE_HANDS_SLOT
enum EWetnessLevel UPDATE
enum EWetnessLevel HIDE_VICINITY
enum EWetnessLevel DETACHING
enum EWetnessLevel BUSH_HARD
enum EWetnessLevel LeftFrontLimb
enum EWetnessLevel REMOVE
enum EWetnessLevel RECURSIVE_ADD
enum EWetnessLevel TREE_HARD
enum EWetnessLevel TREE_SOFT
enum EWetnessLevel ALWAYS
icon visibility, meant to be used in a bitmask
enum EWetnessLevel HIDE_PLAYER_CONTAINER
enum EWetnessLevel RightFrontLimb
enum EWetnessLevel LeftBackLimb
enum EWetnessLevel ATTACHING
eBleedingSourceType GetType()
protected bool IsDamageDestroyed(ActionTarget target)
override bool ReplaceOnDeath()
override ArrowManagerBase GetArrowManager()
override string GetDeadItemName()
override bool IsRefresherSignalingViable()
override bool KeepHealthOnReplace()
override bool IgnoreOutOfReachCondition()
override void EEItemDetached(EntityAI item, string slot_name)
override bool CanPutIntoHands(EntityAI parent)
override int GetHideIconMask()
override bool CanRemoveFromCargo(EntityAI parent)
override void EEItemAttached(EntityAI item, string slot_name)
override string GetInvulnerabilityTypeString()
class RecipeCacheData int
override vector GetDefaultHitPosition()
override float GetLiquidThroughputCoef()
proto native CEApi GetCEApi()
Get the CE API.
const int ECE_OBJECT_SWAP
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
override bool CanDisplayAttachmentCategory(string category_name)
override void EEHitByRemote(int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos)
override void OnDamageDestroyed(int oldLevel)
override bool IsInitialized()
override bool CanLoadItemIntoCargo(EntityAI item)
override bool CanLoadAttachment(EntityAI attachment)
map< string, ref array< string > > DamageZoneMap
override bool IsManagingArrows()
override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
override void OnCEUpdate()
override void EEKilled(Object killer)
override void EEDelete(EntityAI parent)
override void UnpairRemote()
override bool IsTakeable()
override void OnDebugButtonPressServer(int button_index)
override void OnAttachmentRuined(EntityAI attachment)
override bool CanReleaseAttachment(EntityAI attachment)
override bool DisassembleOnLastDetach()
override bool IsPrepareToDelete()
override void EECargoOut(EntityAI item)
override void GetDebugButtonNames(out string button1, out string button2, out string button3, out string button4)
override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
override bool HasFlammableMaterial()
override protected bool CanBeIgnitedBy(EntityAI igniter=NULL)
override protected void OnIgnitedThis(EntityAI fire_source)
Executed on Server when some item ignited this one.
class Hatchback_02_Blue extends Hatchback_02 OnDebugSpawn
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override bool IsHologram()
override void EECargoIn(EntityAI item)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override void AddTemperature(float value)
override float GetTemperatureMax()
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
override void InsertAgent(int agent, float count=1)
override bool CanBeSplit()
override float GetWetMax()
override bool CanDisplayCargo()
override bool CanReceiveItemIntoCargo(EntityAI item)
override protected float GetWeightSpecialized(bool forceRecalc=false)
override string ChangeIntoOnAttach(string slot)
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
override void RemoveAgent(int agent_id)
override void RemoveAllAgents()
override float GetQuantity()
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnWetChanged(float newVal, float oldVal)
override string GetAttachmentSoundType()
override string ChangeIntoOnDetach()
override void OnEnergyAdded()
override float GetWetInit()
override bool IsBeingPlaced()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void SetTemperature(float value, bool allow_client=false)
override void SetWetMax()
override void SetTakeable(bool pState)
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override float GetTemperature()
override void SetWet(float value, bool allow_client=false)
override bool IsOneHandedBehaviour()
override void SetQuantityToMinimum()
override float GetWetMin()
override int GetQuickBarBonus()
override void EEOnAfterLoad()
override float GetTemperatureInit()
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
override void RemoveAllAgentsExcept(int agents_to_keep_mask)
override void AddWet(float value)
override void OnMovedInsideCargo(EntityAI container)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsHeavyBehaviour()
override void OnWasAttached(EntityAI parent, int slot_id)
override void OnPlacementStarted(Man player)
override int GetTargetQuantityMax(int attSlotID=-1)
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override float GetTemperatureMin()
override void SetTemperatureMax()
override EWetnessLevel GetWetLevel()
override bool IsTwoHandedBehaviour()
override int GetQuantityMax()
override void OnEnergyConsumed()
override void OnVariablesSynchronized()
override bool HasTurnableValveBehavior()
override bool IsValveTurnable(int pValveIndex)
override int GetTurnableValveIndex(int pComponentIndex)
void LogWarning(string message, LogTemplateID template_id=0)
Creates warning log (optional) from LogTemplate which are registred.
class LogTemplates Log(string message, LogTemplateID template_id=0)
Creates debug log (optional) from LogTemplate which are registred.
void LogError(string message, LogTemplateID template_id=0)
Creates error log (optional) from LogTemplate which are registred.
override void OnWorkStop()
void OnStoreSave(ParamsWriteContext ctx)
bool OnStoreLoad(ParamsReadContext ctx, int version)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
override void PairRemote(notnull EntityAI trigger)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override bool CanPutInCargo(EntityAI parent)
override void OnWork(float consumed_energy)
override void OnWorkStart()
void OnRPC(float stamina, float stamina_cap, bool cooldown)
deprecated use, StaminaHandler uses SyncJunctures now
protected override void EOnFrame(IEntity other, float timeSlice)
override bool DoPlacingHeightCheck()
override bool CanDisplayAttachmentSlot(int slot_id)
override void OnPlacementCancelled(Man player)
override bool CanBePlaced(Man player, vector position)
override bool CanRemoveFromHands(EntityAI parent)
protected bool m_Initialized
class JsonUndergroundAreaTriggerData GetPosition
void OnEntityKilled(Object killer, EntityAI target)
AnalyticsManagerServer GetAnalyticsServer()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native DayZPlayer GetPlayer()
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto native bool ConfigIsExisting(string path)
bool FormatRawConfigStringKeys(inout string value)
Changes localization key format to script-friendly format.
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native EntityAI GetEntityByPersitentID(int b1, int b2, int b3, int b4)
proto native float GetTickTime()
Returns current time from start of the game.
represents base for cargo storage for entities
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
static bool GetDisableBaseDamage()
static array< float > GetWetnessWeightModifiers()
static bool GetDisableContainerDamage()
void StoreEnergySourceIDs(int b1, int b2, int b3, int b4)
int GetEnergySourceStorageIDb2()
void SwitchOff()
Energy manager: Switches OFF the device.
bool IsPlugged()
Energy manager: Returns true if this device is plugged into some other device (even if they are OFF o...
float GetEnergy()
Energy manager: Returns the amount of stored energy this device has.
bool GetRestorePlugState()
EntityAI GetEnergySource()
Energy manager: Returns the energy source this device is plugged into.
void OnAttachmentAdded(EntityAI elec_device)
void UnplugThis()
Energy manager: Unplugs this device from its power source.
void SwitchOn()
Energy manager: Switches ON the device so it starts doing its work if it has enough energy.
void SetEnergy(float new_energy)
Energy manager: Sets stored energy for this device. It ignores the min/max limit!
int GetEnergySourceStorageIDb4()
void HandleMoveInsideCargo(EntityAI container)
int GetEnergySourceNetworkIDHigh()
bool IsWorking()
Energy manager: Returns true if this device is working right now.
void UnplugAllDevices()
Energy manager: Unplugs everything directly connected to this device.
void RestorePlugState(bool state)
void OnAttachmentRemoved(EntityAI elec_device)
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...
float GetCordLength()
Energy manager: Returns the length of the virtual power cord.
int GetEnergySourceStorageIDb1()
int GetEnergySourceNetworkIDLow()
int GetEnergySourceStorageIDb3()
bool GetPreviousSwitchState()
void SetPassiveState(bool state=true)
Energy manager: Changes the status of this device. When it's passive (true), the main timer and OnWor...
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....
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.
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.
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.
void OnHealthLevelChanged(notnull EntityAI entity, int oldLevel, int newLevel, string zone)
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
override bool LocalTakeEntityToCargo(notnull EntityAI item)
override bool PredictiveTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
override bool IsInventoryVisible()
override bool LocalTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
override bool ServerTakeEntityAsAttachment(notnull EntityAI item)
override bool PredictiveTakeEntityToCargo(notnull EntityAI item)
override bool ServerTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
override bool CanDropEntity(notnull EntityAI item)
override bool ServerTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
override bool LocalTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
override bool PredictiveDropEntity(notnull EntityAI item)
override bool LocalTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
override bool PredictiveTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
override bool PredictiveTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
override bool ServerTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
override bool PredictiveTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
override bool PredictiveTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
override bool LocalTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
override int GetMeleeTargetType()
override bool PredictiveTakeEntityAsAttachment(notnull EntityAI item)
override bool ServerTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
override bool LocalDropEntity(notnull EntityAI item)
override bool PredictiveTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
override bool ServerTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
override bool IsIgnoredByConstruction()
override bool LocalTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
override bool ServerTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
override bool ServerTakeEntityToCargo(notnull EntityAI item)
override bool ServerTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
override bool LocalTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
override bool PredictiveTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
override bool PredictiveTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
override bool LocalTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
override bool LocalTakeEntityAsAttachment(notnull EntityAI item)
override bool LocalTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
override bool ServerDropEntity(notnull EntityAI item)
script counterpart to engine's class Inventory
int GetHiddenSelectionIndex(string selection)
proto native int GetType()
returns type of InventoryLocation
proto native bool IsValid()
verify current set inventory location
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
proto native int GetSlot()
returns slot id if current type is Attachment
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
static proto native bool GetShowForSlotId(int slot_Id)
const int INVALID
Invalid slot (-1)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
The class that will be instanced (moddable)
void SetPersistentPairID(int id)
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.
proto void CallLater(func fn, int delay=0, bool repeat=false, 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)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto void Call(func fn, 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)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
ScriptInvoker Class provide list of callbacks usage:
Serialization general interface. Serializer API works with:
proto bool Write(void value_out)
proto bool Read(void value_in)
Base native class for all motorized wheeled vehicles.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native float Length()
Returns length of vector (magnitude)
override bool CanAssignToQuickbar()
string GetDefaultHitComponent()
string GetDefaultHitPositionComponent()
string GetHitComponentForAI()
array< string > GetSuitableFinisherHitComponents()
proto native CGame GetGame()
const int COMP_TYPE_BODY_STAGING
const int COMP_TYPE_COUNT
const int COMP_TYPE_ENERGY_MANAGER
const int COMP_TYPE_ETITY_DEBUG
void Error(string err)
Messagebox with error message.
proto void DumpStack()
Prints current call stack (stack trace)
proto void Print(void var)
Prints content of variable to console/log.
bool IsPendingDeletion()
Get whether the Effect is queued up for being cleaned up.
const int REFRESHER_FREQUENCY_DEFAULT
const float MELEE_ITEM_DAMAGE
array< string > TStringArray
const float STATE_SOAKING_WET
const float STATE_DRENCHED
const float LIQUID_THROUGHPUT_DEFAULT
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto native bool dBodyIsActive(notnull IEntity ent)
proto void dBodyApplyImpulse(notnull IEntity body, vector impulse)
Applies impuls on a rigidbody (origin)
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.
static const string Empty