Dayz Explorer 1.29.162510
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

proto native bool GetCurrentInventoryLocation (out notnull InventoryLocation loc)
 returns information about current item location
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 bool FindFirstFreeLocationForNewEntity (string item_type, FindInventoryLocationType flags, out notnull InventoryLocation loc)
 FindFirstFreeLocationForNewEntity.
proto native int FindFreeLocationsFor (notnull EntityAI item, FindInventoryLocationType flags, out notnull array< ref InventoryLocation > locs)
 searches inventory for suitable location for @item
bool IsInCargo ()
 Returns true if this Inventory owner is in cargo of something.
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 AreChildrenAccessible ()
 Returns true if item is considered reachable within inventory.
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 CanAddSwappedEntity (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
void OnInventoryFailure (InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
bool TakeEntityToInventory (InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
 Put item anywhere into this entity (as attachment or into cargo, recursively).
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)
 move src to dst
bool TakeEntityToCargo (InventoryMode mode, notnull EntityAI item)
 moves item to cargo of this intentory
bool TakeEntityToTargetCargo (InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
 Put item into into cargo of another entity.
bool TakeEntityToCargoEx (InventoryMode mode, notnull EntityAI item, int idx, int row, int col)
 moves item on specific cargo location
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 TakeEntityAsAttachmentEx (InventoryMode mode, notnull EntityAI item, int slot)
bool TakeEntityAsTargetAttachmentEx (InventoryMode mode, notnull EntityAI target, notnull EntityAI item, int slot)
 put item as attachment of target
bool TakeEntityAsAttachment (InventoryMode mode, notnull EntityAI item)
bool TakeEntityAsTargetAttachment (InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
bool SwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
bool ForceSwapEntities (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
bool DropEntity (InventoryMode mode, EntityAI owner, notnull EntityAI item)
bool DropEntityWithTransform (InventoryMode mode, EntityAI owner, notnull EntityAI item, vector transform[4])
bool DropEntityInBounds (InventoryMode mode, EntityAI owner, notnull EntityAI item, vector halfExtents, float angle, float cosAngle, float sinAngle)
bool LocalDestroyEntity (notnull EntityAI item)
bool ReplaceItemWithNew (InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
proto native bool GetFlipCargo ()
proto native void SetFlipCargo (bool flip)
proto native void FlipCargo ()
proto native void ResetFlipCargo ()
proto native EntityAI GetInventoryOwner ()
 Engine native functions.
proto native bool HasEntityInInventory (notnull EntityAI item)
 query inventory if item is somewhere
proto native bool EnumerateInventory (InventoryTraversalType tt, out array< EntityAI > items)
 enumerate inventory using traversal type and filling items array
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)
 attachments
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)
 Create Entity of specified type as attachment of entity.
proto native EntityAI CreateAttachmentEx (string typeName, int slotId)
 Create Entity of specified type as attachment of entity.
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)
 brief Returns True if entity is attached to this
proto native bool HasAttachmentEx (notnull EntityAI e, int slot)
 brief Returns True if entity is attached to this in slot
proto native bool CanAddAttachment (notnull EntityAI e)
 Check if attachment can be added to any slot.
proto native bool CanAddAttachmentEx (notnull EntityAI e, int slot)
 Check if attachment can be added to slot @NOTE: Note that slot index IS NOT slot ID! Slot ID is defined in DZ/data/config.cpp.
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)
 creates entity somewhere in inventory
bool CanAddEntityToInventory (notnull EntityAI item, int flag=FindInventoryLocationType.ANY)
 ask inventory if item could be placed somewhere in inventory
bool AddEntityToInventory (notnull EntityAI item)
 add entity somewhere in inventory
bool CanRemoveEntity ()
 Returns if entity can be removed from its current location.
bool CanAddEntityInto (notnull EntityAI item, FindInventoryLocationType flags=FindInventoryLocationType.ANY)
 Asks inventory if item could be placed in inventory, hands, etc.
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 EntityAI LocationCreateEntity (notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
 creates new item directly at location
static proto native EntityAI LocationCreateLocalEntity (notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
 creates new local item directly at location @NOTE: the item is created localy, i.e. it's not registered to network
static proto native bool LocationCanAddEntity (notnull InventoryLocation inv_loc)
 queries if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/...
static bool LocationCanAddEntityEx (notnull InventoryLocation inv_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)
 test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/...
static proto native bool LocationCanRemoveEntity (notnull InventoryLocation inv_loc)
 queries if the entity contained in inv_loc.m_item can be removed from ground/attachment/cargo/hands/...
static proto native bool LocationCanMoveEntity (notnull InventoryLocation src, notnull InventoryLocation dst)
 queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthand for CanRemove + CanAdd query
static int GetInventoryCheckContext ()
static bool LocationCanMoveEntitySyncCheck (notnull InventoryLocation src, notnull InventoryLocation dst)
static proto native EntityAI LocationGetEntity (notnull InventoryLocation inv_loc)
static void OnServerInventoryCommandStatic (ParamsReadContext ctx)
static proto native bool LocationAddEntity (notnull InventoryLocation inv_loc)
 adds item to inventory location
static proto native bool LocationRemoveEntity (notnull InventoryLocation inv_loc)
 removes item from inventory location
static proto native bool LocationMoveEntity (notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
 removes item from current inventory location and adds it to destination
static proto native bool LocationSyncMoveEntity (notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
 synchronously removes item from current inventory location and adds it to destination no anims involved
static proto native bool LocationSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
 swaps two entities
static proto native bool ServerLocationMoveEntity (notnull EntityAI item, ParamsWriteContext ctx)
 removes item from current inventory location and adds it to destination + sync via inventory command
static proto native bool ServerLocationSyncMoveEntity (Man player, notnull EntityAI item, ParamsWriteContext ctx)
 synchronously removes item from current inventory location and adds it to destination + sync via inventory command no anims involved
static proto native bool ServerLocationSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, ParamsWriteContext ctx)
 swaps two entities
static proto native bool ServerHandEvent (notnull Man player, notnull EntityAI item, ParamsWriteContext ctx)
 hand event to clients
static proto native bool PrepareDropEntityPos (EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1)
 Finds a transformation for the item to be dropped to If the initial transforation overlaps with another conflicting entity (i.e. car) then the transform will be snapped to the nearest outer edge. If no valid snapping transformation could be found, then the output from 'PlaceOnSurface' is used.
static proto native bool TestDropEntityPos (EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1)
static proto native bool CanSwapEntities (notnull EntityAI item1, notnull EntityAI item2)
 test if ordinary swap can be performed.
static bool CanSwapEntitiesEx (notnull EntityAI item1, notnull EntityAI item2)
static proto native bool CanForceSwapEntities (notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
 test if forced swap can be performed.
static bool CanForceSwapEntitiesEx (notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
static bool MakeDstForSwap (notnull InventoryLocation src1, notnull InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2)
 helper function for swap
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 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 SetGroundPosByOwner (EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
static bool SetGroundPosByTransform (EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector transform[4])
static void SetGroundPosByOwnerBounds (EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector halfExtents, float angle, float cosAngle, float sinAngle)

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 GameInventory::AddEntityToInventory ( notnull EntityAI item)
protected

add entity somewhere in inventory

All available inventory locations (hands, cargo, attachments, proxycargo, ...) are traversed recursively from root to leafs.

@NOTE: AddEntityToInventory does not perform the checks the CanAddEntityToInventory does (script conditions for example). if not sure, always call CanAddEntityToInventory before AddEntityToInventory.

Parameters
[in]itemitem to be placed in inventory
Returns
true if item can be added, false otherwise

Definition at line 926 of file inventory.c.

◆ AddInventoryReservation()

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

◆ AddInventoryReservationEx()

bool GameInventory::AddInventoryReservationEx ( EntityAI item,
InventoryLocation dst,
int timeout_ms )
protected

Definition at line 718 of file inventory.c.

◆ AreChildrenAccessible()

bool GameInventory::AreChildrenAccessible ( )
protected

Returns true if item is considered reachable within inventory.

Definition at line 442 of file inventory.c.

◆ AttachmentCount()

proto native int GameInventory::AttachmentCount ( )
protected

Returns count of attachments attached to this item.

◆ CanAddAttachment()

proto native bool GameInventory::CanAddAttachment ( notnull EntityAI e)
protected

Check if attachment can be added to any slot.

Returns
true if entity can be added as attachment

◆ CanAddAttachmentEx()

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

Check if attachment can be added to slot @NOTE: Note that slot index IS NOT slot ID! Slot ID is defined in DZ/data/config.cpp.

◆ CanAddEntityInCargo()

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

◆ CanAddEntityInCargoEx()

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

◆ CanAddEntityInCargoExLoc()

proto native bool GameInventory::CanAddEntityInCargoExLoc ( InventoryLocation loc)
protected

◆ CanAddEntityInto()

bool GameInventory::CanAddEntityInto ( notnull EntityAI item,
FindInventoryLocationType flags = FindInventoryLocationType.ANY )
protected

Asks inventory if item could be placed in inventory, hands, etc.

Location is based on the flags parameter. This method is used in methods that are asking for if item can be placed in specific location, like CanAddEntityToInventory, CanAddEntityInHands, etc.

Parameters
[in]itemitem to be placed in inventory
[in]flagsFindInventoryLocationType
Returns
true if item can be added, false otherwise

Definition at line 961 of file inventory.c.

◆ CanAddEntityIntoHands()

bool GameInventory::CanAddEntityIntoHands ( notnull EntityAI item)
protected

Test if entity can be put into hands.

Definition at line 978 of file inventory.c.

◆ CanAddEntityIntoInventory()

bool GameInventory::CanAddEntityIntoInventory ( notnull EntityAI item)
protected

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

Definition at line 970 of file inventory.c.

◆ CanAddEntityToInventory()

bool GameInventory::CanAddEntityToInventory ( notnull EntityAI item,
int flag = FindInventoryLocationType.ANY )
protected

ask inventory if item could be placed somewhere in inventory

All available inventory locations (hands, cargo, attachments, proxycargo, ...) are traversed recursively from root to leafs.

Parameters
[in]itemitem to be placed in inventory
Returns
true if item can be added, false otherwise

Definition at line 906 of file inventory.c.

◆ CanAddSwappedEntity()

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

◆ CanForceSwapEntities()

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

test if forced swap can be performed.

Parameters
[in]item1is the forced item (primary)
[in]item1_dstoptional destination for item1 (null if item1 goes to place of item2)
[in]item2second item that will be replaced by the item1. (secondary)
[out]item2_dstsecond item's potential destination (if null, search for item_dst2 is ommited). if (NOT null AND IsValid()), then it is tried first, without search to inventory
Returns
true if can be force swapped

◆ CanForceSwapEntitiesEx()

bool GameInventory::CanForceSwapEntitiesEx ( notnull EntityAI item1,
InventoryLocation item1_dst,
notnull EntityAI item2,
out InventoryLocation item2_dst )
staticprotected

Definition at line 666 of file inventory.c.

◆ CanLockInventoryWithKey()

proto native bool GameInventory::CanLockInventoryWithKey ( notnull EntityAI key)
protected

locks

◆ CanRemoveAttachment()

proto native bool GameInventory::CanRemoveAttachment ( EntityAI attachment)
protected

◆ CanRemoveAttachmentEx()

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

◆ CanRemoveEntity()

bool GameInventory::CanRemoveEntity ( )
protected

Returns if entity can be removed from its current location.

Definition at line 939 of file inventory.c.

◆ CanRemoveEntityInCargo()

proto native bool GameInventory::CanRemoveEntityInCargo ( notnull EntityAI e)
protected

◆ CanRemoveEntityInCargoEx()

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

◆ CanSwapEntities()

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

test if ordinary swap can be performed.

Ordinary in the sense that the two items has equal sizes and can be swapped without additional space.

Parameters
[in]item1first item
[in]item2second item
Returns
true if can be swapped

◆ CanSwapEntitiesEx()

bool GameInventory::CanSwapEntitiesEx ( notnull EntityAI item1,
notnull EntityAI item2 )
staticprotected

Definition at line 630 of file inventory.c.

◆ CanUnlockInventoryWithKey()

proto native bool GameInventory::CanUnlockInventoryWithKey ( notnull EntityAI key)
protected

◆ CheckDropRequest()

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

◆ CheckManipulatedObjectsDistances()

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

◆ CheckMoveToDstRequest()

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

◆ CheckRequestSrc()

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

◆ CheckSwapItemsRequest()

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

◆ CheckTakeItemRequest()

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

◆ ClearInventoryReservation()

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

◆ ClearInventoryReservationEx()

bool GameInventory::ClearInventoryReservationEx ( EntityAI item,
InventoryLocation dst )
protected

Definition at line 764 of file inventory.c.

◆ CountInventory()

proto native int GameInventory::CountInventory ( )
protected

almost identical to EnumerateInventory except it does not return items

Returns
number of items

◆ CreateAttachment()

proto native EntityAI GameInventory::CreateAttachment ( string typeName)
protected

Create Entity of specified type as attachment of entity.

◆ CreateAttachmentEx()

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

Create Entity of specified type as attachment of entity.

Parameters
typeNametype to create
slotIdthe slot to be created in

◆ CreateEntityInCargo()

proto native EntityAI GameInventory::CreateEntityInCargo ( string typeName)
protected

Create Entity of specified type in cargo of entity.

◆ CreateEntityInCargoEx()

proto native EntityAI GameInventory::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()

EntityAI GameInventory::CreateInInventory ( string type)
protected

creates entity somewhere in inventory

Parameters
[in]typeitem type to be placed in inventory
Returns
created entity or null

Definition at line 876 of file inventory.c.

◆ DropEntity()

bool GameInventory::DropEntity ( InventoryMode mode,
EntityAI owner,
notnull EntityAI item )
protected

Definition at line 1266 of file inventory.c.

◆ DropEntityInBounds()

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

Definition at line 1328 of file inventory.c.

◆ DropEntityWithTransform()

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

Definition at line 1293 of file inventory.c.

◆ EEDelete()

void GameInventory::EEDelete ( EntityAI parent)
protected

Definition at line 862 of file inventory.c.

◆ EEInit()

void GameInventory::EEInit ( )
protected

Definition at line 845 of file inventory.c.

◆ EnumerateInventory()

proto native bool GameInventory::EnumerateInventory ( InventoryTraversalType tt,
out array< EntityAI > items )
protected

enumerate inventory using traversal type and filling items array

Parameters
[in]ttused traversal type
[out]itemsitems in inventory (in order determined by traversal)
Returns
true if found any, false otherwise

◆ ExtendInventoryReservation()

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

◆ ExtendInventoryReservationEx()

bool GameInventory::ExtendInventoryReservationEx ( EntityAI item,
InventoryLocation dst,
int timeout_ms )
protected

Definition at line 741 of file inventory.c.

◆ FindAttachment()

proto native EntityAI GameInventory::FindAttachment ( int slot)
protected

Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id).

◆ FindAttachmentByName()

proto native EntityAI GameInventory::FindAttachmentByName ( string slotName)
protected

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

◆ FindFirstFreeLocationForNewEntity()

proto native bool GameInventory::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

◆ FindFreeLocationFor()

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

FindFreeLocationFor.

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

◆ FindFreeLocationForEx()

proto native bool GameInventory::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 GameInventory::FindFreeLocationsFor ( notnull EntityAI item,
FindInventoryLocationType flags,
out notnull array< ref InventoryLocation > locs )
protected

searches inventory for suitable location for @item

Parameters
[in]itemitem that would be placed in inventory
[in]flagsflags affecting selection (
See also
FindInventoryLocation )
Parameters
[out]locsarray of InventoryLocations the item can be placed to
Returns
number of suitable inventory locations

Example:

Entity bino = g_Game.CreateObject("Binoculars", "3312 0 854");
EntityAI bino2;
if (Class.CastTo(bino2, bino))
{
array<ref InventoryLocation> a = new array<ref InventoryLocation>; // 1) allocate memory for array
for (int i = 0; i < 10; ++i)
{
a.Insert(new InventoryLocation); // 2) pre-allocate inventorylocations from script. engine only fills them in, engine does not allocate memory to avoid mixing.
}
int sz = player.FindFreeLocationsFor(bino, FindInventoryLocationType.ANY_CARGO | FindInventoryLocationType.ATTACHMENT, a); // 3) ask engine to fill the locations
if (sz > 0)
{
bino2.GetCurrentInventoryLocation(src); // 5) get current location
InventoryLocation dst = a[0]; // 6) get first (this is only example)
... use src and dst
}
}
Super root of all classes in Enforce script.
Definition enscript.c:11
Definition camera.c:2
InventoryLocation.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZGame g_Game
Definition dayzgame.c:3942
FindInventoryLocationType
flags for searching locations in inventory

◆ FindPlaceholderForSlot()

proto native EntityAI GameInventory::FindPlaceholderForSlot ( int slot)
protected

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

◆ FlipCargo()

proto native void GameInventory::FlipCargo ( )
protected

◆ ForceSwapEntities()

bool GameInventory::ForceSwapEntities ( InventoryMode mode,
notnull EntityAI item1,
notnull EntityAI item2,
notnull InventoryLocation item2_dst )
protected

Definition at line 1252 of file inventory.c.

◆ GetAnyInventoryReservationCount()

proto native int GameInventory::GetAnyInventoryReservationCount ( )
protected

◆ GetAttachmentFromIndex()

proto native EntityAI GameInventory::GetAttachmentFromIndex ( int index)
protected
Returns
attached entity by attachment index @NOTE: index is not slot! for getting attachment by slot use FindAttachment

◆ GetAttachmentSlotId()

proto native int GameInventory::GetAttachmentSlotId ( int index)
protected
Parameters
indexindex of the slot for attachment (
See also
GetAttachmentSlotsCount)
Returns
slot for attachment

◆ GetAttachmentSlotsCount()

proto native int GameInventory::GetAttachmentSlotsCount ( )
protected
Returns
number of slots for attachments

◆ GetCargo()

proto native CargoBase GameInventory::GetCargo ( )
protected

cargo

◆ GetCargoFromIndex()

proto native CargoBase GameInventory::GetCargoFromIndex ( int index)
protected

◆ GetCurrentAttachmentSlotInfo()

bool GameInventory::GetCurrentAttachmentSlotInfo ( out int slot_id,
out string slot_name )
protected

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

Definition at line 456 of file inventory.c.

◆ GetCurrentInventoryLocation()

proto native bool GameInventory::GetCurrentInventoryLocation ( out notnull InventoryLocation loc)
protected

returns information about current item location

Parameters
[out]loccurrent InventoryLocation
Returns
true if current location retrieved (and is valid)

◆ GetFlipCargo()

proto native bool GameInventory::GetFlipCargo ( )
protected

◆ GetInventoryCheckContext()

int GameInventory::GetInventoryCheckContext ( )
staticprotected

Definition at line 375 of file inventory.c.

◆ GetInventoryOwner()

proto native EntityAI GameInventory::GetInventoryOwner ( )
protected

Engine native functions.

Returns
entity associated with this inventory

◆ GetInventoryReservationCount()

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

◆ GetScriptLockCount()

proto native int GameInventory::GetScriptLockCount ( )
protected

◆ GetSlotId()

proto native int GameInventory::GetSlotId ( int index)
protected

attachments

Parameters
indexindex into array of configured slots (
See also
GetSlotIdCount)
Returns
slot where this item belongs

◆ GetSlotIdCount()

proto native int GameInventory::GetSlotIdCount ( )
protected
Returns
number of slots this item can belong to

◆ GetSlotLock()

proto native bool GameInventory::GetSlotLock ( int slot)
protected

◆ HasAttachment()

proto native bool GameInventory::HasAttachment ( notnull EntityAI e)
protected

brief Returns True if entity is attached to this

◆ HasAttachmentEx()

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

brief Returns True if entity is attached to this in slot

◆ HasAttachmentSlot()

bool GameInventory::HasAttachmentSlot ( int slotId)
protected
Returns
true if this entity has attachments slot with id=slotId

Definition at line 188 of file inventory.c.

◆ HasEntityInCargo()

proto native bool GameInventory::HasEntityInCargo ( notnull EntityAI e)
protected

◆ HasEntityInCargoEx()

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

◆ HasEntityInInventory()

proto native bool GameInventory::HasEntityInInventory ( notnull EntityAI item)
protected

query inventory if item is somewhere

All available inventory locations (hands, cargo, attachments, proxycargo, ...) are traversed recursively from root to leafs.

Parameters
[in]itemitem to be found in inventory
Returns
true if found, false otherwise

◆ HasInventoryReservation()

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

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

◆ HasInventoryReservationCanAdd()

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

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

◆ HasInventoryReservationEx()

proto native bool GameInventory::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 GameInventory::HasInventorySlot ( int slotId)
protected
Returns
true if this entity has inventory slot with id=slotId

◆ HasKeys()

proto native bool GameInventory::HasKeys ( )
protected

◆ Init()

void GameInventory::Init ( )
protected

script functions

called by engine right after creation of entity

Definition at line 831 of file inventory.c.

◆ IsAttachment()

bool GameInventory::IsAttachment ( )
protected

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

Definition at line 410 of file inventory.c.

◆ IsCargoInHiearchy()

bool GameInventory::IsCargoInHiearchy ( )
protected

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

Definition at line 423 of file inventory.c.

◆ IsInCargo()

bool GameInventory::IsInCargo ( )
protected

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

Definition at line 397 of file inventory.c.

◆ IsInventoryLocked()

proto native bool GameInventory::IsInventoryLocked ( )
protected

◆ IsInventoryLockedForLockType()

proto native bool GameInventory::IsInventoryLockedForLockType ( int lockType)
protected

◆ IsInventoryUnlocked()

proto native bool GameInventory::IsInventoryUnlocked ( )
protected

◆ IsPlaceholderEntity()

proto native bool GameInventory::IsPlaceholderEntity ( notnull Object e)
protected

◆ LocalDestroyEntity()

bool GameInventory::LocalDestroyEntity ( notnull EntityAI item)
protected

Definition at line 1346 of file inventory.c.

◆ LocationAddEntity()

proto native bool GameInventory::LocationAddEntity ( notnull InventoryLocation inv_loc)
staticprotected

adds item to inventory location

Returns
true if success, false otherwise

◆ LocationCanAddEntity()

proto native bool GameInventory::LocationCanAddEntity ( notnull InventoryLocation inv_loc)
staticprotected

queries if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/...

query the entity at the specific inventory location

Returns
true if can be added, false otherwise
entity at the location, null otherwise

◆ LocationCanAddEntityEx()

bool GameInventory::LocationCanAddEntityEx ( notnull InventoryLocation inv_loc)
staticprotected

Definition at line 350 of file inventory.c.

◆ LocationCanMoveEntity()

proto native bool GameInventory::LocationCanMoveEntity ( notnull InventoryLocation src,
notnull InventoryLocation dst )
staticprotected

queries if the entity contained in inv_loc.m_item can be moved to another location This is a shorthand for CanRemove + CanAdd query

Returns
true if can be moved, false otherwise

◆ LocationCanMoveEntitySyncCheck()

bool GameInventory::LocationCanMoveEntitySyncCheck ( notnull InventoryLocation src,
notnull InventoryLocation dst )
staticprotected

Definition at line 380 of file inventory.c.

◆ LocationCanRemoveEntity()

proto native bool GameInventory::LocationCanRemoveEntity ( notnull InventoryLocation inv_loc)
staticprotected

queries if the entity contained in inv_loc.m_item can be removed from ground/attachment/cargo/hands/...

Returns
true if can be added, false otherwise

◆ LocationCreateEntity()

proto native EntityAI GameInventory::LocationCreateEntity ( notnull InventoryLocation inv_loc,
string type,
int iSetupFlags,
int iRotation )
staticprotected

creates new item directly at location

Parameters
[in]typeitem type to be placed in inventory
Returns
created entity, null otherwise

◆ LocationCreateLocalEntity()

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

creates new local item directly at location @NOTE: the item is created localy, i.e. it's not registered to network

Parameters
[in]typeitem type to be placed in inventory
Returns
created entity, null otherwise

◆ LocationGetEntity()

proto native EntityAI GameInventory::LocationGetEntity ( notnull InventoryLocation inv_loc)
staticprotected

◆ LocationMoveEntity()

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

removes item from current inventory location and adds it to destination

Returns
true if success, false otherwise

◆ LocationRemoveEntity()

proto native bool GameInventory::LocationRemoveEntity ( notnull InventoryLocation inv_loc)
staticprotected

removes item from inventory location

Returns
true if success, false otherwise

◆ LocationSwap()

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

swaps two entities

Returns
true if success, false otherwise

◆ LocationSyncMoveEntity()

proto native bool GameInventory::LocationSyncMoveEntity ( notnull InventoryLocation src_loc,
notnull InventoryLocation dst_loc )
staticprotected

synchronously removes item from current inventory location and adds it to destination no anims involved

Returns
true if success, false otherwise

◆ LocationTestAddEntity()

proto native bool GameInventory::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

test if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/...

Returns
true if can be added, false otherwise

◆ LockInventory()

proto native void GameInventory::LockInventory ( int lockType)
protected

◆ LockInventoryWithKey()

proto native void GameInventory::LockInventoryWithKey ( notnull EntityAI key)
protected

◆ MakeDstForSwap()

bool GameInventory::MakeDstForSwap ( notnull InventoryLocation src1,
notnull InventoryLocation src2,
out InventoryLocation dst1,
out InventoryLocation dst2 )
staticprotected

helper function for swap

Definition at line 1192 of file inventory.c.

◆ MakeSrcAndDstForForceSwap()

bool GameInventory::MakeSrcAndDstForForceSwap ( notnull EntityAI item1,
notnull EntityAI item2,
out InventoryLocation src1,
out InventoryLocation src2,
out InventoryLocation dst1,
notnull InventoryLocation dst2 )
staticprotected

helper function for ForceSwap

Definition at line 1223 of file inventory.c.

◆ MakeSrcAndDstForSwap()

bool GameInventory::MakeSrcAndDstForSwap ( notnull EntityAI item1,
notnull EntityAI item2,
out InventoryLocation src1,
out InventoryLocation src2,
out InventoryLocation dst1,
out InventoryLocation dst2 )
staticprotected

helper function for swap

Definition at line 1211 of file inventory.c.

◆ OnAfterStoreLoad()

void GameInventory::OnAfterStoreLoad ( )
protected

◆ OnInputUserDataProcess()

bool GameInventory::OnInputUserDataProcess ( ParamsReadContext ctx)
protected

synchronization

◆ OnInventoryFailure()

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

◆ OnInventoryJunctureFailureFromServer()

void GameInventory::OnInventoryJunctureFailureFromServer ( ParamsReadContext ctx)
protected

◆ OnInventoryJunctureFromServer()

bool GameInventory::OnInventoryJunctureFromServer ( ParamsReadContext ctx)
protected

◆ OnServerInventoryCommand()

void GameInventory::OnServerInventoryCommand ( ParamsReadContext ctx)
protected

◆ OnServerInventoryCommandStatic()

void GameInventory::OnServerInventoryCommandStatic ( ParamsReadContext ctx)
staticprotected

Definition at line 471 of file inventory.c.

◆ OnStoreLoad()

bool GameInventory::OnStoreLoad ( ParamsReadContext ctx,
int version )
protected

db load hooks

Definition at line 837 of file inventory.c.

◆ OnStoreSave()

void GameInventory::OnStoreSave ( ParamsWriteContext ctx)
protected

db store hook

◆ PrepareDropEntityPos()

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

Finds a transformation for the item to be dropped to If the initial transforation overlaps with another conflicting entity (i.e. car) then the transform will be snapped to the nearest outer edge. If no valid snapping transformation could be found, then the output from 'PlaceOnSurface' is used.

Parameters
useValuesInMatrixIs ignored if transformation overlaps with possible conflicting entity. If no valid transform is found and this is false then the transform at the owner is used for 'PlaceOnSurface'
conflictCheckDepthIf -1 then no conflict depth check is performed, if 0 then it only checks to see if it conflicts but doesn't perform snapping
Returns
true if valid transformation found near owner

◆ ReplaceItemWithNew()

bool GameInventory::ReplaceItemWithNew ( InventoryMode mode,
ReplaceItemWithNewLambdaBase lambda )
protected

Definition at line 1363 of file inventory.c.

◆ ResetFlipCargo()

proto native void GameInventory::ResetFlipCargo ( )
protected

◆ ServerHandEvent()

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

hand event to clients

Returns
true if success, false otherwise

◆ ServerLocationMoveEntity()

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

removes item from current inventory location and adds it to destination + sync via inventory command

Returns
true if success, false otherwise

◆ ServerLocationSwap()

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

swaps two entities

Returns
true if success, false otherwise

◆ ServerLocationSyncMoveEntity()

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

synchronously removes item from current inventory location and adds it to destination + sync via inventory command no anims involved

Returns
true if success, false otherwise

◆ SetFlipCargo()

proto native void GameInventory::SetFlipCargo ( bool flip)
protected

◆ SetGroundPosByOwner()

bool GameInventory::SetGroundPosByOwner ( EntityAI owner,
notnull EntityAI item,
out InventoryLocation ground )
staticprotected

Definition at line 1257 of file inventory.c.

◆ SetGroundPosByOwnerBounds()

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

Definition at line 1309 of file inventory.c.

◆ SetGroundPosByTransform()

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

Definition at line 1286 of file inventory.c.

◆ SetSlotLock()

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

◆ SwapEntities()

bool GameInventory::SwapEntities ( InventoryMode mode,
notnull EntityAI item1,
notnull EntityAI item2 )
protected

Definition at line 1247 of file inventory.c.

◆ TakeEntityAsAttachment()

bool GameInventory::TakeEntityAsAttachment ( InventoryMode mode,
notnull EntityAI item )
protected

Definition at line 1179 of file inventory.c.

◆ TakeEntityAsAttachmentEx()

bool GameInventory::TakeEntityAsAttachmentEx ( InventoryMode mode,
notnull EntityAI item,
int slot )
protected

Definition at line 1130 of file inventory.c.

◆ TakeEntityAsTargetAttachment()

bool GameInventory::TakeEntityAsTargetAttachment ( InventoryMode mode,
notnull EntityAI target,
notnull EntityAI item )
protected

Definition at line 1185 of file inventory.c.

◆ TakeEntityAsTargetAttachmentEx()

bool GameInventory::TakeEntityAsTargetAttachmentEx ( InventoryMode mode,
notnull EntityAI target,
notnull EntityAI item,
int slot )
protected

put item as attachment of target

Definition at line 1137 of file inventory.c.

◆ TakeEntityToCargo()

bool GameInventory::TakeEntityToCargo ( InventoryMode mode,
notnull EntityAI item )
protected

moves item to cargo of this intentory

Parameters
[in]modeinventory mode
[in]itemitem to be put in this inventory as cargo

Definition at line 1080 of file inventory.c.

◆ TakeEntityToCargoEx()

bool GameInventory::TakeEntityToCargoEx ( InventoryMode mode,
notnull EntityAI item,
int idx,
int row,
int col )
protected

moves item on specific cargo location

Parameters
[in]modeinventory mode
[in]itemitem to be put in this inventory as cargo

Definition at line 1098 of file inventory.c.

◆ TakeEntityToInventory()

bool GameInventory::TakeEntityToInventory ( InventoryMode mode,
FindInventoryLocationType flags,
notnull EntityAI item )
protected

Put item anywhere into this entity (as attachment or into cargo, recursively).

Parameters
[in]modeinventory mode
[in]flagspreferred location,
See also
FindInventoryLocationType
Parameters
[in]itemitem to be taken in inventory
Returns
true on success

@NOTE: Predictive.* / Local.* functions: a) 'Predictive' means that the operation uses Client-Side Prediction, i.e. the action runs the same code on both, client AND server.

b) 'Local' operation executes from where it is run, i.e. the operation from client is NOT sent to server, and only client performs the inventory operation (TakeEntityTo.*) this behaviour is necessary when inventory operations are ALREADY synchronized by another means, like Actions. For example

See also
ActionTakeItemToHands that performs OnCompleteServer and OnCompleteClient with synchronization set to false in order to avoid duplicate synchronization.

Definition at line 1012 of file inventory.c.

◆ TakeEntityToTargetCargo()

bool GameInventory::TakeEntityToTargetCargo ( InventoryMode mode,
notnull EntityAI target,
notnull EntityAI item )
protected

Put item into into cargo of another entity.

Definition at line 1087 of file inventory.c.

◆ TakeEntityToTargetCargoEx()

bool GameInventory::TakeEntityToTargetCargoEx ( InventoryMode mode,
notnull CargoBase cargo,
notnull EntityAI item,
int row,
int col )
protected

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

Definition at line 1115 of file inventory.c.

◆ TakeEntityToTargetInventory()

bool GameInventory::TakeEntityToTargetInventory ( InventoryMode mode,
notnull EntityAI target,
FindInventoryLocationType flags,
notnull EntityAI item )
protected

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

Definition at line 1031 of file inventory.c.

◆ TakeToDst()

bool GameInventory::TakeToDst ( InventoryMode mode,
notnull InventoryLocation src,
notnull InventoryLocation dst )
protected

move src to dst

Parameters
[in]modeinventory mode
[in]srcsource location of the item
[in]dstdestination location of the item

Definition at line 1056 of file inventory.c.

◆ TestAddEntityInCargoEx()

proto native bool GameInventory::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 GameInventory::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 GameInventory::TestDropEntityPos ( EntityAI owner,
notnull EntityAI item,
out vector mat[4],
bool useValuesInMatrix = false,
int conflictCheckDepth = -1 )
staticprotected

◆ UnlockInventory()

proto native void GameInventory::UnlockInventory ( int lockType)
protected

◆ UnlockInventoryWithKey()

proto native void GameInventory::UnlockInventoryWithKey ( notnull EntityAI key)
protected

Member Data Documentation

◆ c_InventoryReservationTimeoutMS

const int GameInventory::c_InventoryReservationTimeoutMS = 5000
protected

reservations

Definition at line 714 of file inventory.c.

◆ c_InventoryReservationTimeoutShortMS

const int GameInventory::c_InventoryReservationTimeoutShortMS = 3000
protected

Definition at line 715 of file inventory.c.

◆ c_MaxItemDistanceRadius

const float GameInventory::c_MaxItemDistanceRadius = 2.5
protected

anti-cheats

Definition at line 815 of file inventory.c.

◆ m_inventory_check_context

int GameInventory::m_inventory_check_context = InventoryCheckContext.DEFAULT
staticprotected

Definition at line 82 of file inventory.c.


The documentation for this class was generated from the following file: