Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
SCR_UniversalInventoryStorageComponent Interface Reference

Current storage variant allows dynamic scaling of slots and handles Move/Insert/Remove operations it will accept any entity for insertion and will remove/add it's visibility flag when inserted/removed from storage. More...

Inheritance diagram for SCR_UniversalInventoryStorageComponent:
[legend]

Public Member Functions

float GetMaxLoad ()
 Returns how much weight the component can carry.
 
bool IsAdditionalWeightOk (float fWeight)
 
override bool CanStoreItem (IEntity item, int slotID)
 Implemented logics for can insert here, Manager will provide slotID of -1 in case slot is irrelevant.
 
override bool CanStoreResource (ResourceName resourceName, int slotID, int count)
 Implemented logics for can insert here, Manager will provide slotID of -1 in case slot is irrelevant.
 
override bool CanReplaceItem (IEntity nextItem, int slotID)
 Implemented logics for can replace to nextItem at slotID,.
 
override void OnRemovedFromSlot (IEntity item, int slotID)
 Will be called when item is removed from slot IMPORTANT* This is called after the C++ event.
 
int GetLinkedStorages (notnull out array< BaseInventoryStorageComponent > linkedStorages)
 Get a list of all linked storages of this storage.
 
void AddLinkedStorage (BaseInventoryStorageComponent newLinkedStorage)
 Add a linked storage to this storage.
 
bool IsStorageALinkedChild (notnull BaseInventoryStorageComponent storage)
 Check if the given storage is a linked child storage.
 
override 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 SCR_UniversalInventoryStorageComponent (IEntityComponentSource src, IEntity ent, IEntity parent)
 
- Public Member Functions inherited from BaseInventoryStorageComponent
proto external sealed bool Contains (IEntity item)
 Check if an item is inside this storage.
 
proto external sealed InventoryStorageSlot FindItemSlot (IEntity item)
 Find the item slot.
 
proto external int GetSlotsCount ()
 Returns the number of slots in this storage.
 
proto external sealed InventoryStorageSlot GetSlot (int slotID)
 Return slot for specified id.
 
proto external sealed IEntity Get (int slotID)
 Get item at slot ID.
 
proto external sealed int GetAll (out notnull array< IEntity > outItems)
 
proto external sealed int GetPriority ()
 
proto external sealed EStoragePurpose GetPurpose ()
 
proto external InventoryStorageSlot FindSuitableSlotForItem (IEntity item)
 
proto external float GetOccupiedSpace ()
 returns amount of space occupied by attached items
 
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 bool PerformVolumeValidation (IEntity item, bool includeDimensionValidation=true)
 performs volume and item dimension validation.
 
proto external bool PerformDimensionValidation (IEntity item)
 performs dimension validation.
 
proto external float GetMaxVolumeCapacity ()
 
proto external vector GetMaxDimensionCapacity ()
 
proto external int GetEstimatedCountFitForItem (IEntity item)
 get a rough estimate of how many times the item can fit in the inventory
 
proto external float GetWeightFromResource (ResourceName resourceName, int count=1)
 get the weight of a prefab
 
proto external int GetEstimatedCountFitForResource (ResourceName resourceName)
 get a rough estimate of how many times the resource can fit in the inventory
 
proto external bool PerformVolumeAndDimensionValidationForResource (ResourceName resourceName, bool includeDimensionValidation=true, int count=1)
 performs volume and item dimension validation.
 
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, int count)
 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

InventoryItemComponent GetItemComponent (IEntity pItem)
 
override void OnAddedToSlot (IEntity item, int slotID)
 Will be called when item is added to slot.
 
- Protected Member Functions inherited from ScriptedBaseInventoryStorageComponent
override void UpdateUI ()
 Virtual method for updating the UI when an item is removed/added.
 
- Protected Member Functions inherited from BaseInventoryStorageComponent
proto external sealed 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 sealed 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 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.
 

Protected Attributes

float m_fMaxWeight
 
ref array< int > m_aSlotsToShow
 
ref SCR_BaseLinkedStorageLogic m_LinkedStorageLogic
 
ref array< BaseInventoryStorageComponentm_aLinkedStorages
 Storages that will be automatically closed and opened when the parent (this) storage is closed or opened.
 
float m_fWeight
 
SCR_InventoryStorageManagerComponent pInventoryManager
 

Static Protected Attributes

static const int MIN_VOLUME_TO_SHOW_ITEM_IN_SLOT = 200000
 in cm^3
 

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

Detailed Description

Current storage variant allows dynamic scaling of slots and handles Move/Insert/Remove operations it will accept any entity for insertion and will remove/add it's visibility flag when inserted/removed from storage.

See also
CharacterInventoryStorageComponent for example of custom storage inheritance from current class

Constructor & Destructor Documentation

◆ SCR_UniversalInventoryStorageComponent()

void SCR_UniversalInventoryStorageComponent.SCR_UniversalInventoryStorageComponent ( IEntityComponentSource  src,
IEntity  ent,
IEntity  parent 
)
Parameters
[in]src
[in]ent
[in]parent

Member Function Documentation

◆ AddLinkedStorage()

void SCR_UniversalInventoryStorageComponent.AddLinkedStorage ( BaseInventoryStorageComponent  newLinkedStorage)

Add a linked storage to this storage.

Parameters
[in]newLinkedStorageThe storage to link

◆ CanReplaceItem()

override bool SCR_UniversalInventoryStorageComponent.CanReplaceItem ( IEntity  nextItem,
int  slotID 
)

Implemented logics for can replace to nextItem at slotID,.

Implements BaseInventoryStorageComponent.

◆ CanStoreItem()

override bool SCR_UniversalInventoryStorageComponent.CanStoreItem ( IEntity  item,
int  slotID 
)

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

Implements BaseInventoryStorageComponent.

◆ CanStoreResource()

override bool SCR_UniversalInventoryStorageComponent.CanStoreResource ( ResourceName  resourceName,
int  slotID,
int  count 
)

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

Implements BaseInventoryStorageComponent.

◆ GetItemComponent()

InventoryItemComponent SCR_UniversalInventoryStorageComponent.GetItemComponent ( IEntity  pItem)
protected

◆ GetLinkedStorages()

int SCR_UniversalInventoryStorageComponent.GetLinkedStorages ( notnull out array< BaseInventoryStorageComponent linkedStorages)

Get a list of all linked storages of this storage.

Parameters
[out]linkedStoragesLinked storages
Returns
Amount of linked storages

◆ GetMaxLoad()

float SCR_UniversalInventoryStorageComponent.GetMaxLoad ( )

Returns how much weight the component can carry.

◆ IsAdditionalWeightOk()

bool SCR_UniversalInventoryStorageComponent.IsAdditionalWeightOk ( float  fWeight)

◆ IsStorageALinkedChild()

bool SCR_UniversalInventoryStorageComponent.IsStorageALinkedChild ( notnull BaseInventoryStorageComponent  storage)

Check if the given storage is a linked child storage.

Parameters
[in]storageStorage to check return True if the storage is a linked child of this storage

◆ OnAddedToSlot()

override void SCR_UniversalInventoryStorageComponent.OnAddedToSlot ( IEntity  item,
int  slotID 
)
protected

Will be called when item is added to slot.

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

Implements BaseInventoryStorageComponent.

◆ OnManagerChanged()

override void SCR_UniversalInventoryStorageComponent.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).

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

Implements BaseInventoryStorageComponent.

◆ OnRemovedFromSlot()

override void SCR_UniversalInventoryStorageComponent.OnRemovedFromSlot ( IEntity  item,
int  slotID 
)

Will be called when item is removed from slot IMPORTANT* This is called after the C++ event.

Implements BaseInventoryStorageComponent.

Member Data Documentation

◆ m_aLinkedStorages

ref array<BaseInventoryStorageComponent> SCR_UniversalInventoryStorageComponent.m_aLinkedStorages
protected

Storages that will be automatically closed and opened when the parent (this) storage is closed or opened.

◆ m_aSlotsToShow

ref array<int> SCR_UniversalInventoryStorageComponent.m_aSlotsToShow
protected

◆ m_fMaxWeight

float SCR_UniversalInventoryStorageComponent.m_fMaxWeight
protected

◆ m_fWeight

float SCR_UniversalInventoryStorageComponent.m_fWeight
protected

◆ m_LinkedStorageLogic

ref SCR_BaseLinkedStorageLogic SCR_UniversalInventoryStorageComponent.m_LinkedStorageLogic
protected

◆ MIN_VOLUME_TO_SHOW_ITEM_IN_SLOT

const int SCR_UniversalInventoryStorageComponent.MIN_VOLUME_TO_SHOW_ITEM_IN_SLOT = 200000
staticprotected

in cm^3

◆ pInventoryManager

SCR_InventoryStorageManagerComponent SCR_UniversalInventoryStorageComponent.pInventoryManager
protected

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