Arma Reforger Script API
Loading...
Searching...
No Matches
BaseInventoryStorageComponent Interface Reference
Inheritance diagram for BaseInventoryStorageComponent:
InventoryItemComponent GameComponent ScriptedBaseInventoryStorageComponent AttachmentsStorageComponent BaseEquipedWeaponStorageComponent BaseUniversalInventoryStorageComponent ClothNodeStorageComponent EquipedLoadoutStorageComponent WeaponAttachmentsStorageComponent EquipedWeaponStorageComponent UniversalInventoryStorageComponent SCR_EquipedLoadoutStorageComponent SCR_WeaponAttachmentsStorageComponent BaseEquipmentStorageComponent SCR_CampaignArmoryStorageComponent SCR_UniversalInventoryStorageComponent CharacterInventoryStorageComponent EquipmentStorageComponent SCR_FilteredInventoryStorageComponent SCR_HandSlotStorageComponent SCR_CharacterInventoryStorageComponent SCR_EquipmentStorageComponent SCR_IdentityItemStorageComponent SCR_SalineStorageComponent SCR_TourniquetStorageComponent

Public Member Functions

proto external bool Contains (IEntity item)
 Check if an item is inside this storage.
 
proto external InventoryStorageSlot FindItemSlot (IEntity item)
 Find the item slot.
 
proto external int GetSlotsCount ()
 Returns the number of slots in this storage.
 
proto external InventoryStorageSlot GetSlot (int slotID)
 Return slot for specified id.
 
proto external IEntity Get (int slotID)
 Get item at slot ID.
 
proto external int GetAll (out notnull array< IEntity > outItems)
 
proto external int GetPriority ()
 
proto external EStoragePurpose GetPurpose ()
 
proto external InventoryStorageSlot FindSuitableSlotForItem (IEntity item)
 
proto external bool IsCompartment ()
 does current storage serves as a compartment of other storage
 
proto external void GetOwnedItems (out notnull array< InventoryItemComponent > outItemsComponents)
 Fills array with attached items including items from storage compartments.
 
proto external bool GetOwnedStorages (out notnull array< BaseInventoryStorageComponent > outStorages, int depth, bool includeHierarchy)
 Fills array with attached storages up to provided hierarchy depth for every top level storage depth with even number will reach compartments level and odd will reach storages attached to slots (including compartment slots)
 
proto external float GetWeightFromResource (ResourceName resourceName)
 Get the weight of a prefab.
 
proto external vector GetMaxDimensionCapacity ()
 
proto external float GetMaxVolumeCapacity ()
 
proto external float GetOccupiedSpace ()
 Returns amount of space occupied by attached items.
 
proto external bool PerformDimensionValidation (IEntity item)
 Performs dimension validation.
 
proto external bool PerformVolumeValidation (IEntity item, bool includeDimensionValidation=true)
 Performs item volume and (optionally) dimension validation.
 
proto external bool PerformVolumeValidationForResource (ResourceName resourceName, bool includeDimensionValidation=true)
 Performs prefab volume and (optionally) dimension validation.
 
proto external int GetEstimatedCountFitForItem (IEntity item)
 Get an estimate of how many times the item can fit in the inventory.
 
proto external int GetEstimatedCountFitForResource (ResourceName resourceName)
 Get an estimate of how many times the resource can fit in the inventory.
 
bool OnOverrideCanStoreItem ()
 It should return true or false depending if the scripter wants to override the behavior of the C++ function or not.
 
bool OnOverrideCanStoreResource ()
 It should return true or false depending if the scripter wants to override the behavior of the C++ function or not.
 
bool OnOverrideCanRemoveItem ()
 It should return true or false depending if the scripter wants to override the behavior of the C++ function or not.
 
bool OnOverrideCanReplaceItem ()
 It should return true or false depending if the scripter wants to override the behavior of the C++ function or not.
 
bool CanStoreItem (IEntity item, int slotID)
 Implemented logics for can insert here, Manager will provide slotID of -1 in case slot is irrelevant.
 
bool CanStoreResource (ResourceName resourceName, int slotID)
 Implemented logics for can insert here, Manager will provide slotID of -1 in case slot is irrelevant.
 
bool CanRemoveItem (IEntity item)
 Implemented logics for can remove here,.
 
bool CanReplaceItem (IEntity nextItem, int slotID)
 Implemented logics for can replace to nextItem at slotID,.
 
- Public Member Functions inherited from InventoryItemComponent
proto external IEntity GetOwner ()
 Returns Entity owner of current component instance.
 
proto external bool IsLocked ()
 Returns locked state of item (for both user and system locks)
 
proto external bool IsUserLocked ()
 
proto external bool IsSystemLocked ()
 
proto external InventoryStorageSlot GetParentSlot ()
 
proto external ItemAttributeCollection GetAttributes ()
 
proto external void HideOwner ()
 Hide owner entity.
 
proto external void ShowOwner ()
 Show owner entity.
 
proto external void SetTraceable (bool traceable)
 Set the entity to be traceable or not.
 
proto external void DisablePhysics ()
 Disable owners physical interactions.
 
proto external void EnablePhysics ()
 Enable owners physical interactions.
 
proto external void ActivateOwner (bool active)
 Enable/Disable entity active state.
 
proto external float GetAdditionalWeight ()
 Returns the current additional weight.
 
proto external void SetAdditionalWeight (float additionalWeight)
 IMPORTANT* Could only be called on the master.
 
proto external float GetTotalWeight ()
 Returns the weight + the additional weight.
 
proto external float GetAdditionalVolume ()
 Returns the current additional volume.
 
proto external void SetAdditionalVolume (float additionalVolume)
 IMPORTANT* Could only be called on the master.
 
proto external float GetTotalVolume ()
 Returns the volume + the additional volume.
 
proto external void PlaceOnGround (IEntity callerEntity=null)
 IMPORTANT* This function is heavy in performance because of the multiple traces used inside the function.
 
proto external bool IsHiddenInVicnity ()
 returns true if item should be hidden
 
proto external UIInfo GetUIInfo ()
 Returns UI info of this item.
 
proto external bool RequestUserLock (IEntity caller, bool locked)
 Set external lock on item optional caller is entity that manipulates with item and has inventory manager present (usually character)
 
proto external BaseItemAttributeData FindAttribute (TypeName typeName)
 Convinience method Finds first occurance of the coresponding attribute data object in owned PrefabData AttributeCollection.
 
proto external IEntity CreatePreviewEntity (BaseWorld world, int camera)
 Creates preview entity in the provided world.
 
void OnDelete (IEntity owner)
 
- Public Member Functions inherited from GameComponent
bool OnTicksOnRemoteProxy ()
 

Protected Member Functions

proto external void SetupSlotHooks (InventoryStorageSlot ownedSlot, int slotID)
 IMPORTANT* Should be called upon initialization of slot instance provide newly created slot and desired slot ID.
 
proto external void ReleaseSlotHooks (InventoryStorageSlot ownedSlot)
 IMPORTANT* Should be called before transfering ownership of holded slot instance In majority of cases should be unnecessary (when storage manages creation and destruction of slots on its own)
 
void OnAddedToSlot (IEntity item, int slotID)
 Will be called when item is added to slot.
 
void OnRemovedFromSlot (IEntity item, int slotID)
 Will be called when item is removed from slot IMPORTANT* This is called after the C++ event.
 
InventoryStorageSlot GetEmptySlotForItem (IEntity item)
 Usually any slot that item can be inserted to.
 
int GetSlotsCountScr ()
 Should Return slots count.
 
InventoryStorageSlot GetSlotScr (int slotID)
 Should Return slot for specified id.
 
ref BaseInventoryTask RemoveItem (IEntity item)
 Called locally per instance, implement remove logics here.
 
ref BaseInventoryTask InsertItem (IEntity item, int slotID)
 Called locally per instance, implement insertion logics here, Manager will provide slotID of -1 in case slot is irrelevant.
 
bool ShouldPreviewAttachedItems ()
 Will be called to estimate if storage children has to be included in preview.
 
void OnManagerChanged (InventoryStorageManagerComponent manager)
 Will be called when manager is changed, manager can be null if there is no manager in hierarchy (item drop in world).
 
void UpdateUI ()
 Virtual method for updating the UI when an item is removed/added.
 
- Protected Member Functions inherited from InventoryItemComponent
bool ShouldChangeVisibilityOfHierarchy ()
 
bool ShouldHideInVicinity ()
 implement custom visibility behavior in vicinity
 
bool OverridePlacementTransform (IEntity caller, out vector computedTransform[4])
 Override final transformation of dropped item, return true in case transformation should be applied.
 

Additional Inherited Members

- Public Attributes inherited from InventoryItemComponent
ref ScriptInvoker< bool > m_OnLockedStateChangedInvoker = new ScriptInvoker<bool>()
 
ref ScriptInvoker< InventoryStorageSlot, InventoryStorageSlotm_OnParentSlotChangedInvoker = new ScriptInvoker<InventoryStorageSlot, InventoryStorageSlot>()
 

Member Function Documentation

◆ CanRemoveItem()

bool BaseInventoryStorageComponent.CanRemoveItem ( IEntity item)

Implemented logics for can remove here,.

Implemented in SCR_IdentityItemStorageComponent.

◆ CanReplaceItem()

bool BaseInventoryStorageComponent.CanReplaceItem ( IEntity nextItem,
int slotID )

Implemented logics for can replace to nextItem at slotID,.

Implemented in SCR_HandSlotStorageComponent, SCR_IdentityItemStorageComponent, and SCR_UniversalInventoryStorageComponent.

◆ CanStoreItem()

bool BaseInventoryStorageComponent.CanStoreItem ( IEntity item,
int slotID )

◆ CanStoreResource()

bool BaseInventoryStorageComponent.CanStoreResource ( ResourceName resourceName,
int slotID )

Implemented logics for can insert here, Manager will provide slotID of -1 in case slot is irrelevant.

Implemented in SCR_FilteredInventoryStorageComponent, SCR_HandSlotStorageComponent, SCR_IdentityItemStorageComponent, and SCR_UniversalInventoryStorageComponent.

◆ Contains()

proto external bool BaseInventoryStorageComponent.Contains ( IEntity item)
sealed

Check if an item is inside this storage.

Parameters
itemItem which meeds to be searched.
Returns
Returns true if the item is inside this storage.

◆ FindItemSlot()

proto external InventoryStorageSlot BaseInventoryStorageComponent.FindItemSlot ( IEntity item)
sealed

Find the item slot.

Parameters
itemItem which meeds to be searched.
Returns
Returns the slot otherwise null.

◆ FindSuitableSlotForItem()

proto external InventoryStorageSlot BaseInventoryStorageComponent.FindSuitableSlotForItem ( IEntity item)

◆ Get()

proto external IEntity BaseInventoryStorageComponent.Get ( int slotID)
sealed

Get item at slot ID.

Parameters
slotIDSlot ID
Returns
Returns the item.

◆ GetAll()

proto external int BaseInventoryStorageComponent.GetAll ( out notnull array< IEntity > outItems)
sealed

◆ GetEmptySlotForItem()

InventoryStorageSlot BaseInventoryStorageComponent.GetEmptySlotForItem ( IEntity item)
protected

Usually any slot that item can be inserted to.

Implemented in SCR_HandSlotStorageComponent.

◆ GetEstimatedCountFitForItem()

proto external int BaseInventoryStorageComponent.GetEstimatedCountFitForItem ( IEntity item)

Get an estimate of how many times the item can fit in the inventory.

◆ GetEstimatedCountFitForResource()

proto external int BaseInventoryStorageComponent.GetEstimatedCountFitForResource ( ResourceName resourceName)

Get an estimate of how many times the resource can fit in the inventory.

◆ GetMaxDimensionCapacity()

proto external vector BaseInventoryStorageComponent.GetMaxDimensionCapacity ( )

◆ GetMaxVolumeCapacity()

proto external float BaseInventoryStorageComponent.GetMaxVolumeCapacity ( )

◆ GetOccupiedSpace()

proto external float BaseInventoryStorageComponent.GetOccupiedSpace ( )

Returns amount of space occupied by attached items.

◆ GetOwnedItems()

proto external void BaseInventoryStorageComponent.GetOwnedItems ( out notnull array< InventoryItemComponent > outItemsComponents)

Fills array with attached items including items from storage compartments.

◆ GetOwnedStorages()

proto external bool BaseInventoryStorageComponent.GetOwnedStorages ( out notnull array< BaseInventoryStorageComponent > outStorages,
int depth,
bool includeHierarchy )

Fills array with attached storages up to provided hierarchy depth for every top level storage depth with even number will reach compartments level and odd will reach storages attached to slots (including compartment slots)

Parameters
outStorages- array to be filled with storages
depth- at what depth level should be storages collected
includeHierarchy- should storages from upper depth level be included in array
Returns
true if depth was reached

◆ GetPriority()

proto external int BaseInventoryStorageComponent.GetPriority ( )
sealed

◆ GetPurpose()

proto external EStoragePurpose BaseInventoryStorageComponent.GetPurpose ( )
sealed

◆ GetSlot()

proto external InventoryStorageSlot BaseInventoryStorageComponent.GetSlot ( int slotID)
sealed

Return slot for specified id.

Parameters
slotIDSlot ID.
Returns
Returns the slot.

◆ GetSlotsCount()

proto external int BaseInventoryStorageComponent.GetSlotsCount ( )

Returns the number of slots in this storage.

◆ GetSlotsCountScr()

int BaseInventoryStorageComponent.GetSlotsCountScr ( )
protected

Should Return slots count.

◆ GetSlotScr()

InventoryStorageSlot BaseInventoryStorageComponent.GetSlotScr ( int slotID)
protected

Should Return slot for specified id.

◆ GetWeightFromResource()

proto external float BaseInventoryStorageComponent.GetWeightFromResource ( ResourceName resourceName)

Get the weight of a prefab.

◆ InsertItem()

ref BaseInventoryTask BaseInventoryStorageComponent.InsertItem ( IEntity item,
int slotID )
protected

Called locally per instance, implement insertion logics here, Manager will provide slotID of -1 in case slot is irrelevant.

◆ IsCompartment()

proto external bool BaseInventoryStorageComponent.IsCompartment ( )

does current storage serves as a compartment of other storage

◆ OnAddedToSlot()

void BaseInventoryStorageComponent.OnAddedToSlot ( IEntity item,
int slotID )
protected

◆ OnManagerChanged()

void BaseInventoryStorageComponent.OnManagerChanged ( InventoryStorageManagerComponent manager)
protected

Will be called when manager is changed, manager can be null if there is no manager in hierarchy (item drop in world).

IMPORTANT* This is called after the C++ event.

Implemented in SCR_HandSlotStorageComponent, and SCR_UniversalInventoryStorageComponent.

◆ OnOverrideCanRemoveItem()

bool BaseInventoryStorageComponent.OnOverrideCanRemoveItem ( )

It should return true or false depending if the scripter wants to override the behavior of the C++ function or not.

IMPORTANT* This should contains one line with return true/false; The result is cached, so this function can't be made dynamic

◆ OnOverrideCanReplaceItem()

bool BaseInventoryStorageComponent.OnOverrideCanReplaceItem ( )

It should return true or false depending if the scripter wants to override the behavior of the C++ function or not.

IMPORTANT* This should contains one line with return true/false; The result is cached, so this function can't be made dynamic

◆ OnOverrideCanStoreItem()

bool BaseInventoryStorageComponent.OnOverrideCanStoreItem ( )

It should return true or false depending if the scripter wants to override the behavior of the C++ function or not.

IMPORTANT* This should contains one line with return true/false; The result is cached, so this function can't be made dynamic

◆ OnOverrideCanStoreResource()

bool BaseInventoryStorageComponent.OnOverrideCanStoreResource ( )

It should return true or false depending if the scripter wants to override the behavior of the C++ function or not.

IMPORTANT* This should contains one line with return true/false; The result is cached, so this function can't be made dynamic

◆ OnRemovedFromSlot()

void BaseInventoryStorageComponent.OnRemovedFromSlot ( IEntity item,
int slotID )
protected

◆ PerformDimensionValidation()

proto external bool BaseInventoryStorageComponent.PerformDimensionValidation ( IEntity item)

Performs dimension validation.

◆ PerformVolumeValidation()

proto external bool BaseInventoryStorageComponent.PerformVolumeValidation ( IEntity item,
bool includeDimensionValidation = true )

Performs item volume and (optionally) dimension validation.

◆ PerformVolumeValidationForResource()

proto external bool BaseInventoryStorageComponent.PerformVolumeValidationForResource ( ResourceName resourceName,
bool includeDimensionValidation = true )

Performs prefab volume and (optionally) dimension validation.

◆ ReleaseSlotHooks()

proto external void BaseInventoryStorageComponent.ReleaseSlotHooks ( InventoryStorageSlot ownedSlot)
sealedprotected

IMPORTANT* Should be called before transfering ownership of holded slot instance In majority of cases should be unnecessary (when storage manages creation and destruction of slots on its own)

◆ RemoveItem()

ref BaseInventoryTask BaseInventoryStorageComponent.RemoveItem ( IEntity item)
protected

Called locally per instance, implement remove logics here.

◆ SetupSlotHooks()

proto external void BaseInventoryStorageComponent.SetupSlotHooks ( InventoryStorageSlot ownedSlot,
int slotID )
sealedprotected

IMPORTANT* Should be called upon initialization of slot instance provide newly created slot and desired slot ID.

◆ ShouldPreviewAttachedItems()

bool BaseInventoryStorageComponent.ShouldPreviewAttachedItems ( )
protected

Will be called to estimate if storage children has to be included in preview.

Implemented in SCR_EquipmentStorageComponent, and SCR_SalineStorageComponent.

◆ UpdateUI()

void BaseInventoryStorageComponent.UpdateUI ( )
protected

Virtual method for updating the UI when an item is removed/added.

Implemented in ScriptedBaseInventoryStorageComponent.


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