class MiscGameplayFunctions
Constants 1
static const float OBJECT_OBSTRUCTION_MIN_DISTANCE_SQ = 0.0625squared distance below which an obstruction raycast is pointless, nothing can fit in between [default 0.25m]
Methods 89
truncate float to specified precision
truncate float to specified precision, output as string
truncate float to specified precision
Show 3 more
, Vector(), float.LOWEST, and float.MAXProduces ACII "progress bar" based on an 0..1 'value' input
Insert 'insert' behind index 'pos' of the 'base' string
static void TransferItemProperties(EntityAI source, notnull EntityAI target, bool transfer_agents = true, bool transfer_variables = true, bool transfer_health = true, bool exclude_quantity = false)will transform variables, agents and other local scripted properties as well as any relevant non-scripted properties like health
Show 4 more
, CGame.IsServer(), ItemBase.TransferAgents(), TransferEntityHealth(), and TransferEntityVariables()static void TransferEntityVariables(EntityAI source, EntityAI target, bool exclude_quantity = false)Show 23 more
, Class.Cast(), Class.Cast(), Class.CastTo(), Weapon_Base.CopyWeaponStateFrom(), Magazine.GetAmmoCount(), EntityAI.GetCompEM(), EntityAI.GetCompEM(), ComponentEnergyManager.GetEnergy(), EntityAI.GetVariablesFloat(), EntityAI.HasEnergyManager(), EntityAI.HasEnergyManager(), Object.IsMagazine(), Object.IsMagazine(), ComponentEnergyManager.IsSwitchedOn(), Object.IsWeapon(), Object.IsWeapon(), EntityAI.RemoveItemVariable(), Magazine.ServerSetAmmoCount(), ComponentEnergyManager.SetEnergy(), ComponentEnergyManager.SwitchOn(), Edible_Base.TransferFoodStage(), EntityAI.TransferVariablesFloat(), and EntityAI.m_VariablesMaskDEPRECATED
static TransferInventoryResult TransferInventory(EntityAI sourceItem, EntityAI targetItem, PlayerBase player)Show 10 more
, array.Get(), GameInventory.GetCurrentInventoryLocation(), EntityAI.GetInventory(), EntityAI.GetInventory(), EntityAI.GetInventory(), Man.LocalDropEntity(), GameInventory.LocationCanAddEntity(), CGame.RemoteObjectTreeCreate(), InventoryLocation.SetParent(), and GameInventory.TakeToDst()static void TransferEntityHealth(EntityAI source, EntityAI target, array<string> healthTypes = null, bool transferZoneDamage = true)Show 5 more
, Object.GetDamageZones(), Object.GetDamageZones(), Object.GetHealth01(), array.Insert(), and Object.SetHealth01()static void UnlimitedAmmoDebugCheck(Weapon_Base weapon)Show 4 more
, Weapon.GetMagazine(), CGame.IsServer(), Magazine.LocalSetAmmoMax(), and Magazine.ServerSetAmmoMax()static void TurnItemIntoItem(notnull ItemBase old_item, string new_item_type, notnull PlayerBase player)static void TurnItemIntoItemEx(notnull PlayerBase player, ReplaceItemWithNewLambdaBase lambda)Show 38 more
, ActionGiveBloodTarget.OnEndAnimationLoopServer(), ActionRestrainSelf.OnFinishProgressServer(), Barrel_ColorBase.ColourClothes(), TransformRestrainItem(), TurnItemIntoItem(), OpenItem.SwitchItems(), PaintAK74HndgrdBlack.Do(), PaintAK74HndgrdCamo.Do(), PaintAK74WoodBttstckBlack.Do(), PaintAK74WoodBttstckCamo.Do(), PaintAKWoodBttstckBlack.Do(), PaintAKWoodBttstckCamo.Do(), PaintCz527CamoBlack.Do(), PaintCz527CamoGreen.Do(), PaintGhillieAttBlack.Do(), PaintGhillieAttGreenMossy.Do(), PaintGhillieBushragBlack.Do(), PaintGhillieBushragGreenMossy.Do(), PaintGhillieHoodGreenMossy.Do(), PaintGhillieSuitGreen.Do(), PaintGhillieSuitGreenMossy.Do(), PaintGhillieTopBlack.Do(), PaintGhillieTopGreen.Do(), PaintGhillieTopGreenMossy.Do(), PaintItem.SwitchItems(), PaintMosinCamoBlack.Do(), PaintMosinCamoGreen.Do(), PaintSawedoffMosinCamoBlack.Do(), PaintSawedoffMosinCamoGreen.Do(), RemoteDetonatorTrigger.SpawnInPlayerHands(), SawOFFB95.Do(), SawoffFAMAS.Do(), SawOffIzh18.Do(), SawOffIzh18Shotgun.Do(), SawOffMagnum.Do(), SawoffMosin.Do(), SawoffMosinPainted.Do(), and SawoffShotgunIzh43.Do()static void TurnItemInHandsIntoItem(notnull ItemBase old_item, string new_item_type, notnull PlayerBase player)static void TurnItemInHandsIntoItemEx(notnull PlayerBase player, ReplaceItemWithNewLambdaBase lambda)static array<ItemBase> CreateItemBasePiles(string item_name, vector ground_position, float quantity, float health, bool floaty_spawn = false)Spawns multiple piles of stackable ItemBase objects on ground (intended for generic use)
static array<ItemBase> CreateItemBasePilesEx(string itemName, vector groundPosition, float quantity, float health, bool floatySpawn = false, bool throwAfterSpawn = false)Show 6 more
, Math.Floor(), array.Insert(), Object.SetHealth(), ItemBase.SetQuantity(), InventoryItem.ThrowPhysically(), and vector.Zerostatic array<ItemBase> CreateItemBasePilesDispersed(string item_name, vector starPos, vector targetPos, float radius, float quantity, float health, Object ignoreObjectCollison)creation method using raycast-dispersed positioning; ECE_TRACE not used as a result
Show 5 more
, Math.Floor(), GetRandomizedPositionVerified(), array.Insert(), Object.SetHealth(), and ItemBase.SetQuantity()static array<Magazine> CreateMagazinePiles(string item_name, vector ground_position, float quantity, float health)Show 3 more
, Math.Floor(), array.Insert(), and Magazine.ServerSetAmmoCount()static array<Magazine> CreateMagazinePilesDispersed(string item_name, vector starPos, vector targetPos, float radius, float quantity, float health, Object ignoreObjectCollison)creation method using raycast-dispersed positioning; ECE_TRACE not used as a result
Show 4 more
, Math.Floor(), GetRandomizedPositionVerified(), array.Insert(), and Magazine.ServerSetAmmoCount()static array<Magazine> CreateMagazinePilesFromBullet(string bullet_type, vector ground_position, float quantity, float health)Show 4 more
, CGame.CreateObjectEx(), Math.Floor(), array.Insert(), and Magazine.ServerSetAmmoCount()static array<Magazine> CreateMagazinePilesFromBulletDispersed(string bullet_type, vector starPos, vector targetPos, float radius, float quantity, float health, Object ignoreObjectCollison)Show 2 more
, array.Get(), and CachedObjectsArrays.ARRAY_FLOATstatic bool GetProjectedCursorPos3d(out vector position, Weapon_Base weapon)Show 1 more
, DayZPhysics.RaycastRV()static void GetHeadBonePos(notnull PlayerBase player, out vector pos)static float GetPlayerHeadHeight(notnull PlayerBase player)Returns approximated height(from terrain) of head in WS which takes the player's stance into account Preferred method over GetHeadBonePos variant which can be expensive on perf
player- Reference to player entity
static vector GetPlayerHeadPosition(notnull PlayerBase player)Returns approximated position of head in WS which takes the player's stance into account Preferred method over GetHeadBonePos variant which can be expensive on perf
player- Reference to player entity
Show 22 more
, AITargetCallbacksPlayer.GetHeadPositionWS(), CCTCursor.Can(), CCTCursorInherited.Can(), CCTCursorNoObject.Can(), CCTCursorNoRuinCheck.Can(), CCTCursorParent.Can(), CCTObject.Can(), CCTParent.Can(), ConstructionPartRebuildRubble.SpawnRubbleMaterials(), CraftTannedLeather.Do(), DayZPlayerImplementMeleeCombat.HitZoneSelectionRaycast(), Environment.CheckShadowPresence(), FlashbangEffect.PlaySound(), GetRandomizedPositionVerifiedPlayer(), IsObjectObstructed(), MemPointDirectionalCheck(), ScriptedSandstormController.GetIntensityForPlayer(), StaticConstructionMethods.SpawnConstructionMaterialPilesEx(), UndergroundHandlerClient.CalculateBreadCrumbs(), UndergroundHandlerClient.CalculateLinePointFade(), VicinityItemManager.RefreshVicinityItems(), and ZombieBase.GetAttackPitch()static vector GetHeadingVector(notnull PlayerBase player)Show 3 more
, Math.Sin(), Math.PI_HALF, and vector.ZeroShow 8 more
, DayZPlayerImplementMeleeCombat.IsObstructed(), DayZPlayerImplementMeleeCombat.TargetSelection(), DayZPlayerMeleeFightLogic_LightHeavy.EvaluateHit_Player(), Hologram.DrawDebugArrow(), VicinityItemManager.ExcludeFromContainer_Phase1(), VicinityItemManager.RefreshVicinityItems(), Weapon_Base.LiftWeaponCheckEx(), and ZombieBase.FightLogic()static float GetHeadingAngle(notnull DayZPlayerImplement player)Show 1 more
, VicinityItemManager.DebugConeDraw()Show 1 more
, PlayerConstants.METABOLIC_SPEED_ENERGY_WALKShow 1 more
, PlayerConstants.METABOLIC_SPEED_WATER_WALKstatic void TransformRestrainItem(EntityAI current_item, EntityAI tool, PlayerBase player_source, PlayerBase player_target, bool destroy = false)static bool IsPlayerOrientedTowardPos(notnull DayZPlayerImplement player, vector target_pos, float cone_angle)Check if player direction(based on cone of defined angle) is oriented to target position
Show 5 more
, Object.GetDirection(), Object.GetPosition(), vector.Normalize(), vector.Normalize(), and Math.RAD2DEGdir in cone or in a tip of cone
static bool MemPointDirectionalCheck(PlayerBase player, EntityAI targetEnt, string memPointStartName, string memPointEndName, float toleranceAngle = Math.PI_HALF)Returns true when the player stands on the opposite side of memPointEndName relative to memPointStartName (angle exceeds toleranceAngle) Intentionally returns true (no restriction) when the check cannot be performed (missing player/entity or memory points) Callers where a failed check must deny access have to verify the preconditions (e.g. MemoryPointExists) themselves
static bool ComplexBuildCollideCheckClient(PlayerBase player, ActionTarget target, ItemBase item, int constraction_index)Show 11 more
, Class.CastTo(), ConstructionActionData.GetBuildPartAtIndex(), PlayerBase.GetConstructionActionData(), EntityAI.GetConstructionBasic(), ActionTarget.GetObject(), ConstructionPart.GetPartName(), ConstructionBase.IsCollidingEx(), PlayerBase.IsPlacingLocal(), PlayerBase.IsPlacingServer(), BaseBuildingBase.PerformRoofCheckForBase(), and CollisionCheckData.m_PartNamestatic bool BuildCondition(PlayerBase player, ActionTarget target, ItemBase item, bool camera_check, int constraction_index)Show 13 more
, Class.CastTo(), ConstructionActionData.GetBuildPartAtIndex(), ConstructionActionData.GetBuildPartHandsGenericAtIndex(), PlayerBase.GetConstructionActionData(), GetGame(), Human.GetInputController(), ConstructionPart.GetMainPartName(), ActionTarget.GetObject(), CGame.IsDedicatedServer(), EntityAI.IsFacingCamera(), ItemBase.IsPlayerInsideEx(), BaseBuildingBase.MustBeBuiltFromOutside(), and ConstructionActionData.SetTarget()static void IsUnderRoofFromToCalculation(EntityAI entity, out vector from, out vector to, float height = GameConstants.ROOF_CHECK_RAYCAST_DIST)Show 2 more
, EntityAI.HeightStartCheckOverride(), and Vector()static bool IsUnder(EntityAI entity, array<typename> excludedTypes, out Object hitObj, float height = GameConstants.ROOF_CHECK_RAYCAST_DIST, int geometry = ObjIntersectIFire)Show 3 more
, Class.IsInherited(), IsUnderRoofFromToCalculation(), and DayZPhysics.RaycastRV()Show 2 more
, Math.Sin(), and Vector()static vector GetRandomizedPositionVerified(vector startPos, vector targetPos, float radius, Object ignore = null)Show 1 more
, RaycastRVParams.typestatic vector GetRandomizedPositionVerifiedPlayer(Man player, float distance, float radius, Object ignore)Show 2 more
, Object.GetPosition(), and GetRandomizedPositionVerified()Show 13 more
, Object.GetCollisionBox(), EntityAI.GetInventory(), CargoBase.GetItem(), CargoBase.GetItemCount(), Object.GetOrientation(), Object.GetPosition(), GetVelocity(), array.Insert(), Math3D.MatrixToQuat(), Math.RandomFloat(), ThrowEntityFromInventory(), Vector(), and Math3D.YawPitchRollMatrix()static void ThrowEntityFromInventory(notnull EntityAI entity, vector position, float direction[4], vector force, int flags)Show 20 more
, Class.CastTo(), dBodyApplyImpulse(), GameInventory.DropEntity(), GameInventory.GetCurrentInventoryLocation(), EntityAI.GetHierarchyRoot(), EntityAI.GetInventory(), ItemBase.GetQuantity(), ItemBase.GetTargetQuantityMax(), Object.GetType(), CGame.IsMultiplayer(), GameInventory.LocationCreateEntity(), InventoryLocation.SetGroundEx(), InventoryLocation.SetGroundEx(), ItemBase.SetQuantity(), ItemBase.SplitIntoStackMaxToInventoryLocationEx(), GameInventory.TakeToDst(), InventoryItem.ThrowPhysically(), InventoryItem.ThrowPhysically(), InventoryItem.ThrowPhysically(), and TransferItemProperties()Show 20 more
, GameConstants.ENVIRO_ISOLATION_HEALTHFACTOR_B_DAMAGED, GameConstants.ENVIRO_ISOLATION_HEALTHFACTOR_DAMAGED, GameConstants.ENVIRO_ISOLATION_HEALTHFACTOR_PRISTINE, GameConstants.ENVIRO_ISOLATION_HEALTHFACTOR_RUINED, GameConstants.ENVIRO_ISOLATION_HEALTHFACTOR_WORN, GameConstants.ENVIRO_ISOLATION_WETFACTOR_DAMP, GameConstants.ENVIRO_ISOLATION_WETFACTOR_DRENCHED, GameConstants.ENVIRO_ISOLATION_WETFACTOR_DRY, GameConstants.ENVIRO_ISOLATION_WETFACTOR_SOAKED, GameConstants.ENVIRO_ISOLATION_WETFACTOR_WET, GameConstants.STATE_BADLY_DAMAGED, GameConstants.STATE_DAMAGED, GameConstants.STATE_DAMP, GameConstants.STATE_DRENCHED, GameConstants.STATE_DRY, GameConstants.STATE_PRISTINE, GameConstants.STATE_RUINED, GameConstants.STATE_SOAKING_WET, GameConstants.STATE_WET, and GameConstants.STATE_WORNstatic void FilterObstructingObjects(array<Object> potentiallyObstructingObjects, out array<Object> obstructingObjects)apply factors
Show 1 more
, array.Insert()static void FilterObstructedObjectsByGrouping(vector origin, float range, float distanceDelta, array<Object> objects, array<Object> obstructingObjects, out array<Object> filteredObjects, bool doDistanceCheck = false, bool checkIfDistanceCanBeIgnored = false, float maxDist = 0)filters out objects obstructed from 'origin' by a raycast per object
static void SplitArrayIntoGroupsByDistance(array<Object> objects, array<ref array<Object>> objectGroups, float squaredDistanceDelta)Show 4 more
, Object.GetWorldPosition(), array.Insert(), array.Insert(), and array.Remove()static bool IsObjectObstructed(Object object, bool doDistanceCheck = false, vector distanceCheckPos = "0 0 0", float maxDist = 0)Show 2 more
, new IsObjectObstructedCache(), and IsObjectObstructedEx()static bool IsObjectObstructedEx(Object object, IsObjectObstructedCache cache, bool doDistanceCheck = false, vector distanceCheckPos = "0 0 0", float maxDist = 0)static bool IsObjectObstructedProxy(Object object, IsObjectObstructedCache cache, PlayerBase player)static bool IsObjectObstructedFilter(Object object, IsObjectObstructedCache cache, PlayerBase player)Show 1 more
, IsObjectObstructedCache.HitObjectsstatic bool IsObjectObstructedFilterEx(Object object, IsObjectObstructedCache cache, PlayerBase player, int geometryTypeOverride = -1)groups 'RaycastRVProxy' and 'RaycastRV' approaches into one method, allowes for comprehensive geometry override, if desired
Show 19 more
, set.Count(), array.Count(), vector.DistanceSq(), IsObjectObstructedCache.GetRaycastParams(), Object.IsMan(), DayZPhysics.RaycastRV(), DayZPhysics.RaycastRVProxy(), IsObjectObstructedCache.ContactComponent, RaycastRVResult.hierLevel, IsObjectObstructedCache.HitObjects, IsObjectObstructedCache.HitProxyObjects, OBJECT_OBSTRUCTION_MIN_DISTANCE_SQ, IsObjectObstructedCache.ObjectCenterPos, IsObjectObstructedCache.ObjectContactDir, IsObjectObstructedCache.ObjectContactPos, RaycastRVResult.parent, IsObjectObstructedCache.RaycastEnd, IsObjectObstructedCache.RaycastStart, and RaycastRVParams.typestatic void DealEvinronmentAdjustedDmg(ItemBase item, PlayerBase player, float baseDamage)uses the NEARESTCONTACT collision check from RaycastParams
Show 13 more
, ActionDismantleGardenPlot.OnFinishProgressServer(), ActionLockAttachment.OnFinishProgressServer(), ActionLockDoors.OnFinishProgressServer(), ActionRepairBoatEngine.AdjustVehicleHealthServer(), ActionRepairCarEngine.AdjustVehicleHealthServer(), ActionRepairMotorbikeEngine.AdjustVehicleHealthServer(), ActionSkinning.OnFinishProgressServer(), ActionUnlockDoors.OnFinishProgressServer(), ActionUnlockShippingContainer.OnFinishProgressServer(), ActionUnrestrainTarget.OnFinishProgressServer(), BarbedWire.PostAreaDamageActions(), LandMineTrap.OnSteppedOn(), and DealEvinronmentAdjustedDmg()static void RemoveSplint(PlayerBase player)Show 18 more
, EntityAI.Delete(), Object.GetHealthLevel(), EntityAI.GetInventory(), PlayerBase.GetItemOnSlot(), Object.GetMaxHealth(), Object.GetType(), CGame.IsServer(), Object.SetHealth(), PlayerBase.SpawnEntityOnGroundOnCursorDir(), TransferItemProperties(), GameConstants.DAMAGE_BADLY_DAMAGED_VALUE, GameConstants.DAMAGE_DAMAGED_VALUE, GameConstants.DAMAGE_RUINED_VALUE, GameConstants.DAMAGE_WORN_VALUE, GameConstants.STATE_BADLY_DAMAGED, GameConstants.STATE_DAMAGED, GameConstants.STATE_RUINED, and GameConstants.STATE_WORNstatic void TeleportCheck(notnull PlayerBase player, notnull array<ref array<float>> safe_positions)checks if we should teleport the player to a safe location and if so, performs the teleportation
static bool TeleportPlayerToSafeLocation3D(notnull PlayerBase player, vector safePos)'stupider' teleport method, does not touch flag management. Applies Y from the position as well!
Show 1 more
, Object.SetPosition()static void GenerateAINoiseAtPositionEx(notnull Object source, float lifeTime, NoiseParams noiseParams)Show 1 more
, CGame.IsServer()Show 1 more
, string.ToLower()static void RemoveAllAttachedChildrenByTypename(notnull EntityAI parent, array<typename> listOfTypenames)Show 1 more
, PlayerBase.EEItemIntoHands()static void DeleteAttachedChildrenByTypename(notnull EntityAI parent, array<typename> listOfTypenames)Show 4 more
, IEntity.GetChildren(), IEntity.GetSibling(), Object.IsAnyInherited(), and IEntity.RemoveChild()Fills the provided array with all children entities in hierarchy of this entity
static void SoakItemInsideParentContainingLiquidAboveThreshold(notnull ItemBase item, notnull ItemBase parent, float liquidQuantityThresholdPercentage = 0.05)Show 2 more
, CGame.IsServer(), and ItemBase.SetWetMax()static float GetCombinedSnowfallWindValue()Show 3 more
, Weather.GetSnowfall(), CGame.GetWeather(), and Weather.GetWindMagnitude()Show 1 more
, FireplaceBase.Heating()static bool ComplexBuildCollideCheckClient(PlayerBase player, ActionTarget target, ItemBase item, string partName = "")static bool BuildCondition(PlayerBase player, ActionTarget target, ItemBase item, bool camera_check)static void GenerateAINoiseAtPosition(vector position, float lifeTime, NoiseParams noiseParams)