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

Go to the source code of this file.

Data Structures

class  ComponentCollisionBox
class  ComponentCollisionCapsule

Enumerations

enum  QueryFlags

Functions

static EWaterLevels CheckWaterLevel (DayZPlayer pPlayer, out vector waterLevel)
static proto native void ClearComponentCollisions ()
static int ConvertStanceMaskToStanceIdx (int stanceMask)
void DayZPlayerUtils ()
 cannot be instantiated
static proto native bool DebugOverrideAnimationRotation (string pAnimName, vector pRotation)
 overrides total animation rotation
static proto native bool DebugOverrideAnimationSpeed (string pAnimName, float pSpeed)
 overrides total animation speed
static proto native bool DebugOverrideAnimationTranslation (string pAnimName, vector pTranslation)
 overrides total animation translation
static proto native void DrawDebugBox (vector pos, float size, int color)
 draws debug box (color=red)
static proto native void DrawDebugText (string text, vector pos, float size)
static proto native void DrawStartFrame ()
 clear info - new draw starts
enum QueryFlags EnableDebugDraw (bool pEnable)
 enables debug draw in functions
static proto native bool FindMagazinesForAmmo (DayZPlayer player, string ammoTypeName, out array< Magazine > mags)
static proto native void GetEntitiesInCone (vector pos, vector dir, float angle, float dist, float minHeigh, float maxHeight, out array< Object > entList)
static Object GetMeleeTarget (vector pos, vector dir, float angle, float dist, float minHeight, float maxHeight, EntityAI pToIgnore, array< typename > targetableObjects, out array< Object > allTargets=NULL)
 returns fight target
static proto native vector GetMemoryPointPositionBoneRelative (DayZPlayer pPlayer, int pBoneIndex, int pPointIndex)
static bool HandleDropCartridge (DayZPlayer player, float damage, string cartTypeName, string magTypeName)
static bool HandleDropMagazine (DayZPlayer player, Magazine mag)
static bool HandleStoreCartridge (DayZPlayer player, Weapon_Base weapon, int muzzleIndex, float damage, string cartTypeName, string magTypeName, bool CanDrop=true)
static void InitCachedEntList ()
static proto native bool InitComponentCollisions (Human player, array< ref ComponentCollisionBox > boxes, array< ref ComponentCollisionCapsule > capsules)
static void InitPlayerComponentCollisions (Human player)
static proto native bool IsComponentCollisionInitialized ()
static proto float LinearRangeClamp (float pValueX, float pValueY, float pLimits[])
 pLimits in form Xvalue, Ymin, Ymax, Xvalue1, Ymin1, Ymax1, .... sample 0, 0, 5, 1, 2, 3, 2, 0, 1
static proto native void PhysicsGetEntitiesInBox (vector min, vector max, notnull out array< EntityAI > entList)
 returns entities overlapping/touching in AABB box -
static proto native bool PlayerCanChangeStance (DayZPlayer pPlayer, int pTargetStance, bool forceCheck=false)
static proto native void SceneGetEntitiesInBox (vector min, vector max, notnull out array< EntityAI > entList, int flags=QueryFlags.DYNAMIC)
 returns entities overlapping/touching in AABB box -
static Magazine SelectStoreCartridge (DayZPlayer player, Weapon_Base weapon, int muzzleIndex, Magazine exclude_mag, float damage, string magTypeName)

Variables

 DYNAMIC
 Dynamic objects are included in the query.
class ComponentCollisionBox EnableDebugDraw
static ref array< Objectm_CachedEntList
 NONE
 ONLY_ROADWAYS
 Only roadways are included in the query.
 ORIGIN_DISTANCE
 Check only distance to object origins, not BB.
 STATIC
 Static objects are included in the query.

Enumeration Type Documentation

◆ QueryFlags

enum QueryFlags

Definition at line 1 of file dayzplayerutils.c.

Function Documentation

◆ CheckWaterLevel()

EWaterLevels CheckWaterLevel ( DayZPlayer pPlayer,
out vector waterLevel )
static

if total water depth >= 1.5m && character is 1.5m in water

Definition at line 425 of file dayzplayerutils.c.

References HumanCommandSwim(), SHumanCommandSwimSettings::m_fToCrouchLevel, SHumanCommandSwimSettings::m_fToErectLevel, and SHumanCommandSwimSettings::m_fWaterLevelIn.

◆ ClearComponentCollisions()

proto native void ClearComponentCollisions ( )
static

◆ ConvertStanceMaskToStanceIdx()

int ConvertStanceMaskToStanceIdx ( int stanceMask)
static

Definition at line 399 of file dayzplayerutils.c.

◆ DayZPlayerUtils()

◆ DebugOverrideAnimationRotation()

proto native bool DebugOverrideAnimationRotation ( string pAnimName,
vector pRotation )
static

overrides total animation rotation

◆ DebugOverrideAnimationSpeed()

proto native bool DebugOverrideAnimationSpeed ( string pAnimName,
float pSpeed )
static

overrides total animation speed

◆ DebugOverrideAnimationTranslation()

proto native bool DebugOverrideAnimationTranslation ( string pAnimName,
vector pTranslation )
static

overrides total animation translation

◆ DrawDebugBox()

proto native void DrawDebugBox ( vector pos,
float size,
int color )
static

draws debug box (color=red)

◆ DrawDebugText()

proto native void DrawDebugText ( string text,
vector pos,
float size )
static

◆ DrawStartFrame()

proto native void DrawStartFrame ( )
static

clear info - new draw starts

◆ EnableDebugDraw()

enum QueryFlags EnableDebugDraw ( bool pEnable)

enables debug draw in functions

◆ FindMagazinesForAmmo()

proto native bool FindMagazinesForAmmo ( DayZPlayer player,
string ammoTypeName,
out array< Magazine > mags )
static

◆ GetEntitiesInCone()

proto native void GetEntitiesInCone ( vector pos,
vector dir,
float angle,
float dist,
float minHeigh,
float maxHeight,
out array< Object > entList )
static

Referenced by GetMeleeTarget().

◆ GetMeleeTarget()

Object GetMeleeTarget ( vector pos,
vector dir,
float angle,
float dist,
float minHeight,
float maxHeight,
EntityAI pToIgnore,
array< typename > targetableObjects,
out array< Object > allTargets = NULL )
static

◆ GetMemoryPointPositionBoneRelative()

proto native vector GetMemoryPointPositionBoneRelative ( DayZPlayer pPlayer,
int pBoneIndex,
int pPointIndex )
static

◆ HandleDropCartridge()

bool HandleDropCartridge ( DayZPlayer player,
float damage,
string cartTypeName,
string magTypeName )
static

Definition at line 275 of file dayzplayerutils.c.

References Class::CastTo().

Referenced by HandleStoreCartridge().

◆ HandleDropMagazine()

bool HandleDropMagazine ( DayZPlayer player,
Magazine mag )
static

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

Definition at line 254 of file dayzplayerutils.c.

References Error(), GameInventory::LocationSyncMoveEntity(), Math3D::MatrixIdentity4(), GameInventory::PrepareDropEntityPos(), and InventoryLocation::SetGround().

◆ HandleStoreCartridge()

bool HandleStoreCartridge ( DayZPlayer player,
Weapon_Base weapon,
int muzzleIndex,
float damage,
string cartTypeName,
string magTypeName,
bool CanDrop = true )
static

find suitable heap / mag

create a new one in inventory

drop on ground

Definition at line 294 of file dayzplayerutils.c.

References Class::CastTo(), DayZPlayerUtils(), ECE_IN_INVENTORY, HandleDropCartridge(), RF_DEFAULT, and SpawnEntity().

◆ InitCachedEntList()

void InitCachedEntList ( )
staticprivate

Definition at line 468 of file dayzplayerutils.c.

References m_CachedEntList.

Referenced by GetMeleeTarget().

◆ InitComponentCollisions()

proto native bool InitComponentCollisions ( Human player,
array< ref ComponentCollisionBox > boxes,
array< ref ComponentCollisionCapsule > capsules )
static

◆ InitPlayerComponentCollisions()

void InitPlayerComponentCollisions ( Human player)
static

Definition at line 376 of file dayzplayerutils.c.

References DayZPlayerUtils(), Error(), and IsComponentCollisionInitialized().

◆ IsComponentCollisionInitialized()

proto native bool IsComponentCollisionInitialized ( )
static
Returns
true if already initialized

Referenced by InitPlayerComponentCollisions().

◆ LinearRangeClamp()

proto float LinearRangeClamp ( float pValueX,
float pValueY,
float pLimits[] )
static

pLimits in form Xvalue, Ymin, Ymax, Xvalue1, Ymin1, Ymax1, .... sample 0, 0, 5, 1, 2, 3, 2, 0, 1

for X <= 0 it clamps Y to Rangle (0,5)
for X == 0.5 it clamps Y to Rangle (1,4)
for X == 1 it clamps Y to Rangle (2,3)
for X == 1.5 it clamps Y to Rangle (1,2)
for X >= 2 it clamps Y to Rangle (0,1)

◆ PhysicsGetEntitiesInBox()

proto native void PhysicsGetEntitiesInBox ( vector min,
vector max,
notnull out array< EntityAI > entList )
static

returns entities overlapping/touching in AABB box -

◆ PlayerCanChangeStance()

proto native bool PlayerCanChangeStance ( DayZPlayer pPlayer,
int pTargetStance,
bool forceCheck = false )
static

◆ SceneGetEntitiesInBox()

proto native void SceneGetEntitiesInBox ( vector min,
vector max,
notnull out array< EntityAI > entList,
int flags = QueryFlags.DYNAMIC )
static

returns entities overlapping/touching in AABB box -

◆ SelectStoreCartridge()

Magazine SelectStoreCartridge ( DayZPlayer player,
Weapon_Base weapon,
int muzzleIndex,
Magazine exclude_mag,
float damage,
string magTypeName )
static

Variable Documentation

◆ DYNAMIC

@ DYNAMIC

Dynamic objects are included in the query.

Definition at line 4 of file dayzplayerutils.c.

◆ EnableDebugDraw

class ComponentCollisionBox EnableDebugDraw
private

◆ m_CachedEntList

ref array<Object> m_CachedEntList
staticprivate

Definition at line 461 of file dayzplayerutils.c.

Referenced by GetMeleeTarget(), and InitCachedEntList().

◆ NONE

@ NONE

Definition at line 0 of file dayzplayerutils.c.

◆ ONLY_ROADWAYS

ONLY_ROADWAYS

Only roadways are included in the query.

Definition at line 8 of file dayzplayerutils.c.

◆ ORIGIN_DISTANCE

ORIGIN_DISTANCE

Check only distance to object origins, not BB.

Definition at line 6 of file dayzplayerutils.c.

◆ STATIC

@ STATIC

Static objects are included in the query.

Definition at line 2 of file dayzplayerutils.c.