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,
80 SHAVING_EYEWEAR_ATT_0,
87 static DebugSpawnParams
None()
89 DebugSpawnParams params =
new DebugSpawnParams();
90 params.m_Player = null;
94 static DebugSpawnParams WithPlayer(Man player)
96 DebugSpawnParams params =
new DebugSpawnParams();
97 params.m_Player = player;
102class TSelectableActionInfoArrayEx
extends array<ref Param> {}
205 float m_LastFTChangeTime;;
206 float m_PresumedTimeRemaining;
213 string param_access_energy_sys =
"CfgVehicles " + type +
" EnergyManager ";
214 bool is_electic_device =
g_Game.ConfigIsExisting(param_access_energy_sys);
216 if (is_electic_device)
261 if (ConfigIsExisting(
"varTemperatureFreezePoint"))
266 if (ConfigIsExisting(
"varTemperatureThawPoint"))
273 if (ConfigIsExisting(
"varTemperatureOverheatTime"))
278 if (ConfigIsExisting(
"varHeatPermeabilityCoef"))
309 return EInventoryIconVisibility.ALWAYS;
366 int frequency =
GetCEApi().GetCEGlobalInt(
"FlagRefreshFrequency");
367 if ( frequency <= 0 )
372 if ( frequency <= lifetime )
390 override void SetDebugItem()
392 super.SetDebugItem();
410 string component_name;
416 else if ( IsMagazine() )
425 path_base =
string.
Format(
"%1 %2 DamageSystem DamageZones", path_base,
GetType() );
427 if ( !
g_Game.ConfigIsExisting(path_base) )
430 g_Game.FormatRawConfigStringKeys(component_name);
436 GetDamageZones( zone_names );
438 for (
int i = 0; i < zone_names.Count(); i++ )
440 path =
string.Format(
"%1 %2 displayName", path_base, zone_names[i] );
444 g_Game.FormatRawConfigStringKeys(component_name);
479 void Log(
string msg,
string fnc_name =
"n/a")
527 string basePath =
string.Format(
"cfgVehicles %1 Skinning BloodInfectionSettings",
GetType());
528 if (
g_Game.ConfigIsExisting(basePath))
532 float value =
g_Game.ConfigGetFloat(
string.Format(
"%1 %2 chance", basePath, agentName));
561 return m_EM.IsWorking();
682 if(!cargo)
return false;
746 return IsDamageDestroyed();
751 if (ai && ai.IsBeingBackstabbed())
758 return !IsDamageDestroyed();
814 if (super.CanBeActionTarget())
852 Debug.
Log(
"TryDelete - not ready for deletion");
856 if (
g_Game.HasInventoryJunctureItem(
this))
858 Debug.
Log(
"TryDelete - deferred call");
864 Debug.
Log(
"TryDelete - OnBeforeTryDelete end");
866 Debug.
Log(
"TryDelete - DeleteSafe end");
913 GameInventory attachmentInventory = attachment.GetInventory();
914 if ( attachmentInventory.
GetCargo() )
940 m_EM.OnDeviceDestroyed();
945 super.OnExplosionEffects(source, directHit, componentIndex, surface, pos, surfNormal, energyFactor, explosionFactor, isWater, ammoType);
947 g_Game.GetWorld().AddEnvShootingSource(pos, 1.0);
951 m_DestructionBehaviourObj.OnExplosionEffects(source, directHit, componentIndex, surface, pos, surfNormal, energyFactor, explosionFactor, isWater, ammoType);
964 EntityAI oldOwner = oldLoc.GetParent();
965 EntityAI newOwner = newLoc.GetParent();
976 Error(
"EntityAI::EEItemLocationChanged - detached, but oldOwner is null");
984 Error(
"EntityAI::EEItemLocationChanged - attached, but newOwner is null");
990 player = Man.Cast(oldOwner);
991 player.OnItemInHandsChanged();
992 player.GetCachedEquipment().OnItemCargoOut(
this);
997 player = Man.Cast(newOwner);
998 player.OnItemInHandsChanged();
999 player.GetCachedEquipment().OnItemCargoIn(
this);
1014 if (newParent == null)
1036 parent.OnAttachmentRuined(
this);
1069 ErrorEx(
"Incorrect destruction behaviour type, make sure the class returned in 'GetDestructionBehaviour()' is a valid type inheriting from 'DestructionEffectBase'");
1083 g_Game.GetAnalyticsServer().OnEntityKilled(killer,
this);
1109 dead_entity.SetHealth(GetHealth());
1141 player.GetCachedEquipment().OnItemAttached(item, slotId,
this);
1149 m_ComponentsBank.GetComponent(comp_key).Event_OnItemAttached(item, slot_name);
1155 if (
m_EM && item.GetCompEM())
1156 m_EM.OnAttachmentAdded(item);
1181 player.GetCachedEquipment().OnItemDetached(item, slotId,
this);
1189 m_ComponentsBank.GetComponent(comp_key).Event_OnItemDetached(item, slot_name);
1195 if (
m_EM && item.GetCompEM())
1196 m_EM.OnAttachmentRemoved(item);
1215 Man player = item.GetHierarchyRootPlayer();
1217 player.GetCachedEquipment().OnItemCargoIn(item);
1218 item.OnMovedInsideCargo(
this);
1228 Man player = item.GetHierarchyRootPlayer();
1230 player.GetCachedEquipment().OnItemCargoOut(item);
1231 item.OnRemovedFromCargo(
this);
1238 item.OnMovedWithinCargo(
this);
1337 m_EM.HandleMoveInsideCargo(container);
1357 if (
m_EM &&
m_EM.GetRestorePlugState() )
1359 int b1 =
m_EM.GetEnergySourceStorageIDb1();
1360 int b2 =
m_EM.GetEnergySourceStorageIDb2();
1361 int b3 =
m_EM.GetEnergySourceStorageIDb3();
1362 int b4 =
m_EM.GetEnergySourceStorageIDb4();
1365 EntityAI potential_energy_source =
g_Game.GetEntityByPersitentID(b1, b2, b3, b4);
1372 bool is_attachment =
false;
1374 if (potential_energy_source)
1375 is_attachment =
GetInventory().HasAttachment(potential_energy_source);
1377 if ( !is_attachment && potential_energy_source )
1378 is_attachment = potential_energy_source.GetInventory().HasAttachment(
this);
1380 if ( potential_energy_source && potential_energy_source.GetCompEM() && !is_attachment )
1381 m_EM.PlugThisInto(potential_energy_source);
1405 string cfg_path =
"cfgVehicles " +
GetType() +
" AnimationSources";
1407 if (
g_Game.ConfigIsExisting(cfg_path) )
1409 int selections =
g_Game.ConfigGetChildrenCount(cfg_path);
1411 for (
int i = 0; i < selections; i++)
1413 string selection_name;
1414 g_Game.ConfigGetChildName(cfg_path, i, selection_name);
1423 string cfg_path =
"cfgVehicles " +
GetType() +
" AnimationSources";
1425 if (
g_Game.ConfigIsExisting(cfg_path) )
1427 int selections =
g_Game.ConfigGetChildrenCount(cfg_path);
1429 for (
int i = 0; i < selections; i++)
1431 string selection_name;
1432 g_Game.ConfigGetChildName(cfg_path, i, selection_name);
1488 GameInventory attachmentInventory = attachment.GetInventory();
1489 if (attachmentInventory)
1526 return att.CanBeCombined(e,
true, stack_max_limit);
1661 int attachmentDepth = 0;
1664 if (ent.GetInventory().GetCurrentInventoryLocation(lcn) && lcn.
IsValid())
1679 ent = ent.GetHierarchyParent();
1739 Debug.
LogWarning(
"Obsolete function - use CanDisplayAttachmentSlot with slot id parameter");
1760 for (
int i = 0; i < count; ++i)
1821 SetInvisible(
false);
1822 OnInvisibleSet(
false);
1892 GetInventory().GetCurrentInventoryLocation( inventory_location );
1894 return parent.GetInventory().GetSlotLock( inventory_location.
GetSlot() );
1905 if (
g_Game.IsMultiplayer() )
1920 if (
g_Game.IsMultiplayer() )
1938 if (
g_Game.IsMultiplayer() )
1954 if (
g_Game.IsMultiplayer() )
1972 if (
g_Game.IsMultiplayer() )
1984 if (
g_Game.IsMultiplayer() )
2002 if (
g_Game.IsMultiplayer() )
2018 if (
g_Game.IsMultiplayer() )
2034 if (
g_Game.IsMultiplayer() )
2050 if (
g_Game.IsMultiplayer() )
2069 if (
g_Game.IsMultiplayer())
2105 for (
int i = 0; i < nAttachment; ++i )
2108 if ( attachment && attachment.IsInherited( type ) )
2121 for (
int i = 0; i < nAttachment; ++i )
2124 if ( attachment.IsKindOf ( type ) )
2180 void SetWet(
float value,
bool allow_client =
false);
2242 bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true);
2288 bool isParentAliveOrganism =
false;
2289 if (rootParent && rootParent !=
this)
2290 isParentAliveOrganism = (rootParent.
IsMan() || rootParent.IsAnimal() || rootParent.IsZombie()) && rootParent.IsAlive();
2296 else if (isParentAliveOrganism)
2345 m_LastFTChangeTime = -1;
2346 m_PresumedTimeRemaining = -1;
2351 Debug.
Log(
"SetTemperatureEx | entity " +
this +
" does not have temperature range defined!");
2355 if (!
m_TAC.TryAccessSource(data))
2436 Debug.
Log(
"RefreshTemperatureAccess | entity " +
this +
" does not have temperature range defined!");
2440 m_TAC.TryAccessSource(data);
2549 if (previous != frozen)
2559 float progressDelta = 1;
2569 if (progressDelta == 0)
2572 float changeTimeDefault;
2573 float changeTimeMin;
2592 changeTimeDefault *= 1/coef;
2595 progressVal = progressVal + progressDelta / changeTime;
2597 float remnantTemp = 0;
2601 if (progressVal > 1.0)
2606 remnantTemp = (((progressVal - 1) * changeTime) / progressDelta) * deltaHeat;
2612 if (progressVal < 0.0)
2617 remnantTemp = ((-progressVal * changeTime) / progressDelta) * deltaHeat;
2632 if (progressVal > 0 && progressVal < 1)
2634 m_LastFTChangeTime = changeTime;
2636 m_PresumedTimeRemaining = (1 - progressVal) * changeTime;
2638 m_PresumedTimeRemaining = progressVal * changeTime;
2687 else if (previous >= 1)
2700 float deltaTime = 1;
2714 progressVal += deltaTime / changeTime;
2720 else if (deltaHeat > 0)
2778 Error(
"Attempting to change variable client side, variables are supposed to be changed on server only !!");
2807 return super.GetHiddenSelections();
2816 return super.GetHiddenSelectionsTextures();
2825 return super.GetHiddenSelectionsMaterials();
2952 energy_source.GetPersistentID(b1, b2, b3, b4);
2996 if ( !ctx.
Read( f_energy ) )
2998 m_EM.SetEnergy(f_energy);
3001 bool b_is_passive =
false;
3002 if ( !ctx.
Read( b_is_passive ) )
3004 m_EM.SetPassiveState(b_is_passive);
3007 bool b_is_on =
false;
3008 if ( !ctx.
Read( b_is_on ) )
3015 bool b_is_plugged =
false;
3016 if ( !ctx.
Read( b_is_plugged ) )
3020 if ( version <= 103 )
3023 int i_energy_source_ID_low = 0;
3024 if ( !ctx.
Read( i_energy_source_ID_low ) )
3028 int i_energy_source_ID_high = 0;
3029 if ( !ctx.
Read( i_energy_source_ID_high ) )
3039 if ( !ctx.
Read(b1) )
return false;
3040 if ( !ctx.
Read(b2) )
return false;
3041 if ( !ctx.
Read(b3) )
return false;
3042 if ( !ctx.
Read(b4) )
return false;
3047 m_EM.StoreEnergySourceIDs( b1, b2, b3, b4 );
3048 m_EM.RestorePlugState(
true);
3078 if (
g_Game.IsMultiplayer() )
3080 bool is_on =
m_EM.IsSwitchedOn();
3082 if (is_on !=
m_EM.GetPreviousSwitchState())
3090 int id_low =
m_EM.GetEnergySourceNetworkIDLow();
3091 int id_High =
m_EM.GetEnergySourceNetworkIDHigh();
3101 string object = energy_source.GetType();
3102 Error(
"Synchronization error! Object " +
object +
" has no instance of the Energy Manager component!");
3105 m_EM.PlugThisInto(energy_source);
3113 m_EM.DeviceUpdate();
3114 m_EM.StartUpdates();
3169 ctx.
Write(varFlags);
3184 if (!ctx.
Read(varFlags))
3220 if (!ctx.
Read(intValue))
3228 if (!ctx.
Read(value))
3232 if (!ctx.
Read(intValue))
3258 int mask =
Math.
Round(floats.Get(index));
3264 float temperature = floats.Get(index);
3266 floats.RemoveOrdered(index);
3268 bool frozen =
Math.
Round(floats.Get(index));
3270 floats.RemoveOrdered(index);
3272 float FTProgress = floats.Get(index);
3274 floats.RemoveOrdered(index);
3298 string text =
string.
Empty;
3301 text +=
"Disabled: " + GetIsSimulationDisabled() +
"\n";
3312 text +=
"Switched On: " + compEM.
IsSwitchedOn() +
"\n";
3313 text +=
"Is Working: " + compEM.
IsWorking() +
"\n";
3360 SetAnimationPhase ( selection_name, 1 );
3369 SetAnimationPhase ( selection_name, 0 );
3467 super.OnRPC(sender, rpc_type, ctx);
3474 case ERPCs.RPC_BS_SKINNED_STATE:
3476 Param1<bool> p_skinned_state=
new Param1<bool>(
false);
3477 if (ctx.
Read(p_skinned_state))
3479 float state = p_skinned_state.param1;
3486 case ERPCs.RPC_EXPLODE_EVENT:
3495 #ifdef DIAG_DEVELOPER
3498 if (!(
g_Game.IsServer()))
3507 for (i = 0; i < AttachmentsCount; ++i)
3512 CargoBase cargo = inventory.
GetCargo();
3516 for (i = 0; i < cargoCount; ++i)
3536 string GetConfigWeightModifiedDebugText()
3538 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3540 return "(" + m_ConfigWeight +
"(config weight) * " + GetWetWeightModifier() +
"(Wetness Modifier))";
3542 return string.Empty;
3562 if (WeightDebug.m_VerbosityFlags & WeightDebugType.SET_DIRTY_FLAG)
3564 Print(
"---------------------------------------");
3565 Print(
"ent:" +
this +
" - SetWeightDirty");
3566 if (WeightDebug.m_VerbosityFlags & WeightDebugType.DUMP_STACK)
3570 Print(
"---------------------------------------");
3588 for (i = 0; i < AttachmentsCount; ++i)
3597 for (i = 0; i < cargoCount; ++i)
3599 totalWeight += cargo.
GetItem(i).GetWeightEx(forceRecalc);
3621 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
3623 WeightDebug.GetWeightDebug(
this).SetWeight(
m_WeightEx);
3625 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_DIRTY)
3627 Print(
"ent:" +
this +
" - Dirty Recalc");
3628 if (WeightDebug.m_VerbosityFlags & WeightDebugType.DUMP_STACK)
3639 void UpdateWeight(WeightUpdateType updateType = WeightUpdateType.FULL,
float weightAdjustment = 0);
3659 if (action_id ==
EActions.FIX_ENTITY)
3661 #ifdef DIAG_DEVELOPER
3665 else if (action_id ==
EActions.GET_TOTAL_WEIGHT)
3667 WeightDebug.ClearWeightDebug();
3669 Debug.
Log(
"======================== "+
GetType() +
" =================================");
3673 Debug.
Log(
"----------------------------------------------------------------------------------------------");
3675 else if (action_id ==
EActions.GET_TOTAL_WEIGHT_RECALC)
3677 WeightDebug.ClearWeightDebug();
3678 WeightDebug.SetVerbosityFlags(WeightDebugType.RECALC_FORCED);
3680 Debug.
Log(
"======================== "+
GetType() +
" RECALC ===========================");
3684 WeightDebug.PrintAll(
this);
3685 Debug.
Log(
"----------------------------------------------------------------------------------------------");
3686 WeightDebug.SetVerbosityFlags(0);
3688 else if (action_id ==
EActions.GET_PLAYER_WEIGHT)
3690 WeightDebug.ClearWeightDebug();
3692 Debug.
Log(
"======================== PLAYER: "+player+
" ===========================");
3694 Debug.
Log(
"New overall weight Player:"+player.GetWeightEx().ToString());
3696 Debug.
Log(
"----------------------------------------------------------------------------------------------");
3698 else if (action_id ==
EActions.GET_PLAYER_WEIGHT_RECALC)
3700 WeightDebug.ClearWeightDebug();
3701 WeightDebug.SetVerbosityFlags(WeightDebugType.RECALC_FORCED);
3703 Debug.
Log(
"======================== PLAYER RECALC: "+player+
" ===========================");
3705 Debug.
Log(
"New overall weight Player:"+player.GetWeightEx(
true).ToString());
3706 WeightDebug.PrintAll(player);
3707 Debug.
Log(
"----------------------------------------------------------------------------------------------");
3708 WeightDebug.SetVerbosityFlags(0);
3732 if ( MemoryPointExists(
"invView2" ) )
3734 #ifdef PLATFORM_WINDOWS
3767 #ifdef PLATFORM_CONSOLE
3778 Debug.
LogError(
"EntityAI: HitComponentForAI not set properly for that entity (" +
GetType() +
")");
3786 Debug.
LogError(
"EntityAI: DefaultHitComponent not set properly for that entity (" +
GetType() +
")");
3794 Debug.
LogError(
"EntityAI: DefaultHitPositionComponent not set for that entity (" +
GetType() +
")");
3800 Debug.
LogError(
"EntityAI: SuitableFinisherHitComponents not set for that entity (" +
GetType() +
")");
3868 float currentTime =
g_Game.GetTickTime();
3881 if (
g_Game.IsWorldWetTempUpdateEnabled())
3885 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
3888 float heatPermCoef = 1.0;
3892 heatPermCoef *= ent.GetHeatPermeabilityCoef();
3893 ent = ent.GetHierarchyParent();
3910 ConfigGetTextArray(
"Attachments", slots);
3913 ConfigGetTextArray(
"magazines", mags);
3927 int consumable_count;
3929 for (
int i = 0; i < all_paths.Count(); i++)
3931 config_path = all_paths.Get(i);
3932 int children_count =
g_Game.ConfigGetChildrenCount(config_path);
3934 for (
int x = 0;
x < children_count;
x++)
3936 g_Game.ConfigGetChildName(config_path,
x, child_name);
3937 path = config_path +
" " + child_name;
3938 scope =
g_Game.ConfigGetInt( config_path +
" " + child_name +
" scope" );
3939 bool should_check =
true;
3940 if ( config_path ==
"CfgVehicles" && scope == 0)
3942 should_check =
false;
3948 g_Game.ConfigGetText( config_path +
" " + child_name +
" inventorySlot",inv_slot );
3949 for (
int z = 0; z < slots.Count(); z++)
3951 if (slots.Get(z) == inv_slot)
3985 int invulnerability;
3986 switch (servercfg_param)
3988 case "disableContainerDamage":
3992 case "disableBaseDamage":
3997 if (invulnerability > 0)
3999 SetAllowDamage(
false);
4017 attachmentsArray.Copy(attachments);
4022 for (
int i = 0; i < nAttachmentSlots; ++i)
4032 parentInventory = parent.GetInventory();
4034 foreach(
int slot : attachmentsArray )
4036 if( parentInventory )
4045 if( nAttachment > 0 )
4048 for(i = 0; i < nAttachmentSlots2; ++i)
4056 item.SetInvisible(invisible);
4057 item.OnInvisibleSet(invisible);
4098 if (
Car.CastTo(car, transport))
4100 if (car.GetSpeedometerAbsolute() > 2 )
4103 ProcessDirectDamage(DT_CUSTOM, transport,
"",
"TransportHit",
"0 0 0", damage);
4111 if (IsDamageDestroyed() && car.GetSpeedometerAbsolute() > 3)
4114 impulse[1] = 40 * 1.5;
4118 else if (Boat.CastTo(boat, transport))
4130 ProcessDirectDamage(DT_CUSTOM, transport,
"",
"TransportHit",
"0 0 0", damage);
4141 ProcessDirectDamage(DT_CUSTOM, transport,
"",
"TransportHit",
"0 0 0", damage);
4152 impulse[1] = 40 * 1.5;
4243 for (
int i = 0; i < count; ++i)
4253 set<int> dflt =
new set<int>;
4265 if (performLegacyInit)
4280 for (
int i = 0; i < count; i++)
4303 for (
int i = 0; i < slotCount; i++)
4313 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_MASK);
4314 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_HEADSTRAP);
4315 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_EYEWEWEAR);
4324 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADGEAR);
4325 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADSTRAP);
4326 tmp.Insert(EAttExclusions.LEGACY_MASK_EYEWEWEAR);
4335 if (ConfigGetBool(
"isStrap"))
4337 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_HEADGEAR);
4338 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_MASK);
4342 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_HEADGEAR);
4343 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_MASK);
4357 for (
int i = 0; i < slotCount; i++)
4367 if (ConfigGetBool(
"noNVStrap"))
4369 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_HEADGEAR);
4371 if (ConfigGetBool(
"noMask"))
4373 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADGEAR);
4375 if (ConfigGetBool(
"noEyewear"))
4377 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_HEADGEAR);
4387 if (ConfigGetBool(
"noNVStrap"))
4389 tmp.Insert(EAttExclusions.LEGACY_HEADSTRAP_MASK);
4391 if (ConfigGetBool(
"noHelmet"))
4393 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_MASK);
4395 if (ConfigGetBool(
"noEyewear"))
4397 tmp.Insert(EAttExclusions.LEGACY_EYEWEAR_MASK);
4407 if (ConfigGetBool(
"isStrap"))
4409 if (ConfigGetBool(
"noHelmet"))
4411 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_HEADSTRAP);
4413 if (ConfigGetBool(
"noMask"))
4415 tmp.Insert(EAttExclusions.LEGACY_MASK_HEADSTRAP);
4420 if (ConfigGetBool(
"noHelmet"))
4422 tmp.Insert(EAttExclusions.LEGACY_HEADGEAR_EYEWEWEAR);
4424 if (ConfigGetBool(
"noMask"))
4426 tmp.Insert(EAttExclusions.LEGACY_MASK_EYEWEWEAR);
4468 ErrorEx(
"m_AttachmentExclusionSlotMap not available! Fill the 'inventorySlot[]' in the " +
this +
" config file.");
4473 if (values && values.Count() != 0)
4483 parent.PropagateExclusionValueRecursive(passThis,lcn.
GetSlot());
4490 if (values && values.Count() != 0)
4497 int count = passThis.Count();
4498 for (
int i = 0; i < count; ++i)
4504 parent.ClearExclusionValueRecursive(passThis,lcn.
GetSlot());
4512 set<int> values =
new set<int>();
4515 values.InsertSet(slotValues);
4544 if (targetSlotValues)
4546 set<int> additionalValues =
new set<int>();
4550 if (additionalValues.Count() > 0)
4552 int countTarget = targetSlotValues.Count();
4553 for (
int i = 0; i < countTarget; i++)
4555 if (additionalValues.Find(targetSlotValues[i]) != -1)
4573 int count = values.Count();
4574 for (
int i = 0; i < count; ++i)
4576 if (currentSlotValuesAll.Find(values[i]) != -1)
4585 if (values && values.Count() != 0)
4593 if (parent && parent !=
this)
4595 return parent.IsExclusionFlagPresentRecursive(passThis,lcn.
GetSlot());
4610 if (occupiedException)
4612 adjustedValue = value;
4616 if (targetException)
4618 adjustedValue = null;
4623 return adjustedValue.Count() != 0;
4629 adjustedValue = value;
4638 if (targetException)
4640 adjustedValue = null;
4645 return adjustedValue.Count() != 0;
4658 bool hasInternalConflict = attachment.HasInternalExclusionConflicts(slotId);
4663 diff = attachment.GetAttachmentExclusionMaskAll(slotId);
4664 diff.RemoveItems(currentAtt.GetAttachmentExclusionMaskAll(slotId));
4665 if (diff.Count() == 0)
4667 return !hasInternalConflict;
4676 EntityAI rootOwner = attachment.GetHierarchyRoot();
4679 diff = attachment.GetAttachmentExclusionMaskAll(slotId);
4680 diff.RemoveItems(attachment.GetAttachmentExclusionMaskAll(curLoc.
GetSlot()));
4681 if (diff.Count() == 0)
4683 return !hasInternalConflict;
4712void SetDebugDeveloper_item(
Object entity)
4715 entity.SetDebugItem();
enum EWetnessLevel BUSH_SOFT
enum EWetnessLevel HIDE_HANDS_SLOT
Param4< int, int, string, int > TSelectableActionInfoWithColor
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
Param3 TSelectableActionInfo
enum EWetnessLevel HIDE_PLAYER_CONTAINER
enum EWetnessLevel RightFrontLimb
enum EWetnessLevel LeftBackLimb
enum EWetnessLevel ATTACHING
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
override bool IsSelfAdjustingTemperature()
override bool IsDestructionBehaviour()
override bool ReplaceOnDeath()
class Animal_CapraHircus extends AnimalBase GetDestructionBehaviour()
override void OnDamageDestroyed(int oldLevel)
override bool KeepHealthOnReplace()
override void OnFreezeStateChangeServer()
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.
PlayerSpawnPreset slotName
static ref TFloatArray ARRAY_FLOAT
Base script class for cars.
represents base for cargo storage for entities
bool CanReceiveItemIntoCargo(EntityAI item)
proto native int GetItemCount()
bool CanSwapItemInCargo(EntityAI child_entity, EntityAI new_entity)
proto native EntityAI GetItem(int index)
static bool GetDisableBaseDamage()
static array< float > GetWetnessWeightModifiers()
static bool GetDisableContainerDamage()
EntityAI GetEnergySource()
Energy manager: Returns the energy source this device is plugged into.
bool IsWorking()
Energy manager: Returns true if this device is working right now.
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.
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool PredictiveTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
void OnBinLoadItemsDropped()
Called when an item fails to get loaded into the inventory of an entity and gets dropped.
bool IsServerCheck(bool allow_client)
override bool IsHologram()
proto native void SetObjectTexture(int index, string texture_name)
Change texture in hiddenSelections.
void OnAttachmentRuined(EntityAI attachment)
Called when some attachment of this parent is ruined. Called on server and client side.
void SetVariableMask(int variable)
void SetStoreLoadedQuantity(float value)
proto native void SetPilotLight(bool isOn)
void MaxLifetimeRefreshCalc()
Calculates if the max lifetime is higher than refresher frequency (i.e. gets kept alive by refresher)...
float GetWeightEx(bool forceRecalc=false)
returns overall weight of the entity, 'forceRecalc = true' is meant to be used only when debugging,...
proto native owned string GetObjectMaterial(int index)
void EEInventoryOut(Man oldParentMan, EntityAI diz, EntityAI newParent)
ref ScriptInvoker m_OnItemRemovedFromCargo
ref set< int > m_AttachmentExclusionMaskChildren
void RemoveAgent(int agent_id)
void InitAttachmentExclusionValues()
bool HasFlammableMaterial()
Override this method to return TRUE when this item has or can provide fire. Evaluated on server and c...
ref ScriptInvoker m_OnItemMovedInCargo
ref HiddenSelectionsData m_HiddenSelectionsData
float GetConfigWeightModified()
void InterpolateTempData(TemperatureDataInterpolated data)
void InitInherentSlotExclusionMap()
map stored on instance to better respond to various state changes
bool PredictiveTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
bool PredictiveTakeEntityToCargoEx(notnull EntityAI item, int idx, int row, int col)
Put item into into cargo on specific cargo location.
void SetTemperatureEx(TemperatureData data)
sets temperature, handles base overheating and freezing state progression logics
bool IsExclusionFlagPresentRecursive(set< int > values, int targetSlot)
Gets flag from what is effectively an owner.
proto native EntityAI GetHierarchyParent()
Returns direct parent of current entity.
bool IsIgnoredByConstruction()
proto native GameInventory GetInventory()
override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
vector m_TransportHitVelocity
bool GetCookingTargetTemperature(out float temperature)
specifically for cooking system, to get heat source target temperatures
void GetDebugButtonNames(out string button1, out string button2, out string button3, out string button4)
void OnDebugButtonPressServer(int button_index)
bool m_TransportHitRegistered
void OnFreezeStateChangeClient()
void Log(string msg, string fnc_name="n/a")
Log.
void ShowSelection(string selection_name)
Shows selection of the given name. Must be configed in config.hpp and models.cfg.
float GetFreezeThawProgress()
on server only
void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
proto native void CreateAndInitInventory()
void IncreaseLifetimeUp()
Reset economy lifetime to default across entity hierarchy all the way to the topmost entity.
ref ScriptInvoker m_OnItemAddedIntoCargo
bool ServerDropEntity(notnull EntityAI item)
void SoundSoftBushFallingPlay()
void CombineItemsEx(EntityAI entity2, bool use_stack_max=false)
bool IsTargetIgnitionSuccessful(EntityAI item_target)
Final evaluation just before the target item is actually ignited. Evaluated on Server.
bool ServerTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
proto native CEItemProfile GetEconomyProfile()
Get economy item profile (if assigned, otherwise null).
proto native float GetLifetimeMax()
Get max economy lifetime per instance - default is from DB (seconds).
float GetStoreLoadedQuantity()
bool CanReceiveItemIntoCargo(EntityAI item)
bool CanBeSplit()
returns current splitability
bool CanDropEntity(notnull EntityAI item)
Returns if item can be dropped out from this entity.
float GetSingleInventoryItemWeightEx()
float GetWetWeightModifier()
void HideSelection(string selection_name)
Hides selection of the given name. Must be configed in config.cpp and models.cfg.
EntityAI GetAttachmentByType(typename type)
Get attached entity by type.
void SetTemperature(float value, bool allow_client=false)
not really deprecated, but missing context info from TemperatureData. Default values used instead.
ScriptInvoker GetOnItemRemovedFromCargo()
float GetHeatPermeabilityCoef()
Returns temperature change speed multiplier for this item and all its children (multiplicative intera...
void PairRemote(notnull EntityAI trigger)
proto native void SetLifetime(float fLifeTime)
Set (override) remaining economy lifetime (seconds).
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
string GetInvulnerabilityTypeString()
void EEDelete(EntityAI parent)
Called right before object deleting.
bool GetInventoryHandAnimation(notnull InventoryLocation loc, out int value)
ComponentEnergyManager m_EM
ArrowManagerBase GetArrowManager()
float HeightStartCheckOverride()
used as script-side override of start pos for specific height checks
void TransferVariablesFloat(array< float > float_vars)
void ClearExclusionValueRecursive(set< int > values, int slotId)
void OnWasDetached(EntityAI parent, int slot_id)
proto native void RegisterNetSyncVariableInt(string variableName, int minValue=0, int maxValue=0)
void SetFreezeThawProgress(float val)
0->1 when freezing, 1->0 when thawing
ref array< EntityAI > m_AttachmentsWithAttachments
proto native void SetSimpleHiddenSelectionState(int index, bool state)
Simple hidden selection state; 0 == hidden.
ref ScriptInvoker m_OnReleaseLock
void HideAllSelections()
Sets all animation values to 1, making them INVISIBLE if they are configured in models....
bool OnAction(int action_id, Man player, ParamsReadContext ctx)
bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
Reads from storage CTX.
bool ServerTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
void HandleFreezingProgression(float deltaHeat, TemperatureData data)
void SetFrozen(bool frozen)
void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
void EntityAI()
cache blood infection chance (cfgVehicles-><entity>->Skinning->BloodInfectionSettings)
bool PredictiveTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
bool IsHeavyBehaviour()
returns item behaviour of item (more in ItemBase)
float m_VarTemperatureThawThreshold
bool LocalDropEntity(notnull EntityAI item)
bool HasEnergyManager()
If this item has class EnergyManager in its config then it returns true. Otherwise returns false.
bool LocalTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
void OnIgnitedTarget(EntityAI target_item)
Executed on Server when this item ignites some target item.
ref map< eAgents, float > m_BloodInfectionChanceCached
bool CanDisplayAttachmentCategory(string category_name)
bool CanReleaseCargo(EntityAI cargo)
void EEItemDetached(EntityAI item, string slot_name)
void AfterStoreLoad()
Called when entity is being loaded from DB or Storage (after all children loaded).
vector GetDefaultHitPosition()
override void Delete()
Delete this object in next frame.
void PropagateExclusionValueRecursive(set< int > values, int slotId)
bool IsEmpty()
is this container empty or not, checks both cargo and attachments
set< int > GetAttachmentExclusionMaskChildren()
Mask value coming from the item's attachments.
void OnPlacementCancelled(Man player)
void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
float GetTemperatureMax()
ref DamageZoneMap m_DamageZoneMap
void GetColor(out int r, out int g, out int b, out int a)
bool CanCombineAttachment(notnull EntityAI e, int slot, bool stack_max_limit=false)
void OnDebugSpawnEx(DebugSpawnParams params)
void InitLegacyConfigExclusionValues()
bool CanIgniteItem(EntityAI ignite_target=NULL)
Override this method and check if the given item can be ignited right now by this one....
void HandleItemOverheating(float deltaHeat, TemperatureData data)
void OnSwitchOff()
Energy manager event: Called when the device is switched OFF.
void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
ref ScriptInvoker m_OnHitByInvoker
bool IsInventoryVisible()
bool DoPlacingHeightCheck()
Do the roof check when placing this?
ref ScriptInvoker m_OnAttachmentReleaseLock
void InitDamageZoneDisplayNameMapping()
Initialize map of damage zone display names for more optimized retrieval.
void WriteVarsToCTX(ParamsWriteContext ctx)
Writes to storage CTX.
void SetFromProjectile(ProjectileStoppedInfo info)
void ProcessInvulnerabilityCheck(string servercfg_param)
proto native void SetObjectMaterial(int index, string mat_name)
Change material in hiddenSelections.
float GetTemperatureMin()
proto native void DestroyInventory()
float m_VarTemperatureInit
int GetBayonetAttachmentIdx()
float GetItemOverheatThreshold()
if undefined, max temperature used as default
override TStringArray GetHiddenSelections()
Returns the hiddenSelectionsTextures array from the object's config.
bool CanPutInCargo(EntityAI parent)
Component CreateComponent(int comp_type, string extended_class_name="")
CreateComponent.
bool IsOneHandedBehaviour()
returns item behaviour of item (more in ItemBase)
void OnMovedWithinCargo(EntityAI container)
Called when this item moves within cargo of some container.
void CombineItemsClient(EntityAI entity2, bool use_stack_max=false)
proto native void SetLifetimeMax(float fLifeTime)
Set (override) max economy lifetime per entity instance (seconds).
bool CanReceiveItemIntoHands(EntityAI item_to_hands)
void OnWasAttached(EntityAI parent, int slot_id)
bool IsPreparedToDelete()
bool PredictiveTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
Put item anywhere into this entity (as attachment or into cargo, recursively).
void OnIgnitedThisFailed(EntityAI fire_source)
Executed on Server when some item failed to ignite this one.
bool CanLoadAttachment(EntityAI attachment)
EntityAI SpawnEntityOnGround(string object_name, vector mat[4])
void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
bool ServerTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
DamageZoneMap GetEntityDamageZoneMap()
bool LocalTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
EWetnessLevel GetWetLevel()
bool LocalTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
void RegisterTransportHit(Transport transport)
UTemperatureSource GetUniversalTemperatureSource()
int m_ViewIndex
view index Item view index is used to setup which camera will be used in item view widget in inventor...
proto native void SwitchLight(bool isOn)
proto native bool IsPilotLight()
string GetDefaultHitComponent()
returns default hit component for the Entity (overriden for each Type - PlayerBase,...
bool CanItemOverheat()
Overheat time CAN be 0, GameConstants.TEMPERATURE_TIME_OVERHEAT_MIN is ignored if so.
float m_PreviousRoofTestTime
bool ServerTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
void OnWorkStart()
Energy manager event: Called only once when this device starts doing its work.
void OnEnergyConsumed()
Energy manager event: Called when energy was consumed on this device. ALWAYS CALL super....
bool HasAnyCargo()
is this container empty or not, checks only cargo
void RemoveAllAgentsExcept(int agent_to_keep)
void OnItemOverheatStart()
override to implement desired overheat behavior on entity
void EEParentedFrom(EntityAI parent)
Called from 'IEntity.RemoveChild' or 'IEntity.AddChild' when hierarchy changes.
string ChangeIntoOnDetach()
bool CanDisplayAttachmentSlot(int slot_id)
float m_VarTemperatureOverheatTime
void EEHitByRemote(int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos)
bool CheckExclusionAccessPropagation(int occupiedSlot, int targetSlot, set< int > value, inout set< int > adjustedValue)
special propagation contition
ref InventoryLocation m_OldLocation
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 res...
bool CanRemoveFromHands(EntityAI parent)
EntityAI GetAttachmentByConfigTypeName(string type)
Get attached entity by config type name.
ScriptInvoker GetOnKilledInvoker()
EntityAI SpawnEntityOnGroundPos(string object_name, vector pos)
bool ServerTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
bool InitLegacyExclusionCheck()
void UpdateWeight(WeightUpdateType updateType=WeightUpdateType.FULL, float weightAdjustment=0)
void SetCleanness(int value, bool allow_client=false)
void SaveVariables(ParamsWriteContext ctx)
ECachedEquipmentItemCategory GetCachedEquipmentCategory()
void SoundHardBushFallingPlay()
set< int > GetAttachmentExclusionMaskAll(int slotId)
Slot-specific, children (attachments), and additional (state etc.) masks combined.
bool HasInternalExclusionConflicts(int targetSlot)
checks if any attachment or item state would interfere with this being attached into a different slot...
bool CanPutIntoHands(EntityAI parent)
bool CanPutAsAttachment(EntityAI parent)
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 SetStoreLoad(bool value)
void LogError(string msg, string fnc_name="n/a")
LogError.
void OnOwnSocketTaken(EntityAI device)
Energy manager event: When something is plugged into this device.
void SetAttachmentExclusionMaskSlot(int slotId, set< int > values)
sets values for specific slot
proto native float GetLifetime()
Get remaining economy lifetime (seconds).
array< EntityAI > GetAttachmentsWithCargo()
Component GetComponent(int comp_type, string extended_class_name="")
GetComponent.
void SetTemperatureMax()
presumably for debug purposes?
ref ScriptInvoker m_OnItemFlipped
bool TranslateSlotFromSelection(string selection_name, out int slot_id)
ref map< int, string > m_DamageDisplayNameMap
void ShowAllSelections()
Sets all animation values to 0, making them VISIBLE if they are configured in models....
void EEParentedTo(EntityAI parent)
Called from 'IEntity.AddChild'.
void SerializeNumericalVars(array< float > floats_out)
bool CheckAttachmentReceiveExclusion(EntityAI attachment, int slotId)
checks specifically for att. exclusion conflicts before att. receive
string CanBePlacedFailMessage(Man player, vector position)
Method which returns message why object can't be placed at given position.
bool CanDisplayWeight()
'displayWeight' in item config
proto native void RegisterNetSyncVariableObject(string variableName)
float GetTemperatureFreezeThreshold()
proto native EntityAI GetHierarchyRoot()
Returns root of current hierarchy (for example: if this entity is in Backpack on gnd,...
ScriptInvoker GetOnAttachmentReleaseLock()
ComponentEnergyManager GetCompEM()
energy manager ENERGY MANAGER:Documentation: Confluence >> Camping & Squatting >> Electricity >> Ener...
ref ScriptInvoker m_OnSetLock
void OnWork(float consumed_energy)
Energy manager event: Called every device update if its supposed to do some work. The update can be e...
bool ServerTakeEntityAsAttachment(notnull EntityAI item)
bool IsSkinned()
Skinning.
float GetItemOverheatProgress()
ScriptInvoker GetOnItemAttached()
bool CanReceiveAttachment(EntityAI attachment, int slotId)
float GetQuantityNormalized()
void SetWet(float value, bool allow_client=false)
void EEInit()
Called upon object creation.
void DebugBBoxSetColor(int color)
float m_VarTemperatureFreezeThreshold
bool UseConfigInitTemperature()
bool IsExclusionFlagPresent(set< int > values)
checks 'this' if the incoming flag is present for the current state (slot behavior and others)
void OnItemOverheat(float deltaTime)
Shape DebugDirectionDraw(float distance=1)
bool LocalTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
void OnIsPlugged(EntityAI source_device)
Energy manager event: Called when this device is plugged into some energy source.
EntityAI SpawnInInventoryOrGroundPos(string object_name, GameInventory inv, vector pos)
void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
void SetBayonetAttached(bool pState, int slot_idx=-1)
ref KillerData m_KillerData
bool CanSwapItemInCargo(EntityAI child_entity, EntityAI new_entity)
void OnVariablesSynchronized()
Called on clients after receiving synchronization data from server.
void RemoveItemVariable(int variable)
Removes variable from variable mask, making it appear as though the variable has never been changed f...
void ExecuteActionsConnectedToValve(int pValveIndex)
string GetAttachmentSoundType()
returns sound type of attachment (used for clothing and weapons on DayZPlayerImplement,...
int GetViewIndex()
Returns item preview index !!!! IF OVERRIDING with more dynamic events call GetOnViewIndexChanged() i...
void SetViewIndex(int index)
Sets item preview index.
HiddenSelectionsData GetHiddenSelectionsData()
float GetTemperatureThawTime()
void OnFreezeStateChangeServer()
bool CanSaveItemInHands(EntityAI item_in_hands)
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
void EECargoOut(EntityAI item)
proto native owned string GetObjectTexture(int index)
bool IsThisIgnitionSuccessful(EntityAI item_source=NULL)
Final evaluation just before this item is actually ignited from fire source. Evaluated on Server.
void OnChildItemReceived(InventoryItem item)
int GetMeleeTargetType()
value is related to EMeleeTargetType
bool CanDisplayAnyAttachmentSlot()
proto native void PlaceOnSurfaceRotated(out vector trans[4], vector pos, float dx=0, float dz=0, float fAngle=0, bool align=false)
int GetHiddenSelectionIndex(string selection)
Returns index of the string found in cfg array 'hiddenSelections'. If it's not found then it returns ...
ref set< int > m_AttachmentExclusionMaskGlobal
bool PredictiveTakeEntityToCargo(notnull EntityAI item)
Put item into into cargo.
bool IsFreezeThawProgressFinished()
on server only
void DebugDirectionDelete()
ScriptInvoker GetOnHitByInvoker()
void OnChildItemRemoved(InventoryItem item)
bool LocalTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
void InitDamageZoneMapping()
Initializes script-side map of damage zones and their components (named selections in models).
void OnWorkStop()
Energy manager event: Called when the device stops working (was switched OFF or ran out of energy).
void EEOnAfterLoad()
Called when entity is part of "connected system" and being restored after load.
bool IsSelfAdjustingTemperature()
UTemperatureSource m_UniversalTemperatureSource
proto native void SetRequiredSimulation(bool req)
bool LoadVariables(ParamsReadContext ctx, int version=-1)
float m_ElapsedSinceLastUpdate
float GetSkinningBloodInfectionChance(eAgents type)
static EWetnessLevel GetWetLevelInternal(float wetness)
void CacheSkinningBloodInfectionChance(eAgents type)
bool ServerTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
void SetAttachmentExclusionMaskGlobal(set< int > values)
void SoundSoftTreeFallingPlay()
void OnItemOverheatEnd()
note, that the deltaTime could be reverse-calculated and not totally accurate
override bool IsEntityAI()
proto native void IncreaseLifetime()
Reset economy lifetime to default (seconds).
bool CanRemoveFromCargo(EntityAI parent)
float ConvertNonlethalDamage(float damage)
DEPRECATED - for legacy purposes.
set< int > GetAttachmentExclusionMaskGlobal()
Global mask value, independent of slot-specific behavior!
bool PredictiveTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
Returns if item can be added as attachment on specific slot.
bool CanDetachAttachment(EntityAI parent)
string GetDefaultHitPositionComponent()
returns default hit position component name for the Entity (overriden by type if needed - used mainly...
void OnWetChanged(float newVal, float oldVal)
int GetButtstockAttachmentIdx()
bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
bool CanReleaseFromHands(EntityAI handheld)
bool PlacementCanBeRotated()
Should return false if you want to disable hologram rotation.
float GetTemperatureFreezeTime()
void OnInitEnergy()
Energy manager event: Object's initialization. Energy Manager is fully initialized by this point.
bool CanBePlaced(Man player, vector position)
void OnDebugButtonPressClient(int button_index)
ref DestructionEffectBase m_DestructionBehaviourObj
bool ServerTakeEntityToCargo(notnull EntityAI item)
ScriptInvoker GetOnItemDetached()
override TStringArray GetHiddenSelectionsTextures()
Returns the hiddenSelectionsTextures array from the object's config.
ref ComponentsBank m_ComponentsBank
bool PredictiveTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
int GetHideIconMask()
should the item's icon be hidden in any part of the inventory?
ref ScriptInvoker m_OnAttachmentSetLock
void OnCEUpdate()
Central economy calls this function whenever going over all the entities.
proto native void UpdateNetSyncVariableInt(string variableName, float minValue=0, float maxValue=0)
bool ServerTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
void SetButtstockAttached(bool pState, int slot_idx=-1)
const int DEAD_REPLACE_DELAY
bool CanLoadItemIntoCargo(EntityAI item)
ref map< int, ref set< int > > m_AttachmentExclusionSlotMap
map< int, string > GetEntityDamageDisplayNameMap()
bool IsIgnited()
Override this method and make it so it returns whenever this item is on fire right now or not....
EntityAI FindAttachmentBySlotName(string slot_name)
void EEKilled(Object killer)
called on server when the entity is killed
bool IsSlotReserved(int slotID)
void OnPlacementStarted(Man player)
void EECargoMove(EntityAI item)
float GetLiquidThroughputCoef()
Returns liquid throughput coeficient.
bool CheckExclusionAccessCondition(int occupiedSlot, int targetSlot, set< int > value, inout set< int > adjustedValue)
void AddSingleExclusionValueGlobal(EAttExclusions value)
to help with item staging exclusions
bool DeleteComponent(int comp_type)
DeleteComponent.
void SetUniversalTemperatureSource(UTemperatureSource uts)
void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
void RefreshTemperatureAccess(TemperatureData data)
refreshes access without setting temperature, keeps the source locked in
bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
set< int > GetAttachmentExclusionMaskSlot(int slotId)
Specific slot behavior.
bool HasTurnableValveBehavior()
Turnable Valve behaviour.
bool DisassembleOnLastDetach()
bool PredictiveTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
void EEInventoryIn(Man newParentMan, EntityAI diz, EntityAI newParent)
int GetTurnableValveIndex(int pComponentIndex)
bool OnStoreLoad(ParamsReadContext ctx, int version)
Called when data is loaded from persistence (on server side).
bool IsDestructionBehaviour()
void OnEnergyAdded()
Energy manager event: Called when energy was added on this device. ALWAYS CALL super....
void SetTakeable(bool pState)
override TStringArray GetHiddenSelectionsMaterials()
Returns the hiddenSelectionsMaterials array from the object's config.
ScriptInvoker GetOnReleaseLock()
void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void AdjustExclusionAccessCondition(int occupiedSlot, int testedSlot, set< int > value, inout set< int > adjustedValue)
if we want to filter
float GetWeightSpecialized(bool forceRecalc=false)
returns weight of the entity in a way that's specific to the entity type and is internal to the weigh...
bool PredictiveTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
ScriptInvoker GetOnItemMovedInCargo()
ref ScriptInvoker m_OnKilledInvoker
array< EntityAI > GetAttachmentsWithAttachments()
void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
void SetInvisibleRecursive(bool invisible, EntityAI parent=null, array< int > attachments=null)
override EntityAI ProcessMeleeItemDamage(int mode=0)
ref array< EntityAI > m_AttachmentsWithCargo
void AttemptDestructionBehaviour(int oldLevel, int newLevel, string zone)
bool CanReleaseAttachment(EntityAI attachment)
proto native bool IsSimpleHiddenSelectionVisible(int index)
bool LocalTakeEntityAsAttachment(notnull EntityAI item)
ref ScriptInvoker m_OnItemAttached
bool AreChildrenAccessible()
void SwitchItemSelectionTextureEx(EItemManipulationContext context, Param par=null)
float ConvertNonlethalDamage(float damage, DamageType damageType)
void DeSerializeNumericalVars(array< float > floats)
void InitLegacySlotExclusionValuesDerived()
void OnOwnSocketReleased(EntityAI device)
Energy manager event: When something is UNPLUGGED from this device.
void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution).
bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
proto native void RegisterNetSyncVariableFloat(string variableName, float minValue=0, float maxValue=0, int precision=1)
bool HasButtstockAttached()
float m_FreezeThawProgress
bool LocalTakeEntityToCargo(notnull EntityAI item)
bool LocalTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
set< int > GetAttachmentExclusionInitSlotValue(int slotId)
override this to modify slot behavior for specific items, or just set 'm_AttachmentExclusionMaskGloba...
ScriptInvoker GetOnItemAddedIntoCargo()
void OnMovedInsideCargo(EntityAI container)
Called when this item enters cargo of some container.
override bool CanBeActionTarget()
string GetHitComponentForAI()
Returns hit component for the Entity (overriden for each Type - PlayerBase, DayZInfected,...
void SetTemperatureDirect(float value, bool allow_client=false)
void AddTemperature(float value)
string ChangeIntoOnAttach(string slot)
proto native void RegisterNetSyncVariableBoolSignal(string variableName)
bool LocalTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
bool KeepHealthOnReplace()
RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
Remotely controlled devices helpers.
proto native void SetAITargetCallbacks(AbstractAITargetCallbacks callbacks)
bool LocalTakeEntityToCargoEx(notnull EntityAI item, int idx, int row, int col)
void OnRemovedFromCargo(EntityAI container)
Called when this item exits cargo of some container.
void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
void OnStoreSave(ParamsWriteContext ctx)
Engine calls this function to collect data from entity to store for persistence (on server side).
bool HasBayonetAttached()
float GetTemperatureThawThreshold()
ScriptInvoker GetOnItemFlipped()
bool PredictiveTakeEntityAsAttachment(notnull EntityAI item)
Put item into as attachment.
float GetInventoryAndCargoWeight(bool forceRecalc=false)
bool IsValveTurnable(int pValveIndex)
float m_VarTemperatureMin
void OnHologramBeingPlaced(Man player)
bool PredictiveDropEntity(notnull EntityAI item)
proto native bool IsRequiredSimulation()
void InitLegacySlotExclusionValuesImplicit()
adding base one-directional relations between headgear, masks, eyewear, and headstraps (exception)
ref TemperatureAccessComponent m_TAC
void SetLiquidType(int value, bool allow_client=false)
void OnIgnitedTargetFailed(EntityAI target_item)
Executed on Server when this item failed to ignite target item.
void InsertAgent(int agent, float count=1)
bool CanSwitchDuringAttach(EntityAI parent)
int GetSlotsCountCorrect()
void SetPersistentPairID(int id)
float HeightCheckOverride()
used as script-side override of distance for specific height checks
void OnSwitchOn()
Energy manager event: Called when the device is switched on.
proto native void SetSynchDirty()
Sets object synchronization dirty flag, which signalize that object wants to be synchronized (take ef...
void SwitchItemSelectionTexture(EntityAI item, string slot_name)
void DebugDirectionSetColor(int color)
ScriptInvoker GetOnAttachmentSetLock()
float m_VarHeatPermeabilityCoef
const int DELETE_CHECK_DELAY
bool IsVariableSet(int variable)
'true' if this variable has ever been changed from default
ref ScriptInvoker m_OnViewIndexChanged
void InitGlobalExclusionValues()
override to init part of the mask, independent of slot-specific behavior
void SetQuantityToMinimum()
array< float > GetVariablesFloat()
float GetItemOverheatTime()
any configured value >= 0 will simulate overheating
bool IsRefresherSignalingViable()
bool CanDisplayAttachmentSlot(string slot_name)
bool CanHaveTemperature()
returns true used on selected items that have a temperature effect and can processes temperature chan...
bool CanAssignToQuickbar()
void EECargoIn(EntityAI item)
bool CanBeSkinnedWith(EntityAI tool)
float GetTemperatureInit()
void ClearSingleExclusionValueGlobal(EAttExclusions value)
to help with item staging exclusions
void LogWarning(string msg, string fnc_name="n/a")
LogWarning.
bool IsSplitable()
returns just the configured 'canBeSplit' bool
ScriptInvoker GetOnViewIndexChanged()
void SetColor(int r, int g, int b, int a)
void OnDamageDestroyed(int oldLevel)
Called when the health gets to the min value, 'oldLevel' is previous health level,...
bool CanAssignAttachmentsToQuickbar()
bool IgnoreOutOfReachCondition()
bool CanBeIgnitedBy(EntityAI igniter=NULL)
Override this method so it checks whenever this item can be ignited right now or not....
void SetRoofAbove(bool state)
ref ScriptInvoker m_OnItemDetached
void SetItemOverheatProgress(float val, float deltaTime=0)
vector GetUniversalTemperatureSourcePosition()
void SetPrepareToDelete()
int GetHierarchyLevel(int lvl=0)
array< string > GetSuitableFinisherHitComponents()
void OnIgnitedThis(EntityAI fire_source)
Executed on Server when some item ignited this one.
void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void EOnFrame(IEntity other, float timeSlice)
string GetDestructionBehaviour()
proto native Man GetHierarchyRootPlayer()
Returns root of current hierarchy cast to Man.
bool IsUniversalTemperatureSource()
Universal Temperature Sources Helpers.
int GetTargetQuantityMax(int attSlotID=-1)
bool IsTwoHandedBehaviour()
returns item behaviour of item (more in ItemBase)
float m_VarTemperatureMax
void EEItemAttached(EntityAI item, string slot_name)
proto native void RegisterNetSyncVariableBool(string variableName)
float m_VarTemperatureFreezeTime
void OnIsUnplugged(EntityAI last_energy_source)
Energy manager event: Called when this device is UNPLUGGED from the energy source.
bool CanBeTargetedByAI(EntityAI ai)
bool HasComponent(int comp_type)
IsComponentExist.
void SoundHardTreeFallingPlay()
bool LocalTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
ComponentBodyStaging GetCompBS()
Use this to access Body Staging component on dead character. Returns NULL if the given object lacks s...
float m_VarTemperatureThawTime
proto native void UpdateNetSyncVariableFloat(string variableName, float minValue=0, float maxValue=0, int precision=1)
ScriptInvoker GetOnSetLock()
bool ServerTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
script counterpart to engine's class Inventory
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
proto native int GetAttachmentSlotsCount()
EntityAI CreateInInventory(string type)
proto native EntityAI GetAttachmentFromIndex(int index)
proto native void ResetFlipCargo()
proto native int GetSlotIdCount()
proto native CargoBase GetCargo()
cargo
proto native int GetAttachmentSlotId(int index)
proto native int AttachmentCount()
Returns count of attachments attached to this item.
proto native int GetSlotId(int index)
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)...
proto native bool GetSlotLock(int slot)
proto native IEntity PhysicsGetLinkedEntity()
entity we are linked to (not valid when IEntity.GetParent() returns some entity)
inventory for plain man/human
proto native int GetUserReservedLocationCount()
proto native void GetUserReservedLocation(int index, out notnull InventoryLocation dst)
proto native int FindFirstUserReservedLocationIndexForContainer(notnull EntityAI e)
Internal ancestor of all Entity implementations.
proto native int GetSlot()
returns slot id if current type is Attachment
proto native bool IsValid()
verify current set inventory location
proto native int GetType()
returns type of InventoryLocation
proto native void SetGround(EntityAI e, vector mat[4])
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
const int INVALID
Invalid slot (-1).
static proto native bool GetShowForSlotId(int slot_Id)
Base Param Class with no parameters.
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.
ScriptInvoker Class provide list of callbacks usage:
proto bool Write(void value_out)
proto bool Read(void value_in)
float m_InterpolatedFraction
Native class for boats - handles physics simulation.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
map< string, ref array< string > > DamageZoneMap
DamageType
exposed from C++ (do not change)
ECachedEquipmentItemCategory
override bool CanItemOverheat()
override bool IsPrepareToDelete()
override bool CanHaveTemperature()
Serializer ParamsReadContext
Serializer ParamsWriteContext
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
const int INVENTORY_MAX_REACHABLE_DEPTH_ATT
Inventory visibility depth, also governs default direct access for most cases.
array< string > TStringArray
static const float TEMPERATURE_TIME_OVERHEAT_MIN
const float TEMP_COEF_COOLING_GLOBAL
const float TEMP_COEF_WORLD
static const float TEMPERATURE_SENSITIVITY_THRESHOLD
static const float TEMPERATURE_FREEZETHAW_LEGACY_COEF
static const float TEMPERATURE_RATE_AVERAGE_ABS
static const float TEMPERATURE_TIME_FREEZE_MIN
static const float TEMPERATURE_TIME_THAW_MIN
static const float TEMPERATURE_FREEZETHAW_ACCELERATION_COEF
const int VARIABLE_TEMPERATURE
const float STATE_SOAKING_WET
const float STATE_DRENCHED
const float LIQUID_THROUGHPUT_DEFAULT
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float Round(float f)
Returns mathematical round of value.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
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).
const int SAT_DEBUG_ACTION
vector GetPosition()
Get the world position of the Effect.
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
proto int ToLower()
Changes string to lowercase.
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 float GetSingleInventoryItemWeightEx()
override float GetItemOverheatThreshold()
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override float GetTemperatureFreezeThreshold()
override float GetTemperatureFreezeTime()
override float GetWetMax()
override void ProcessVariables()
override float GetTemperatureThawTime()
override float GetTemperatureThawThreshold()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override float GetWetMin()
float GetWeightSpecialized(bool forceRecalc=false)
override void OnWasAttached(EntityAI parent, int slot_id)
override void DeSerializeNumericalVars(array< float > floats)
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void WriteVarsToCTX(ParamsWriteContext ctx)
override void InitItemVariables()
override EWetnessLevel GetWetLevel()
override void SerializeNumericalVars(array< float > floats_out)
static string GetDisplayName(int liquid_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
override void OnWasDetached(EntityAI parent, int slot_id)
void TemperatureData(float val, ETemperatureAccessTypes accessType=ETemperatureAccessTypes.ACCESS_UNKNOWN, float time=-1, float timeCoef=1, float heatPermCoef=1)
override bool CanDisplayAttachmentSlot(int slot_id)