Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
GameInventory Class Reference

script counterpart to engine's class Inventory More...

Inheritance diagram for GameInventory:
BuildingInventory HumanInventory ItemInventory TransportInventory HumanInventoryWithFSM WeaponInventory

Protected Member Functions

bool AreChildrenAccessible ()
 Returns true if item is considered reachable within inventory.
proto native bool CanAddSwappedEntity (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
bool DropEntity (InventoryMode mode, EntityAI owner, notnull EntityAI item)
bool DropEntityInBounds (InventoryMode mode, EntityAI owner, notnull EntityAI item, vector halfExtents, float angle, float cosAngle, float sinAngle)
bool DropEntityWithTransform (InventoryMode mode, EntityAI owner, notnull EntityAI item, vector transform[4])
proto native bool FindFirstFreeLocationForNewEntity (string item_type, FindInventoryLocationType flags, out notnull InventoryLocation loc)
 FindFirstFreeLocationForNewEntity.
proto native bool FindFreeLocationFor (notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
 FindFreeLocationFor.
proto native bool FindFreeLocationForEx (notnull EntityAI item, FindInventoryLocationType flags, notnull InventoryLocation exclude, out notnull InventoryLocation loc)
 FindFreeLocationForEx.
proto native int FindFreeLocationsFor (notnull EntityAI item, FindInventoryLocationType flags, out notnull array< ref InventoryLocation > locs)
proto native void FlipCargo ()
bool ForceSwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
bool GetCurrentAttachmentSlotInfo (out int slot_id, out string slot_name)
 Returns true if the item is currently attached and outputs attachment slot id and name.
proto native bool GetCurrentInventoryLocation (out notnull InventoryLocation loc)
proto native bool GetFlipCargo ()
bool IsAttachment ()
 Returns true if this Inventory owner is an attachment of something.
bool IsCargoInHiearchy ()
 Returns true if inventory owner or his hiearchy parents are in cargo.
bool IsInCargo ()
 Returns true if this Inventory owner is in cargo of something.
bool LocalDestroyEntity (notnull EntityAI item)
void OnInventoryFailure (InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
bool ReplaceItemWithNew (InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
proto native void ResetFlipCargo ()
proto native void SetFlipCargo (bool flip)
bool SwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
bool TakeEntityAsAttachment (InventoryMode mode, notnull EntityAI item)
bool TakeEntityAsAttachmentEx (InventoryMode mode, notnull EntityAI item, int slot)
bool TakeEntityAsTargetAttachment (InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
bool TakeEntityAsTargetAttachmentEx (InventoryMode mode, notnull EntityAI target, notnull EntityAI item, int slot)
 put item as attachment of target
bool TakeEntityToCargo (InventoryMode mode, notnull EntityAI item)
bool TakeEntityToCargoEx (InventoryMode mode, notnull EntityAI item, int idx, int row, int col)
bool TakeEntityToInventory (InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
bool TakeEntityToTargetCargo (InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
 Put item into into cargo of another entity.
bool TakeEntityToTargetCargoEx (InventoryMode mode, notnull CargoBase cargo, notnull EntityAI item, int row, int col)
 Put item into into cargo on specific cargo location of another entity.
bool TakeEntityToTargetInventory (InventoryMode mode, notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
 helper that finds location first, then moves the entity into it
bool TakeToDst (InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
proto native EntityAI GetInventoryOwner ()
 Engine native functions.
proto native bool HasEntityInInventory (notnull EntityAI item)
proto native bool EnumerateInventory (InventoryTraversalType tt, out array< EntityAI > items)
proto native int CountInventory ()
 almost identical to EnumerateInventory except it does not return items
proto native CargoBase GetCargo ()
 cargo
proto native CargoBase GetCargoFromIndex (int index)
proto native EntityAI CreateEntityInCargo (string typeName)
 Create Entity of specified type in cargo of entity.
proto native EntityAI CreateEntityInCargoEx (string typeName, int idx, int row, int col, bool flip)
 Create Entity of specified type in cargo of entity at coordinates (row, col).
proto native bool HasEntityInCargo (notnull EntityAI e)
proto native bool HasEntityInCargoEx (notnull EntityAI e, int idx, int row, int col)
proto native bool CanAddEntityInCargo (notnull EntityAI e, bool flip)
proto native bool CanAddEntityInCargoEx (notnull EntityAI e, int idx, int row, int col, bool flip)
proto native bool CanAddEntityInCargoExLoc (InventoryLocation loc)
proto native bool TestAddEntityInCargoEx (notnull EntityAI e, int idx, int row, int col, bool flip, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
proto native bool TestAddEntityInCargoExLoc (notnull InventoryLocation loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
proto native bool CanRemoveEntityInCargo (notnull EntityAI e)
proto native bool CanRemoveEntityInCargoEx (notnull EntityAI e, int idx, int row, int col)
proto native int GetSlotId (int index)
proto native int GetSlotIdCount ()
proto native int GetAttachmentSlotId (int index)
proto native int GetAttachmentSlotsCount ()
bool HasAttachmentSlot (int slotId)
proto native bool HasInventorySlot (int slotId)
proto native int AttachmentCount ()
 Returns count of attachments attached to this item.
proto native EntityAI CreateAttachment (string typeName)
proto native EntityAI CreateAttachmentEx (string typeName, int slotId)
proto native EntityAI GetAttachmentFromIndex (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 EntityAI FindAttachmentByName (string slotName)
 Returns attached entity in slot (you can use EntityAI.GetActionComponentName to get slot id).
proto native bool HasAttachment (notnull EntityAI e)
proto native bool HasAttachmentEx (notnull EntityAI e, int slot)
proto native bool CanAddAttachment (notnull EntityAI e)
proto native bool CanAddAttachmentEx (notnull EntityAI e, int slot)
proto native bool CanRemoveAttachment (EntityAI attachment)
proto native bool CanRemoveAttachmentEx (EntityAI attachment, int slot)
proto native EntityAI FindPlaceholderForSlot (int slot)
 Returns placeholder entity for slot (naked arms, legs etc).
proto native bool IsPlaceholderEntity (notnull Object e)
proto native bool CanLockInventoryWithKey (notnull EntityAI key)
 locks
proto native bool CanUnlockInventoryWithKey (notnull EntityAI key)
proto native void LockInventoryWithKey (notnull EntityAI key)
proto native void UnlockInventoryWithKey (notnull EntityAI key)
proto native bool HasKeys ()
proto native void LockInventory (int lockType)
proto native void UnlockInventory (int lockType)
proto native int GetScriptLockCount ()
proto native bool IsInventoryUnlocked ()
proto native bool IsInventoryLocked ()
proto native bool IsInventoryLockedForLockType (int lockType)
proto native bool SetSlotLock (int slot, bool locked)
proto native bool GetSlotLock (int slot)
void Init ()
 script functions
bool OnStoreLoad (ParamsReadContext ctx, int version)
 db load hooks
void OnAfterStoreLoad ()
void OnStoreSave (ParamsWriteContext ctx)
 db store hook
void EEInit ()
void EEDelete (EntityAI parent)
EntityAI CreateInInventory (string type)
bool CanAddEntityToInventory (notnull EntityAI item, int flag=FindInventoryLocationType.ANY)
bool AddEntityToInventory (notnull EntityAI item)
bool CanRemoveEntity ()
 Returns if entity can be removed from its current location.
bool CanAddEntityInto (notnull EntityAI item, FindInventoryLocationType flags=FindInventoryLocationType.ANY)
bool CanAddEntityIntoInventory (notnull EntityAI item)
 Test if entity can be put to the inventory (Cargo, ProxyCargo, Attachment).
bool CanAddEntityIntoHands (notnull EntityAI item)
 Test if entity can be put into hands.
bool OnInputUserDataProcess (ParamsReadContext ctx)
 synchronization
bool OnInventoryJunctureFromServer (ParamsReadContext ctx)
void OnInventoryJunctureFailureFromServer (ParamsReadContext ctx)
void OnServerInventoryCommand (ParamsReadContext ctx)

Static Protected Member Functions

static proto native bool CanForceSwapEntities (notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
static bool CanForceSwapEntitiesEx (notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
static proto native bool CanSwapEntities (notnull EntityAI item1, notnull EntityAI item2)
static bool CanSwapEntitiesEx (notnull EntityAI item1, notnull EntityAI item2)
static int GetInventoryCheckContext ()
static proto native bool LocationAddEntity (notnull InventoryLocation inv_loc)
static proto native bool LocationCanAddEntity (notnull InventoryLocation inv_loc)
static bool LocationCanAddEntityEx (notnull InventoryLocation inv_loc)
static proto native bool LocationCanMoveEntity (notnull InventoryLocation src, notnull InventoryLocation dst)
static bool LocationCanMoveEntitySyncCheck (notnull InventoryLocation src, notnull InventoryLocation dst)
static proto native bool LocationCanRemoveEntity (notnull InventoryLocation inv_loc)
static proto native EntityAI LocationCreateEntity (notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
static proto native EntityAI LocationCreateLocalEntity (notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
static proto native EntityAI LocationGetEntity (notnull InventoryLocation inv_loc)
static proto native bool LocationMoveEntity (notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
static proto native bool LocationRemoveEntity (notnull InventoryLocation inv_loc)
static proto native bool LocationSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
static proto native bool LocationSyncMoveEntity (notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
static proto native bool LocationTestAddEntity (notnull InventoryLocation inv_loc, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check, bool do_script_load_check)
static bool MakeDstForSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2)
 helper function for swap
static bool MakeSrcAndDstForForceSwap (notnull EntityAI item1, notnull EntityAI item2, out InventoryLocation src1, out InventoryLocation src2, out InventoryLocation dst1, notnull InventoryLocation dst2)
 helper function for ForceSwap
static bool MakeSrcAndDstForSwap (notnull EntityAI item1, notnull EntityAI item2, out InventoryLocation src1, out InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2)
 helper function for swap
static void OnServerInventoryCommandStatic (ParamsReadContext ctx)
static proto native bool PrepareDropEntityPos (EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1)
static proto native bool ServerHandEvent (notnull Man player, notnull EntityAI item, ParamsWriteContext ctx)
static proto native bool ServerLocationMoveEntity (notnull EntityAI item, ParamsWriteContext ctx)
static proto native bool ServerLocationSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, ParamsWriteContext ctx)
static proto native bool ServerLocationSyncMoveEntity (Man player, notnull EntityAI item, ParamsWriteContext ctx)
static bool SetGroundPosByOwner (EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
static void SetGroundPosByOwnerBounds (EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector halfExtents, float angle, float cosAngle, float sinAngle)
static bool SetGroundPosByTransform (EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector transform[4])
static proto native bool TestDropEntityPos (EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1)

Static Protected Attributes

static int m_inventory_check_context = InventoryCheckContext.DEFAULT
const int c_InventoryReservationTimeoutMS = 5000
 reservations
const int c_InventoryReservationTimeoutShortMS = 3000
bool AddInventoryReservationEx (EntityAI item, InventoryLocation dst, int timeout_ms)
bool ExtendInventoryReservationEx (EntityAI item, InventoryLocation dst, int timeout_ms)
bool ClearInventoryReservationEx (EntityAI item, InventoryLocation dst)
proto native int GetAnyInventoryReservationCount ()
static proto native bool AddInventoryReservation (EntityAI item, InventoryLocation dst, int timeout_ms)
static proto native bool ExtendInventoryReservation (EntityAI item, InventoryLocation dst, int timeout_ms)
static proto native bool ClearInventoryReservation (EntityAI item, InventoryLocation dst)
static proto native bool HasInventoryReservation (EntityAI item, InventoryLocation dst)
 Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY, FindInventoryReservationMode.LEGACY).
static proto native bool HasInventoryReservationCanAdd (EntityAI item, InventoryLocation dst)
 Internally: !HasInventoryReservationEx(item, dst, FindInventoryReservationMode.ITEM, FindInventoryReservationMode.DST).
static proto native bool HasInventoryReservationEx (EntityAI item, InventoryLocation dst, FindInventoryReservationMode itemMode, FindInventoryReservationMode parentMode)
 itemMode will iterate over item reservations, parentMode will iterate over parent reservations
static proto native bool GetInventoryReservationCount (EntityAI item, InventoryLocation dst)
const float c_MaxItemDistanceRadius = 2.5
 anti-cheats
static proto native bool CheckRequestSrc (notnull Man requestingPlayer, notnull InventoryLocation src, float radius)
static proto native bool CheckDropRequest (notnull Man requestingPlayer, notnull InventoryLocation src, float radius)
static proto native bool CheckTakeItemRequest (notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
static proto native bool CheckMoveToDstRequest (notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
static proto native bool CheckSwapItemsRequest (notnull Man requestingPlayer, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, float radius)
static proto native bool CheckManipulatedObjectsDistances (notnull EntityAI e0, notnull EntityAI e1, float radius)

Detailed Description

script counterpart to engine's class Inventory

Definition at line 80 of file inventory.c.

Member Function Documentation

◆ AddEntityToInventory()

bool AddEntityToInventory ( notnull EntityAI item)
inlineprotected

Definition at line 926 of file inventory.c.

References FindFreeLocationFor(), and LocationAddEntity().

◆ AddInventoryReservation()

proto native bool AddInventoryReservation ( EntityAI item,
InventoryLocation dst,
int timeout_ms )
staticprotected

◆ AddInventoryReservationEx()

◆ AreChildrenAccessible()

bool AreChildrenAccessible ( )
inlineprotected

Returns true if item is considered reachable within inventory.

Definition at line 442 of file inventory.c.

References ErrorEx, and GetInventoryOwner().

◆ AttachmentCount()

◆ CanAddAttachment()

proto native bool CanAddAttachment ( notnull EntityAI e)
protected

◆ CanAddAttachmentEx()

proto native bool CanAddAttachmentEx ( notnull EntityAI e,
int slot )
protected

◆ CanAddEntityInCargo()

proto native bool CanAddEntityInCargo ( notnull EntityAI e,
bool flip )
protected

◆ CanAddEntityInCargoEx()

proto native bool CanAddEntityInCargoEx ( notnull EntityAI e,
int idx,
int row,
int col,
bool flip )
protected

◆ CanAddEntityInCargoExLoc()

proto native bool CanAddEntityInCargoExLoc ( InventoryLocation loc)
protected

◆ CanAddEntityInto()

bool CanAddEntityInto ( notnull EntityAI item,
FindInventoryLocationType flags = FindInventoryLocationType.ANY )
inlineprotected

Definition at line 961 of file inventory.c.

References FindFreeLocationFor().

Referenced by CanAddEntityIntoHands(), and CanAddEntityIntoInventory().

◆ CanAddEntityIntoHands()

bool CanAddEntityIntoHands ( notnull EntityAI item)
inlineprotected

Test if entity can be put into hands.

Definition at line 978 of file inventory.c.

References CanAddEntityInto().

Referenced by ManBase::OnQuickBarSingleUse().

◆ CanAddEntityIntoInventory()

bool CanAddEntityIntoInventory ( notnull EntityAI item)
inlineprotected

Test if entity can be put to the inventory (Cargo, ProxyCargo, Attachment).

Definition at line 970 of file inventory.c.

References CanAddEntityInto().

◆ CanAddEntityToInventory()

bool CanAddEntityToInventory ( notnull EntityAI item,
int flag = FindInventoryLocationType.ANY )
inlineprotected

Definition at line 906 of file inventory.c.

References FindFreeLocationFor().

◆ CanAddSwappedEntity()

proto native bool CanAddSwappedEntity ( notnull InventoryLocation src1,
notnull InventoryLocation src2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2 )
protected

◆ CanForceSwapEntities()

proto native bool CanForceSwapEntities ( notnull EntityAI item1,
InventoryLocation item1_dst,
notnull EntityAI item2,
out InventoryLocation item2_dst )
staticprotected

Referenced by CanForceSwapEntitiesEx().

◆ CanForceSwapEntitiesEx()

◆ CanLockInventoryWithKey()

proto native bool CanLockInventoryWithKey ( notnull EntityAI key)
protected

locks

◆ CanRemoveAttachment()

proto native bool CanRemoveAttachment ( EntityAI attachment)
protected

◆ CanRemoveAttachmentEx()

proto native bool CanRemoveAttachmentEx ( EntityAI attachment,
int slot )
protected

◆ CanRemoveEntity()

bool CanRemoveEntity ( )
inlineprotected

Returns if entity can be removed from its current location.

Definition at line 939 of file inventory.c.

References GetCurrentInventoryLocation(), and LocationCanRemoveEntity().

◆ CanRemoveEntityInCargo()

proto native bool CanRemoveEntityInCargo ( notnull EntityAI e)
protected

◆ CanRemoveEntityInCargoEx()

proto native bool CanRemoveEntityInCargoEx ( notnull EntityAI e,
int idx,
int row,
int col )
protected

◆ CanSwapEntities()

proto native bool CanSwapEntities ( notnull EntityAI item1,
notnull EntityAI item2 )
staticprotected

Referenced by CanSwapEntitiesEx().

◆ CanSwapEntitiesEx()

◆ CanUnlockInventoryWithKey()

proto native bool CanUnlockInventoryWithKey ( notnull EntityAI key)
protected

◆ CheckDropRequest()

proto native bool CheckDropRequest ( notnull Man requestingPlayer,
notnull InventoryLocation src,
float radius )
staticprotected

◆ CheckManipulatedObjectsDistances()

proto native bool CheckManipulatedObjectsDistances ( notnull EntityAI e0,
notnull EntityAI e1,
float radius )
staticprotected

◆ CheckMoveToDstRequest()

proto native bool CheckMoveToDstRequest ( notnull Man requestingPlayer,
notnull InventoryLocation src,
notnull InventoryLocation dst,
float radius )
staticprotected

◆ CheckRequestSrc()

proto native bool CheckRequestSrc ( notnull Man requestingPlayer,
notnull InventoryLocation src,
float radius )
staticprotected

◆ CheckSwapItemsRequest()

proto native bool CheckSwapItemsRequest ( notnull Man requestingPlayer,
notnull InventoryLocation src1,
notnull InventoryLocation src2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2,
float radius )
staticprotected

◆ CheckTakeItemRequest()

proto native bool CheckTakeItemRequest ( notnull Man requestingPlayer,
notnull InventoryLocation src,
notnull InventoryLocation dst,
float radius )
staticprotected

◆ ClearInventoryReservation()

proto native bool ClearInventoryReservation ( EntityAI item,
InventoryLocation dst )
staticprotected

◆ ClearInventoryReservationEx()

◆ CountInventory()

proto native int CountInventory ( )
protected

almost identical to EnumerateInventory except it does not return items

Returns
number of items

◆ CreateAttachment()

proto native EntityAI CreateAttachment ( string typeName)
protected

◆ CreateAttachmentEx()

proto native EntityAI CreateAttachmentEx ( string typeName,
int slotId )
protected

◆ CreateEntityInCargo()

proto native EntityAI CreateEntityInCargo ( string typeName)
protected

Create Entity of specified type in cargo of entity.

◆ CreateEntityInCargoEx()

proto native EntityAI CreateEntityInCargoEx ( string typeName,
int idx,
int row,
int col,
bool flip )
protected

Create Entity of specified type in cargo of entity at coordinates (row, col).

Parameters
typeNametype to create
rowthe row of cargo to be created at
colthe column of cargo to be created at

◆ CreateInInventory()

◆ DropEntity()

bool DropEntity ( InventoryMode mode,
EntityAI owner,
notnull EntityAI item )
inlineprotected

◆ DropEntityInBounds()

bool DropEntityInBounds ( InventoryMode mode,
EntityAI owner,
notnull EntityAI item,
vector halfExtents,
float angle,
float cosAngle,
float sinAngle )
inlineprotected

◆ DropEntityWithTransform()

bool DropEntityWithTransform ( InventoryMode mode,
EntityAI owner,
notnull EntityAI item,
vector transform[4] )
inlineprotected

◆ EEDelete()

void EEDelete ( EntityAI parent)
inlineprotected

Definition at line 862 of file inventory.c.

References GetInventoryOwner().

◆ EEInit()

◆ EnumerateInventory()

◆ ExtendInventoryReservation()

proto native bool ExtendInventoryReservation ( EntityAI item,
InventoryLocation dst,
int timeout_ms )
staticprotected

◆ ExtendInventoryReservationEx()

bool ExtendInventoryReservationEx ( EntityAI item,
InventoryLocation dst,
int timeout_ms )
inlineprotected

◆ FindAttachment()

◆ FindAttachmentByName()

proto native EntityAI FindAttachmentByName ( string slotName)
protected

Returns attached entity in slot (you can use EntityAI.GetActionComponentName to get slot id).

References slotName.

Referenced by RecipeBase::Do().

◆ FindFirstFreeLocationForNewEntity()

proto native bool FindFirstFreeLocationForNewEntity ( string item_type,
FindInventoryLocationType flags,
out notnull InventoryLocation loc )
protected

FindFirstFreeLocationForNewEntity.

Parameters
[in]item_typeitem type that would be placed in inventory
[out]locthe InventoryLocation the item can be placed to
Returns
true if found any, false otherwise

Referenced by ManBase::CreateCopyOfItemInInventory(), and CreateInInventory().

◆ FindFreeLocationFor()

proto native bool FindFreeLocationFor ( notnull EntityAI item,
FindInventoryLocationType flags,
out notnull InventoryLocation loc )
protected

◆ FindFreeLocationForEx()

proto native bool FindFreeLocationForEx ( notnull EntityAI item,
FindInventoryLocationType flags,
notnull InventoryLocation exclude,
out notnull InventoryLocation loc )
protected

FindFreeLocationForEx.

Parameters
[in]itemitem that would be placed in inventory
[out]locthe InventoryLocation the item can be placed to
Returns
true if found any, false otherwise

◆ FindFreeLocationsFor()

proto native int FindFreeLocationsFor ( notnull EntityAI item,
FindInventoryLocationType flags,
out notnull array< ref InventoryLocation > locs )
protected

◆ FindPlaceholderForSlot()

proto native EntityAI FindPlaceholderForSlot ( int slot)
protected

Returns placeholder entity for slot (naked arms, legs etc).

Referenced by ManBase::UpdateCorpseStateVisual().

◆ FlipCargo()

proto native void FlipCargo ( )
protected

◆ ForceSwapEntities()

bool ForceSwapEntities ( InventoryMode mode,
notnull EntityAI item1,
notnull EntityAI item2,
notnull InventoryLocation item2_dst )
inlineprotected

Definition at line 1252 of file inventory.c.

◆ GetAnyInventoryReservationCount()

proto native int GetAnyInventoryReservationCount ( )
protected

◆ GetAttachmentFromIndex()

◆ GetAttachmentSlotId()

proto native int GetAttachmentSlotId ( int index)
protected

◆ GetAttachmentSlotsCount()

proto native int GetAttachmentSlotsCount ( )
protected

◆ GetCargo()

◆ GetCargoFromIndex()

proto native CargoBase GetCargoFromIndex ( int index)
protected

◆ GetCurrentAttachmentSlotInfo()

bool GetCurrentAttachmentSlotInfo ( out int slot_id,
out string slot_name )
inlineprotected

Returns true if the item is currently attached and outputs attachment slot id and name.

Definition at line 456 of file inventory.c.

References GetCurrentInventoryLocation(), InventoryLocation::GetSlot(), InventorySlots::GetSlotName(), InventoryLocation::GetType(), and InventorySlots::INVALID.

Referenced by ManBase::HideHairSelections().

◆ GetCurrentInventoryLocation()

◆ GetFlipCargo()

proto native bool GetFlipCargo ( )
protected

◆ GetInventoryCheckContext()

int GetInventoryCheckContext ( )
inlinestaticprotected

Definition at line 375 of file inventory.c.

References m_inventory_check_context.

Referenced by Container_Base::CanReceiveItemIntoCargo().

◆ GetInventoryOwner()

◆ GetInventoryReservationCount()

proto native bool GetInventoryReservationCount ( EntityAI item,
InventoryLocation dst )
staticprotected

◆ GetScriptLockCount()

proto native int GetScriptLockCount ( )
protected

◆ GetSlotId()

◆ GetSlotIdCount()

◆ GetSlotLock()

proto native bool GetSlotLock ( int slot)
protected

◆ HasAttachment()

proto native bool HasAttachment ( notnull EntityAI e)
protected

◆ HasAttachmentEx()

proto native bool HasAttachmentEx ( notnull EntityAI e,
int slot )
protected

◆ HasAttachmentSlot()

bool HasAttachmentSlot ( int slotId)
inlineprotected

Definition at line 188 of file inventory.c.

References GetAttachmentSlotId(), and GetAttachmentSlotsCount().

◆ HasEntityInCargo()

proto native bool HasEntityInCargo ( notnull EntityAI e)
protected

◆ HasEntityInCargoEx()

proto native bool HasEntityInCargoEx ( notnull EntityAI e,
int idx,
int row,
int col )
protected

◆ HasEntityInInventory()

proto native bool HasEntityInInventory ( notnull EntityAI item)
protected

◆ HasInventoryReservation()

proto native bool HasInventoryReservation ( EntityAI item,
InventoryLocation dst )
staticprotected

Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY, FindInventoryReservationMode.LEGACY).

Referenced by WeaponManager::InventoryReservation(), HandStateEquipped::OnEntry(), ManBase::OnQuickBarSingleUse(), DeferredSwapEntities::ReserveInventory(), and ReserveInventory().

◆ HasInventoryReservationCanAdd()

proto native bool HasInventoryReservationCanAdd ( EntityAI item,
InventoryLocation dst )
staticprotected

Internally: !HasInventoryReservationEx(item, dst, FindInventoryReservationMode.ITEM, FindInventoryReservationMode.DST).

◆ HasInventoryReservationEx()

proto native bool HasInventoryReservationEx ( EntityAI item,
InventoryLocation dst,
FindInventoryReservationMode itemMode,
FindInventoryReservationMode parentMode )
staticprotected

itemMode will iterate over item reservations, parentMode will iterate over parent reservations

◆ HasInventorySlot()

proto native bool HasInventorySlot ( int slotId)
protected

Referenced by SlotToAnimType().

◆ HasKeys()

proto native bool HasKeys ( )
protected

◆ Init()

void Init ( )
inlineprotected

script functions

called by engine right after creation of entity

Definition at line 831 of file inventory.c.

References GetInventoryOwner().

◆ IsAttachment()

bool IsAttachment ( )
inlineprotected

Returns true if this Inventory owner is an attachment of something.

Definition at line 410 of file inventory.c.

References GetCurrentInventoryLocation(), and InventoryLocation::GetType().

◆ IsCargoInHiearchy()

bool IsCargoInHiearchy ( )
inlineprotected

Returns true if inventory owner or his hiearchy parents are in cargo.

Definition at line 423 of file inventory.c.

References GetInventoryOwner(), InventoryLocation::GetType(), and InventoryLocation::IsValid().

◆ IsInCargo()

bool IsInCargo ( )
inlineprotected

Returns true if this Inventory owner is in cargo of something.

Definition at line 397 of file inventory.c.

References GetCurrentInventoryLocation(), and InventoryLocation::GetType().

Referenced by EntityLightSource::CheckIfParentIsInCargo().

◆ IsInventoryLocked()

proto native bool IsInventoryLocked ( )
protected

◆ IsInventoryLockedForLockType()

proto native bool IsInventoryLockedForLockType ( int lockType)
protected

◆ IsInventoryUnlocked()

proto native bool IsInventoryUnlocked ( )
protected

◆ IsPlaceholderEntity()

proto native bool IsPlaceholderEntity ( notnull Object e)
protected

◆ LocalDestroyEntity()

bool LocalDestroyEntity ( notnull EntityAI item)
inlineprotected

◆ LocationAddEntity()

proto native bool LocationAddEntity ( notnull InventoryLocation inv_loc)
staticprotected

◆ LocationCanAddEntity()

proto native bool LocationCanAddEntity ( notnull InventoryLocation inv_loc)
staticprotected

◆ LocationCanAddEntityEx()

bool LocationCanAddEntityEx ( notnull InventoryLocation inv_loc)
inlinestaticprotected

Definition at line 350 of file inventory.c.

References LocationCanAddEntity().

◆ LocationCanMoveEntity()

◆ LocationCanMoveEntitySyncCheck()

bool LocationCanMoveEntitySyncCheck ( notnull InventoryLocation src,
notnull InventoryLocation dst )
inlinestaticprotected

Definition at line 380 of file inventory.c.

References LocationCanMoveEntity(), and m_inventory_check_context.

Referenced by ValidateSyncMove().

◆ LocationCanRemoveEntity()

proto native bool LocationCanRemoveEntity ( notnull InventoryLocation inv_loc)
staticprotected

◆ LocationCreateEntity()

◆ LocationCreateLocalEntity()

proto native EntityAI LocationCreateLocalEntity ( notnull InventoryLocation inv_loc,
string type,
int iSetupFlags,
int iRotation )
staticprotected

◆ LocationGetEntity()

proto native EntityAI LocationGetEntity ( notnull InventoryLocation inv_loc)
staticprotected

◆ LocationMoveEntity()

proto native bool LocationMoveEntity ( notnull InventoryLocation src_loc,
notnull InventoryLocation dst_loc )
staticprotected

◆ LocationRemoveEntity()

proto native bool LocationRemoveEntity ( notnull InventoryLocation inv_loc)
staticprotected

◆ LocationSwap()

proto native bool LocationSwap ( notnull InventoryLocation src1,
notnull InventoryLocation src2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2 )
staticprotected

◆ LocationSyncMoveEntity()

◆ LocationTestAddEntity()

proto native bool LocationTestAddEntity ( notnull InventoryLocation inv_loc,
bool do_resevation_check,
bool do_item_check,
bool do_lock_check,
bool do_occupancy_test,
bool do_script_check,
bool do_script_load_check )
staticprotected

◆ LockInventory()

◆ LockInventoryWithKey()

proto native void LockInventoryWithKey ( notnull EntityAI key)
protected

◆ MakeDstForSwap()

bool MakeDstForSwap ( notnull InventoryLocation src1,
notnull InventoryLocation src2,
out InventoryLocation dst1,
out InventoryLocation dst2 )
inlinestaticprotected

helper function for swap

Definition at line 1192 of file inventory.c.

Referenced by MakeSrcAndDstForSwap().

◆ MakeSrcAndDstForForceSwap()

bool MakeSrcAndDstForForceSwap ( notnull EntityAI item1,
notnull EntityAI item2,
out InventoryLocation src1,
out InventoryLocation src2,
out InventoryLocation dst1,
notnull InventoryLocation dst2 )
inlinestaticprotected

helper function for ForceSwap

Definition at line 1223 of file inventory.c.

Referenced by ForceSwapEntities(), and HumanInventory::ForceSwapEntities().

◆ MakeSrcAndDstForSwap()

bool MakeSrcAndDstForSwap ( notnull EntityAI item1,
notnull EntityAI item2,
out InventoryLocation src1,
out InventoryLocation src2,
out InventoryLocation dst1,
out InventoryLocation dst2 )
inlinestaticprotected

helper function for swap

Definition at line 1211 of file inventory.c.

References MakeDstForSwap().

Referenced by HandleSwapEntities(), HumanInventory::SwapEntities(), and SwapEntities().

◆ OnAfterStoreLoad()

void OnAfterStoreLoad ( )
protected

◆ OnInputUserDataProcess()

bool OnInputUserDataProcess ( ParamsReadContext ctx)
protected

synchronization

◆ OnInventoryFailure()

void OnInventoryFailure ( InventoryCommandType type,
InventoryValidationReason reason,
InventoryLocation src,
InventoryLocation dst )
protected

Referenced by DropEntity().

◆ OnInventoryJunctureFailureFromServer()

void OnInventoryJunctureFailureFromServer ( ParamsReadContext ctx)
protected

◆ OnInventoryJunctureFromServer()

bool OnInventoryJunctureFromServer ( ParamsReadContext ctx)
protected

◆ OnServerInventoryCommand()

void OnServerInventoryCommand ( ParamsReadContext ctx)
protected

◆ OnServerInventoryCommandStatic()

◆ OnStoreLoad()

bool OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprotected

db load hooks

Definition at line 837 of file inventory.c.

◆ OnStoreSave()

void OnStoreSave ( ParamsWriteContext ctx)
protected

db store hook

◆ PrepareDropEntityPos()

proto native bool PrepareDropEntityPos ( EntityAI owner,
notnull EntityAI item,
out vector mat[4],
bool useValuesInMatrix = false,
int conflictCheckDepth = -1 )
staticprotected

◆ ReplaceItemWithNew()

◆ ResetFlipCargo()

proto native void ResetFlipCargo ( )
protected

Referenced by Entity::EEInventoryOut().

◆ ServerHandEvent()

proto native bool ServerHandEvent ( notnull Man player,
notnull EntityAI item,
ParamsWriteContext ctx )
staticprotected

◆ ServerLocationMoveEntity()

proto native bool ServerLocationMoveEntity ( notnull EntityAI item,
ParamsWriteContext ctx )
staticprotected

◆ ServerLocationSwap()

proto native bool ServerLocationSwap ( notnull InventoryLocation src1,
notnull InventoryLocation src2,
notnull InventoryLocation dst1,
notnull InventoryLocation dst2,
ParamsWriteContext ctx )
staticprotected

◆ ServerLocationSyncMoveEntity()

proto native bool ServerLocationSyncMoveEntity ( Man player,
notnull EntityAI item,
ParamsWriteContext ctx )
staticprotected

◆ SetFlipCargo()

proto native void SetFlipCargo ( bool flip)
protected

◆ SetGroundPosByOwner()

◆ SetGroundPosByOwnerBounds()

void SetGroundPosByOwnerBounds ( EntityAI owner,
notnull EntityAI item,
out InventoryLocation ground,
vector halfExtents,
float angle,
float cosAngle,
float sinAngle )
inlinestaticprotected

Definition at line 1309 of file inventory.c.

References Math::RandomFloat(), vector::RotateAroundZero(), vector::Up, and Vector().

Referenced by DropEntityInBounds().

◆ SetGroundPosByTransform()

bool SetGroundPosByTransform ( EntityAI owner,
notnull EntityAI item,
out InventoryLocation ground,
vector transform[4] )
inlinestaticprotected

◆ SetSlotLock()

proto native bool SetSlotLock ( int slot,
bool locked )
protected

◆ SwapEntities()

bool SwapEntities ( InventoryMode mode,
notnull EntityAI item1,
notnull EntityAI item2 )
inlineprotected

Definition at line 1247 of file inventory.c.

◆ TakeEntityAsAttachment()

bool TakeEntityAsAttachment ( InventoryMode mode,
notnull EntityAI item )
inlineprotected

◆ TakeEntityAsAttachmentEx()

bool TakeEntityAsAttachmentEx ( InventoryMode mode,
notnull EntityAI item,
int slot )
inlineprotected

◆ TakeEntityAsTargetAttachment()

bool TakeEntityAsTargetAttachment ( InventoryMode mode,
notnull EntityAI target,
notnull EntityAI item )
inlineprotected

◆ TakeEntityAsTargetAttachmentEx()

bool TakeEntityAsTargetAttachmentEx ( InventoryMode mode,
notnull EntityAI target,
notnull EntityAI item,
int slot )
inlineprotected

put item as attachment of target

Definition at line 1137 of file inventory.c.

References Error(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), InventoryLocation::SetAttachment(), and TakeToDst().

Referenced by TakeEntityAsAttachmentEx().

◆ TakeEntityToCargo()

bool TakeEntityToCargo ( InventoryMode mode,
notnull EntityAI item )
inlineprotected

◆ TakeEntityToCargoEx()

◆ TakeEntityToInventory()

bool TakeEntityToInventory ( InventoryMode mode,
FindInventoryLocationType flags,
notnull EntityAI item )
inlineprotected

◆ TakeEntityToTargetCargo()

bool TakeEntityToTargetCargo ( InventoryMode mode,
notnull EntityAI target,
notnull EntityAI item )
inlineprotected

Put item into into cargo of another entity.

Definition at line 1087 of file inventory.c.

References inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeEntityToTargetInventory().

◆ TakeEntityToTargetCargoEx()

bool TakeEntityToTargetCargoEx ( InventoryMode mode,
notnull CargoBase cargo,
notnull EntityAI item,
int row,
int col )
inlineprotected

Put item into into cargo on specific cargo location of another entity.

Definition at line 1115 of file inventory.c.

References Error(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), InventoryLocation::SetCargoAuto(), and TakeToDst().

◆ TakeEntityToTargetInventory()

bool TakeEntityToTargetInventory ( InventoryMode mode,
notnull EntityAI target,
FindInventoryLocationType flags,
notnull EntityAI item )
inlineprotected

helper that finds location first, then moves the entity into it

Definition at line 1031 of file inventory.c.

References Error(), inventoryDebugPrint(), LogManager::IsInventoryMoveLogEnable(), and TakeToDst().

Referenced by TakeEntityAsTargetAttachment(), and TakeEntityToTargetCargo().

◆ TakeToDst()

◆ TestAddEntityInCargoEx()

proto native bool TestAddEntityInCargoEx ( notnull EntityAI e,
int idx,
int row,
int col,
bool flip,
bool do_resevation_check,
bool do_item_check,
bool do_lock_check,
bool do_occupancy_test,
bool do_script_check,
bool do_script_load_check )
protected

◆ TestAddEntityInCargoExLoc()

proto native bool TestAddEntityInCargoExLoc ( notnull InventoryLocation loc,
bool do_resevation_check,
bool do_item_check,
bool do_lock_check,
bool do_occupancy_test,
bool do_script_check,
bool do_script_load_check )
protected

◆ TestDropEntityPos()

proto native bool TestDropEntityPos ( EntityAI owner,
notnull EntityAI item,
out vector mat[4],
bool useValuesInMatrix = false,
int conflictCheckDepth = -1 )
staticprotected

◆ UnlockInventory()

◆ UnlockInventoryWithKey()

proto native void UnlockInventoryWithKey ( notnull EntityAI key)
protected

Field Documentation

◆ c_InventoryReservationTimeoutMS

◆ c_InventoryReservationTimeoutShortMS

◆ c_MaxItemDistanceRadius

◆ m_inventory_check_context

int m_inventory_check_context = InventoryCheckContext.DEFAULT
staticprotected

Definition at line 82 of file inventory.c.

Referenced by GetInventoryCheckContext(), and LocationCanMoveEntitySyncCheck().


The documentation for this class was generated from the following file:
  • F:/Games/Dayz/scripts/3_game/systems/inventory/inventory.c