Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
miscgameplayfunctions.c File Reference

Go to the source code of this file.

Data Structures

class  DestroyItemInCorpsesHandsAndCreateNewOnGndLambda
class  DropEquipAndDestroyRootLambda
 this one is a bit special: it drops all items and destroys the ex-root of the hierarchy More...
class  ReplaceItemWithNewLambda
 adds automatic QuickBar handling More...
class  TurnItemIntoItemLambda

Enumerations

enum  ThrowEntityFlags
enum  TransferInventoryResult { Ok , DroppedSome }

Functions

static float Bobbing (float period, float amplitude, float elapsedTime)
static bool BuildCondition (PlayerBase player, ActionTarget target, ItemBase item, bool camera_check)
static bool BuildCondition (PlayerBase player, ActionTarget target, ItemBase item, bool camera_check, int constraction_index)
static bool CanIgnoreDistanceCheck (Object obj)
void ClearCache ()
static bool ComplexBuildCollideCheckClient (PlayerBase player, ActionTarget target, ItemBase item, int constraction_index)
static bool ComplexBuildCollideCheckClient (PlayerBase player, ActionTarget target, ItemBase item, string partName="")
override void CopyOldPropertiesToNew (notnull EntityAI old_item, EntityAI new_item)
static array< ItemBaseCreateItemBasePiles (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< ItemBaseCreateItemBasePilesDispersed (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
static array< Magazine > CreateMagazinePiles (string item_name, vector ground_position, float quantity, float health)
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
static array< Magazine > CreateMagazinePilesFromBullet (string bullet_type, vector ground_position, float quantity, float health)
static array< Magazine > CreateMagazinePilesFromBulletDispersed (string bullet_type, vector starPos, vector targetPos, float radius, float quantity, float health, Object ignoreObjectCollison)
void CreateNetworkObjectInfo (EntityAI new_item)
static void DealAbsoluteDmg (ItemBase item, float dmg)
static void DealEvinronmentAdjustedDmg (ItemBase item, PlayerBase player, float baseDamage)
static void DeleteAttachedChildrenByTypename (notnull EntityAI parent, array< typename > listOfTypenames)
static void DropAllItemsInInventoryInBounds (ItemBase ib, vector halfExtents)
void DropEquipAndDestroyRootLambda (EntityAI old_item, string new_item_type, PlayerBase player)
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)
 group objects that are close to each other together
static void FilterObstructingObjects (array< Object > potentiallyObstructingObjects, out array< Object > obstructingObjects)
static float FModulus (float x, float y)
static void GenerateAINoiseAtPosition (vector position, float lifeTime, NoiseParams noiseParams)
static void GetAttachedChildren (IEntity parent, array< IEntity > outputObjects)
 Fills the provided array with all children entities in hierarchy of this entity.
static vector GetClosestSafePos (vector to_pos, notnull array< ref array< float > > positions)
static string GetColorString (float r, float g, float b, float a)
static float GetCombinedSnowfallWindValue ()
static int GetComponentIndex (array< Selection > pSelection, string pCompName)
static float GetCurrentItemHeatIsolation (ItemBase pItem)
static float GetEnergyMetabolicSpeed (int movement_speed)
static void GetHeadBonePos (notnull PlayerBase player, out vector pos)
static float GetHeadingAngle (notnull DayZPlayerImplement player)
static vector GetHeadingVector (notnull PlayerBase player)
static int GetHealthLevelForAmmo (string class_name, float health)
static string GetItemDisplayName (string type)
static float GetMaxValue (array< float > pArray)
static float GetMinValue (array< float > pArray)
static bool GetProjectedCursorPos3d (out vector position, Weapon_Base weapon)
static vector GetRandomizedPosition (vector targetPos, float radius)
static vector GetRandomizedPositionVerified (vector startPos, vector targetPos, float radius, Object ignore=null)
static vector GetRandomizedPositionVerifiedPlayer (Man player, float distance, float radius, Object ignore)
static vector GetSteamPosition (EntityAI parent)
static float GetTypeMaxGlobalHealth (string class_name, string health_type="Health")
static float GetWaterMetabolicSpeed (int movement_speed)
static string InsertAtPos (string base, string insert, int pos)
 Insert 'insert' behind index 'pos' of the 'base' string.
static bool IsComponentInSelection (array< Selection > pSelection, string pCompName)
static bool IsObjectObstructed (Object object, bool doDistanceCheck=false, vector distanceCheckPos="0 0 0", float maxDist=0)
void IsObjectObstructedCache (vector rayCastStart, int totalObjects)
static bool IsObjectObstructedEx (Object object, IsObjectObstructedCache cache, bool doDistanceCheck=false, vector distanceCheckPos="0 0 0", float maxDist=0)
static bool IsObjectObstructedFilter (Object object, IsObjectObstructedCache cache, PlayerBase player)
static 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
static bool IsObjectObstructedProxy (Object object, IsObjectObstructedCache cache, PlayerBase player)
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.
static bool IsUnderRoof (EntityAI entity, float height=GameConstants.ROOF_CHECK_RAYCAST_DIST)
static bool IsUnderRoofEx (EntityAI entity, float height=GameConstants.ROOF_CHECK_RAYCAST_DIST, int geometry=ObjIntersectView)
static void IsUnderRoofFromToCalculation (EntityAI entity, out vector from, out vector to, float height=GameConstants.ROOF_CHECK_RAYCAST_DIST)
static bool IsValueInRange (float value, float from, float to)
void MoveEquipToExistingItemAndDestroyOldRootLambda (EntityAI old_item, string new_item_type, PlayerBase player, EntityAI new_item)
static float Normalize (int val, int maxVal)
static string ObtainRestrainItemTargetClassname (notnull EntityAI entity)
class TurnItemIntoItemLambdaAnimSysNotifyLambda extends TurnItemIntoItemLambda OnSuccess (EntityAI new_item)
static void RemoveAllAttachedChildrenByTypename (notnull EntityAI parent, array< typename > listOfTypenames)
void RemoveNetworkObjectInfo ()
static void RemoveSplint (PlayerBase player)
static string SanitizeString (string input)
static void SoakItemInsideParentContainingLiquidAboveThreshold (notnull ItemBase item, notnull ItemBase parent, float liquidQuantityThresholdPercentage=0.05)
static void SplitArrayIntoGroupsByDistance (array< Object > objects, array< ref array< Object > > objectGroups, float squaredDistanceDelta)
static 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!
static void ThrowAllItemsInInventory (notnull EntityAI parent, int flags)
static void ThrowEntityFromInventory (notnull EntityAI entity, vector position, float direction[4], vector force, int flags)
static void TransferEntityHealth (EntityAI source, EntityAI target, array< string > healthTypes=null, bool transferZoneDamage=true)
static void TransferEntityVariables (EntityAI source, EntityAI target, bool exclude_quantity=false)
static TransferInventoryResult TransferInventory (EntityAI sourceItem, EntityAI targetItem, PlayerBase player)
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
static void TransferItemVariables (ItemBase source, ItemBase target, bool exclude_quantity=false)
 DEPRECATED.
static void TransformRestrainItem (EntityAI current_item, EntityAI tool, PlayerBase player_source, PlayerBase player_target, bool destroy=false)
enum ThrowEntityFlags Truncate (float value, int decimals=2)
 truncate float to specified precision
static string TruncateToS (float value, int decimals=2)
 truncate float to specified precision, output as string
static vector TruncateVec (vector value, int decimals=2)
 truncate float to specified precision
static string TruncateVecToS (vector value, int decimals=2, string delimiter=" ")
static void TurnItemInHandsIntoItem (notnull ItemBase old_item, string new_item_type, notnull PlayerBase player)
static void TurnItemInHandsIntoItemEx (notnull PlayerBase player, ReplaceItemWithNewLambdaBase lambda)
static void TurnItemIntoItem (notnull ItemBase old_item, string new_item_type, notnull PlayerBase player)
static void TurnItemIntoItemEx (notnull PlayerBase player, ReplaceItemWithNewLambdaBase lambda)
void UndoRemoveNetworkObjectInfo ()
static void UnlimitedAmmoDebugCheck (Weapon_Base weapon)
static string ValueToBar (float value, string bar="[----------]", string mark="x")
 Produces ACII "progress bar" based on an 0..1 'value' input.

Variables

int ContactComponent = -1
ref set< ObjectHitObjects = new set<Object>
ref array< ref RaycastRVResultHitProxyObjects = new array<ref RaycastRVResult>
EntityAI m_NewItem
PlayerBase m_Player
 NONE = 0
vector ObjectCenterPos = "0 0 0"
vector ObjectContactDir = "0 0 0"
vector ObjectContactPos = "0 0 0"
DestroyItemInCorpsesHandsAndCreateNewOnGndLambda RaycastStart = "0 0 0"
 SPLIT = 1
int TotalObjects = 0

Enumeration Type Documentation

◆ ThrowEntityFlags

enum ThrowEntityFlags
protected

Definition at line 207 of file miscgameplayfunctions.c.

◆ TransferInventoryResult

enum TransferInventoryResult
protected
Enumerator
Ok 
DroppedSome 

Definition at line 202 of file miscgameplayfunctions.c.

Function Documentation

◆ Bobbing()

float Bobbing ( float period,
float amplitude,
float elapsedTime )
staticprotected

Definition at line 1614 of file miscgameplayfunctions.c.

References FModulus(), and Math::Sin().

◆ BuildCondition() [1/2]

bool BuildCondition ( PlayerBase player,
ActionTarget target,
ItemBase item,
bool camera_check )
staticprotected

Definition at line 915 of file miscgameplayfunctions.c.

References ActionTarget.

Referenced by ComplexBuildCollideCheckClient().

◆ BuildCondition() [2/2]

◆ CanIgnoreDistanceCheck()

bool CanIgnoreDistanceCheck ( Object obj)
staticprotected

Definition at line 1297 of file miscgameplayfunctions.c.

Referenced by FilterObstructedObjectsByGrouping().

◆ ClearCache()

void ClearCache ( )
protected

◆ ComplexBuildCollideCheckClient() [1/2]

◆ ComplexBuildCollideCheckClient() [2/2]

bool ComplexBuildCollideCheckClient ( PlayerBase player,
ActionTarget target,
ItemBase item,
string partName = "" )
staticprotected

Definition at line 873 of file miscgameplayfunctions.c.

References ActionTarget.

◆ CopyOldPropertiesToNew()

override void CopyOldPropertiesToNew ( notnull EntityAI old_item,
EntityAI new_item )

We don't care if a valid transform couldn't be found, we just want to preferably use it instead of placing on the old item

Definition at line 124 of file miscgameplayfunctions.c.

◆ CreateItemBasePiles()

array< ItemBase > CreateItemBasePiles ( string item_name,
vector ground_position,
float quantity,
float health,
bool floaty_spawn = false )
staticprotected

Spawns multiple piles of stackable ItemBase objects on ground (intended for generic use).

Definition at line 475 of file miscgameplayfunctions.c.

References ECE_CREATEPHYSICS, ECE_PLACE_ON_SURFACE, ECE_UPDATEPATHGRAPH, Math::Floor(), g_Game, and ItemBase::SetQuantity().

◆ CreateItemBasePilesDispersed()

array< ItemBase > CreateItemBasePilesDispersed ( string item_name,
vector starPos,
vector targetPos,
float radius,
float quantity,
float health,
Object ignoreObjectCollison )
staticprotected

creation method using raycast-dispersed positioning; ECE_TRACE not used as a result

Definition at line 516 of file miscgameplayfunctions.c.

References ECE_PLACE_ON_SURFACE, Math::Floor(), g_Game, and ItemBase::SetQuantity().

◆ CreateMagazinePiles()

array< Magazine > CreateMagazinePiles ( string item_name,
vector ground_position,
float quantity,
float health )
staticprotected

Definition at line 553 of file miscgameplayfunctions.c.

References ECE_PLACE_ON_SURFACE, Math::Floor(), and g_Game.

◆ CreateMagazinePilesDispersed()

array< Magazine > CreateMagazinePilesDispersed ( string item_name,
vector starPos,
vector targetPos,
float radius,
float quantity,
float health,
Object ignoreObjectCollison )
staticprotected

creation method using raycast-dispersed positioning; ECE_TRACE not used as a result

Definition at line 581 of file miscgameplayfunctions.c.

References ECE_CREATEPHYSICS, ECE_UPDATEPATHGRAPH, Math::Floor(), and g_Game.

Referenced by CreateMagazinePilesFromBulletDispersed().

◆ CreateMagazinePilesFromBullet()

array< Magazine > CreateMagazinePilesFromBullet ( string bullet_type,
vector ground_position,
float quantity,
float health )
staticprotected

Definition at line 612 of file miscgameplayfunctions.c.

References ECE_PLACE_ON_SURFACE, Math::Floor(), and g_Game.

◆ CreateMagazinePilesFromBulletDispersed()

array< Magazine > CreateMagazinePilesFromBulletDispersed ( string bullet_type,
vector starPos,
vector targetPos,
float radius,
float quantity,
float health,
Object ignoreObjectCollison )
staticprotected

Definition at line 647 of file miscgameplayfunctions.c.

References CreateMagazinePilesDispersed(), and g_Game.

◆ CreateNetworkObjectInfo()

void CreateNetworkObjectInfo ( EntityAI new_item)
protected

Definition at line 195 of file miscgameplayfunctions.c.

References g_Game, and m_NewItem.

◆ DealAbsoluteDmg()

void DealAbsoluteDmg ( ItemBase item,
float dmg )
staticprotected

Definition at line 1597 of file miscgameplayfunctions.c.

Referenced by DealEvinronmentAdjustedDmg().

◆ DealEvinronmentAdjustedDmg()

void DealEvinronmentAdjustedDmg ( ItemBase item,
PlayerBase player,
float baseDamage )
staticprotected

Definition at line 1577 of file miscgameplayfunctions.c.

References DealAbsoluteDmg(), g_Game, and Surface::GetParamFloat().

◆ DeleteAttachedChildrenByTypename()

void DeleteAttachedChildrenByTypename ( notnull EntityAI parent,
array< typename > listOfTypenames )
staticprotected

Definition at line 1861 of file miscgameplayfunctions.c.

◆ DropAllItemsInInventoryInBounds()

void DropAllItemsInInventoryInBounds ( ItemBase ib,
vector halfExtents )
staticprotected

◆ DropEquipAndDestroyRootLambda()

void DropEquipAndDestroyRootLambda ( EntityAI old_item,
string new_item_type,
PlayerBase player )

Definition at line 119 of file miscgameplayfunctions.c.

◆ FilterObstructedObjectsByGrouping()

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

◆ FilterObstructingObjects()

void FilterObstructingObjects ( array< Object > potentiallyObstructingObjects,
out array< Object > obstructingObjects )
staticprotected

Definition at line 1284 of file miscgameplayfunctions.c.

◆ FModulus()

float FModulus ( float x,
float y )
staticprotected

Definition at line 1631 of file miscgameplayfunctions.c.

References Math::ModFloat(), x, and y.

Referenced by Bobbing().

◆ GenerateAINoiseAtPosition()

void GenerateAINoiseAtPosition ( vector position,
float lifeTime,
NoiseParams noiseParams )
staticprotected

◆ GetAttachedChildren()

void GetAttachedChildren ( IEntity parent,
array< IEntity > outputObjects )
staticprotected

Fills the provided array with all children entities in hierarchy of this entity.

Definition at line 1881 of file miscgameplayfunctions.c.

References IEntity::GetChildren(), and IEntity::GetSibling().

◆ GetClosestSafePos()

vector GetClosestSafePos ( vector to_pos,
notnull array< ref array< float > > positions )
staticprotected

Definition at line 1717 of file miscgameplayfunctions.c.

References vector::DistanceSq().

◆ GetColorString()

string GetColorString ( float r,
float g,
float b,
float a )
staticprotected

Definition at line 241 of file miscgameplayfunctions.c.

References string::Format().

◆ GetCombinedSnowfallWindValue()

float GetCombinedSnowfallWindValue ( )
staticprotected

Definition at line 1900 of file miscgameplayfunctions.c.

References g_Game.

◆ GetComponentIndex()

int GetComponentIndex ( array< Selection > pSelection,
string pCompName )
staticprotected

Definition at line 1817 of file miscgameplayfunctions.c.

References GetName(), INDEX_NOT_FOUND, and string::ToLower().

◆ GetCurrentItemHeatIsolation()

◆ GetEnergyMetabolicSpeed()

◆ GetHeadBonePos()

void GetHeadBonePos ( notnull PlayerBase player,
out vector pos )
staticprotected

Definition at line 716 of file miscgameplayfunctions.c.

◆ GetHeadingAngle()

float GetHeadingAngle ( notnull DayZPlayerImplement player)
staticprotected

Definition at line 736 of file miscgameplayfunctions.c.

References HumanInputController::GetHeadingAngle().

Referenced by GetHeadingVector().

◆ GetHeadingVector()

vector GetHeadingVector ( notnull PlayerBase player)
staticprotected

◆ GetHealthLevelForAmmo()

int GetHealthLevelForAmmo ( string class_name,
float health )
staticprotected

◆ GetItemDisplayName()

string GetItemDisplayName ( string type)
staticprotected

Definition at line 1793 of file miscgameplayfunctions.c.

References g_Game.

◆ GetMaxValue()

float GetMaxValue ( array< float > pArray)
staticprotected

Definition at line 1779 of file miscgameplayfunctions.c.

◆ GetMinValue()

float GetMinValue ( array< float > pArray)
staticprotected

Definition at line 1765 of file miscgameplayfunctions.c.

◆ GetProjectedCursorPos3d()

bool GetProjectedCursorPos3d ( out vector position,
Weapon_Base weapon )
staticprotected

◆ GetRandomizedPosition()

vector GetRandomizedPosition ( vector targetPos,
float radius )
staticprotected

◆ GetRandomizedPositionVerified()

vector GetRandomizedPositionVerified ( vector startPos,
vector targetPos,
float radius,
Object ignore = null )
staticprotected

◆ GetRandomizedPositionVerifiedPlayer()

vector GetRandomizedPositionVerifiedPlayer ( Man player,
float distance,
float radius,
Object ignore )
staticprotected

Definition at line 1086 of file miscgameplayfunctions.c.

References GetRandomizedPositionVerified().

◆ GetSteamPosition()

vector GetSteamPosition ( EntityAI parent)
staticprotected

◆ GetTypeMaxGlobalHealth()

float GetTypeMaxGlobalHealth ( string class_name,
string health_type = "Health" )
staticprotected

◆ GetWaterMetabolicSpeed()

◆ InsertAtPos()

string InsertAtPos ( string base,
string insert,
int pos )
staticprotected

Insert 'insert' behind index 'pos' of the 'base' string.

Definition at line 258 of file miscgameplayfunctions.c.

References string::Length(), and string::Substring().

Referenced by ValueToBar().

◆ IsComponentInSelection()

bool IsComponentInSelection ( array< Selection > pSelection,
string pCompName )
staticprotected

Definition at line 1798 of file miscgameplayfunctions.c.

References GetName(), string::Length(), and string::ToLower().

◆ IsObjectObstructed()

bool IsObjectObstructed ( Object object,
bool doDistanceCheck = false,
vector distanceCheckPos = "0 0 0",
float maxDist = 0 )
staticprotected

◆ IsObjectObstructedCache()

◆ IsObjectObstructedEx()

bool IsObjectObstructedEx ( Object object,
IsObjectObstructedCache cache,
bool doDistanceCheck = false,
vector distanceCheckPos = "0 0 0",
float maxDist = 0 )
staticprotected

◆ IsObjectObstructedFilter()

bool IsObjectObstructedFilter ( Object object,
IsObjectObstructedCache cache,
PlayerBase player )
staticprotected

Definition at line 1504 of file miscgameplayfunctions.c.

References IsObjectObstructedCache().

◆ IsObjectObstructedFilterEx()

bool IsObjectObstructedFilterEx ( Object object,
IsObjectObstructedCache cache,
PlayerBase player,
int geometryTypeOverride = -1 )
staticprotected

groups 'RaycastRVProxy' and 'RaycastRV' approaches into one method, allowes for comprehensive geometry override, if desired

Definition at line 1532 of file miscgameplayfunctions.c.

References RaycastRVParams::flags, g_Game, IsObjectObstructedCache(), DayZPhysics::RaycastRV(), DayZPhysics::RaycastRVProxy(), and RaycastRVParams::type.

Referenced by IsObjectObstructedEx().

◆ IsObjectObstructedProxy()

bool IsObjectObstructedProxy ( Object object,
IsObjectObstructedCache cache,
PlayerBase player )
staticprotected

◆ IsPlayerOrientedTowardPos()

bool IsPlayerOrientedTowardPos ( notnull DayZPlayerImplement player,
vector target_pos,
float cone_angle )
staticprotected

Check if player direction(based on cone of defined angle) is oriented to target position.

dir in cone or in a tip of cone

Definition at line 832 of file miscgameplayfunctions.c.

References Math::AbsFloat(), Math::Acos(), vector::Dot(), vector::Normalize(), and Math::RAD2DEG.

◆ IsUnderRoof()

bool IsUnderRoof ( EntityAI entity,
float height = GameConstants.ROOF_CHECK_RAYCAST_DIST )
staticprotected

Definition at line 1001 of file miscgameplayfunctions.c.

References IsUnderRoofEx().

◆ IsUnderRoofEx()

bool IsUnderRoofEx ( EntityAI entity,
float height = GameConstants.ROOF_CHECK_RAYCAST_DIST,
int geometry = ObjIntersectView )
staticprotected

Definition at line 1006 of file miscgameplayfunctions.c.

References IsUnderRoofFromToCalculation(), and DayZPhysics::RaycastRV().

Referenced by IsUnderRoof().

◆ IsUnderRoofFromToCalculation()

void IsUnderRoofFromToCalculation ( EntityAI entity,
out vector from,
out vector to,
float height = GameConstants.ROOF_CHECK_RAYCAST_DIST )
staticprotected

Definition at line 971 of file miscgameplayfunctions.c.

References Vector().

Referenced by IsUnderRoofEx().

◆ IsValueInRange()

bool IsValueInRange ( float value,
float from,
float to )
staticprotected

Definition at line 826 of file miscgameplayfunctions.c.

◆ MoveEquipToExistingItemAndDestroyOldRootLambda()

void MoveEquipToExistingItemAndDestroyOldRootLambda ( EntityAI old_item,
string new_item_type,
PlayerBase player,
EntityAI new_item )

Definition at line 168 of file miscgameplayfunctions.c.

References Empty, Error(), and m_NewItem.

Referenced by ActionPlaceFireplaceIntoBarrel::OnExecuteServer().

◆ Normalize()

float Normalize ( int val,
int maxVal )
staticprotected

Definition at line 1603 of file miscgameplayfunctions.c.

References Debug::LogError().

◆ ObtainRestrainItemTargetClassname()

string ObtainRestrainItemTargetClassname ( notnull EntityAI entity)
staticprotected

Definition at line 790 of file miscgameplayfunctions.c.

◆ OnSuccess()

class TurnItemIntoItemLambdaAnimSysNotifyLambda extends TurnItemIntoItemLambda OnSuccess ( EntityAI new_item)

Definition at line 91 of file miscgameplayfunctions.c.

◆ RemoveAllAttachedChildrenByTypename()

void RemoveAllAttachedChildrenByTypename ( notnull EntityAI parent,
array< typename > listOfTypenames )
staticprotected

Definition at line 1836 of file miscgameplayfunctions.c.

References Math3D::MatrixIdentity4().

◆ RemoveNetworkObjectInfo()

void RemoveNetworkObjectInfo ( )
protected

Definition at line 176 of file miscgameplayfunctions.c.

References g_Game, and m_NewItem.

◆ RemoveSplint()

◆ SanitizeString()

string SanitizeString ( string input)
staticprotected

Definition at line 863 of file miscgameplayfunctions.c.

References Math::Clamp(), string::Length(), and string::Substring().

◆ SoakItemInsideParentContainingLiquidAboveThreshold()

void SoakItemInsideParentContainingLiquidAboveThreshold ( notnull ItemBase item,
notnull ItemBase parent,
float liquidQuantityThresholdPercentage = 0.05 )
staticprotected

Definition at line 1891 of file miscgameplayfunctions.c.

References g_Game.

◆ SplitArrayIntoGroupsByDistance()

void SplitArrayIntoGroupsByDistance ( array< Object > objects,
array< ref array< Object > > objectGroups,
float squaredDistanceDelta )
staticprotected

Definition at line 1417 of file miscgameplayfunctions.c.

References vector::DistanceSq().

Referenced by FilterObstructedObjectsByGrouping().

◆ TeleportCheck()

void TeleportCheck ( notnull PlayerBase player,
notnull array< ref array< float > > safe_positions )
staticprotected

checks if we should teleport the player to a safe location and if so, performs the teleportation

Definition at line 1690 of file miscgameplayfunctions.c.

References g_Game, and GetPlugin().

◆ TeleportPlayerToSafeLocation3D()

bool TeleportPlayerToSafeLocation3D ( notnull PlayerBase player,
vector safePos )
staticprotected

'stupider' teleport method, does not touch flag management. Applies Y from the position as well!

Definition at line 1739 of file miscgameplayfunctions.c.

References g_Game.

◆ ThrowAllItemsInInventory()

◆ ThrowEntityFromInventory()

◆ TransferEntityHealth()

void TransferEntityHealth ( EntityAI source,
EntityAI target,
array< string > healthTypes = null,
bool transferZoneDamage = true )
staticprotected

Definition at line 386 of file miscgameplayfunctions.c.

Referenced by TransferItemProperties().

◆ TransferEntityVariables()

◆ TransferInventory()

TransferInventoryResult TransferInventory ( EntityAI sourceItem,
EntityAI targetItem,
PlayerBase player )
staticprotected

◆ TransferItemProperties()

void TransferItemProperties ( EntityAI source,
notnull EntityAI target,
bool transfer_agents = true,
bool transfer_variables = true,
bool transfer_health = true,
bool exclude_quantity = false )
staticprotected

will transform variables, agents and other local scripted properties as well as any relevant non-scripted properties like health

Definition at line 269 of file miscgameplayfunctions.c.

References g_Game, and TransferEntityHealth().

◆ TransferItemVariables()

void TransferItemVariables ( ItemBase source,
ItemBase target,
bool exclude_quantity = false )
staticprotected

DEPRECATED.

Definition at line 339 of file miscgameplayfunctions.c.

References TransferEntityVariables().

◆ TransformRestrainItem()

void TransformRestrainItem ( EntityAI current_item,
EntityAI tool,
PlayerBase player_source,
PlayerBase player_target,
bool destroy = false )
staticprotected

Definition at line 795 of file miscgameplayfunctions.c.

References Error().

◆ Truncate()

enum ThrowEntityFlags Truncate ( float value,
int decimals = 2 )
protected

truncate float to specified precision

Definition at line 195 of file miscgameplayfunctions.c.

Referenced by TruncateToS().

◆ TruncateToS()

string TruncateToS ( float value,
int decimals = 2 )
staticprotected

truncate float to specified precision, output as string

Definition at line 222 of file miscgameplayfunctions.c.

References string::ToString(), and Truncate().

◆ TruncateVec()

vector TruncateVec ( vector value,
int decimals = 2 )
staticprotected

truncate float to specified precision

Definition at line 227 of file miscgameplayfunctions.c.

References Math::Clamp(), Math::Floor(), float::LOWEST, float::MAX, Math::Pow(), and Vector().

◆ TruncateVecToS()

string TruncateVecToS ( vector value,
int decimals = 2,
string delimiter = " " )
staticprotected

Definition at line 236 of file miscgameplayfunctions.c.

◆ TurnItemInHandsIntoItem()

void TurnItemInHandsIntoItem ( notnull ItemBase old_item,
string new_item_type,
notnull PlayerBase player )
staticprotected

Definition at line 464 of file miscgameplayfunctions.c.

References TurnItemInHandsIntoItemEx().

◆ TurnItemInHandsIntoItemEx()

void TurnItemInHandsIntoItemEx ( notnull PlayerBase player,
ReplaceItemWithNewLambdaBase lambda )
staticprotected

Definition at line 469 of file miscgameplayfunctions.c.

Referenced by TurnItemInHandsIntoItem().

◆ TurnItemIntoItem()

void TurnItemIntoItem ( notnull ItemBase old_item,
string new_item_type,
notnull PlayerBase player )
staticprotected

Definition at line 454 of file miscgameplayfunctions.c.

References TurnItemIntoItemEx().

◆ TurnItemIntoItemEx()

void TurnItemIntoItemEx ( notnull PlayerBase player,
ReplaceItemWithNewLambdaBase lambda )
staticprotected

Definition at line 459 of file miscgameplayfunctions.c.

Referenced by TurnItemIntoItem().

◆ UndoRemoveNetworkObjectInfo()

void UndoRemoveNetworkObjectInfo ( )
protected

Definition at line 181 of file miscgameplayfunctions.c.

References g_Game, and m_NewItem.

◆ UnlimitedAmmoDebugCheck()

void UnlimitedAmmoDebugCheck ( Weapon_Base weapon)
staticprotected

Definition at line 419 of file miscgameplayfunctions.c.

References g_Game.

◆ ValueToBar()

string ValueToBar ( float value,
string bar = "[----------]",
string mark = "x" )
staticprotected

Produces ACII "progress bar" based on an 0..1 'value' input.

Definition at line 247 of file miscgameplayfunctions.c.

References Math::Clamp(), InsertAtPos(), string::Length(), Math::Lerp(), and Math::Round().

Variable Documentation

◆ ContactComponent

int ContactComponent = -1
protected

Definition at line 1946 of file miscgameplayfunctions.c.

Referenced by ClearCache().

◆ HitObjects

ref set<Object> HitObjects = new set<Object>
protected

Definition at line 1948 of file miscgameplayfunctions.c.

Referenced by ClearCache().

◆ HitProxyObjects

ref array<ref RaycastRVResult> HitProxyObjects = new array<ref RaycastRVResult>
protected

Definition at line 1947 of file miscgameplayfunctions.c.

Referenced by ClearCache().

◆ m_NewItem

◆ m_Player

◆ NONE

@ NONE = 0

Definition at line 217 of file miscgameplayfunctions.c.

◆ ObjectCenterPos

vector ObjectCenterPos = "0 0 0"
protected

Definition at line 1943 of file miscgameplayfunctions.c.

Referenced by ClearCache().

◆ ObjectContactDir

vector ObjectContactDir = "0 0 0"
protected

Definition at line 1945 of file miscgameplayfunctions.c.

Referenced by ClearCache().

◆ ObjectContactPos

vector ObjectContactPos = "0 0 0"
protected

Definition at line 1944 of file miscgameplayfunctions.c.

Referenced by ClearCache().

◆ RaycastStart

DestroyItemInCorpsesHandsAndCreateNewOnGndLambda RaycastStart = "0 0 0"
protected

Referenced by IsObjectObstructedCache().

◆ SPLIT

SPLIT = 1

Definition at line 218 of file miscgameplayfunctions.c.

◆ TotalObjects

int TotalObjects = 0
protected

Definition at line 1940 of file miscgameplayfunctions.c.

Referenced by IsObjectObstructedCache().