63enum FindInventoryReservationMode
97 proto native
void DumpInventoryDebug();
103 static proto native
void DumpStaticInventoryDebug();
155 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);
189 for (
int i = 0; i < count; i++)
358 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);
427 if (ent.GetInventory().GetCurrentInventoryLocation(lcn) && lcn.
IsValid())
433 ent = ent.GetHierarchyParent();
444 return ent.AreChildrenAccessible();
447 ErrorEx(
"no inventory owner found!");
491 Error(
"[syncinv] ServerInventoryCommand (cmd=SYNC_MOVE) dropped, item not in bubble");
504 if (!e.GetSrcEntity())
506 Error(
"[syncinv] ServerInventoryCommand (cmd=HAND_EVENT) dropped, item not in bubble");
509 e.m_Player.GetHumanInventory().ProcessHandEvent(e);
634 item2.GetInventory().GetCurrentInventoryLocation(il2);
637 if (item1.CanBeSplit() && item1.GetQuantity() > item1.GetTargetQuantityMax(slot))
640 item1.GetInventory().GetCurrentInventoryLocation(il1);
643 if (item2.CanBeSplit() && item2.GetQuantity() > item2.GetTargetQuantityMax(slot))
646 if (!item1.CanSwapEntities(item2, il2, il1) || !item2.CanSwapEntities(item1, il1, il2))
672 if (!item1.CanBeFSwaped())
675 if ( item1_dst == null)
677 item2.GetInventory().GetCurrentInventoryLocation(il);
685 if ( item1.GetQuantity() > item1.GetTargetQuantityMax(slot) )
688 if ( item2_dst == null)
690 item1.GetInventory().GetCurrentInventoryLocation(il);
695 slot = item2_dst.GetSlot();
698 if (!item1.CanSwapEntities(item2, item2_dst, item1_dst) || !item2.CanSwapEntities(item1, item1_dst, item2_dst))
703 if ( item2.GetQuantity() > item2.GetTargetQuantityMax(slot) )
722 #ifdef ENABLE_LOGGING
745 #ifdef ENABLE_LOGGING
768 #ifdef ENABLE_LOGGING
854 man.GetHumanInventory().OnEntityInHandsCreated(src);
863 Man player = item.GetHierarchyRootPlayer();
865 player.GetInventory().ClearInventoryReservationEx(item, null);
882 return loc.
GetParent().GetInventory().CreateAttachmentEx(type, loc.
GetSlot());
886 Error(
"CreateInInventory: unknown location for item");
1016 if (item.GetInventory().GetCurrentInventoryLocation(src))
1025 Error(
"[inv] I::Take2Inv(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
" Error - src has no inventory location");
1035 if (item.GetInventory().GetCurrentInventoryLocation(src))
1039 if (target.GetInventory().FindFreeLocationFor(item, flags, dst))
1045 Error(
"[inv] I::Take2Target(" +
typename.EnumToString(
InventoryMode, mode) +
") target=" + target +
" item=" + item +
" Error - src has no inventory location");
1062 if (ret && dst.IsValid())
1101 if (item.GetInventory().GetCurrentInventoryLocation(src))
1108 Error(
"[inv] I::Take2Cgo(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
" row=" + row +
" col=" + col +
" Error - src has no inventory location");
1117 if (item.GetInventory().GetCurrentInventoryLocation(src))
1120 dst.
SetCargoAuto(cargo, item, row, col, item.GetInventory().GetFlipCargo());
1124 Error(
"[inv] I::Take2TargetCgoEx(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
"to cargo of target=" + cargo.GetCargoOwner() +
" row=" + row +
" col=" + col);
1139 if (item.GetInventory().GetCurrentInventoryLocation(src))
1141 EntityAI att = target.GetInventory().FindAttachment(slot);
1146 att.CombineItemsEx(item,
true);
1150 att.CombineItemsClient(item,
true);
1154 else if (item.CanBeSplit() && item.GetTargetQuantityMax(slot) < item.GetQuantity())
1158 item.SplitIntoStackMaxEx(target, slot);
1162 item.SplitIntoStackMaxClient(target,slot);
1173 Error(
"[inv] I::Take2AttEx(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
" Error - src has no inventory location");
1196 dst1.CopyLocationFrom(src2,
false);
1197 dst1.SetFlip(src1.GetItem().GetInventory().GetFlipCargo());
1203 dst2.CopyLocationFrom(src1,
false);
1204 dst2.SetFlip(src2.GetItem().GetInventory().GetFlipCargo());
1215 if (item1.GetInventory().GetCurrentInventoryLocation(src1) && item2.GetInventory().GetCurrentInventoryLocation(src2))
1228 if (item1.GetInventory().GetCurrentInventoryLocation(src1) && item2.GetInventory().GetCurrentInventoryLocation(src2))
1235 dst1.CopyLocationFrom(src2,
false);
1236 dst1.SetFlip(dst1.GetItem().GetInventory().GetFlipCargo());
1260 ground.SetGround(item, m4);
1268 if (item.GetInventory().GetCurrentInventoryLocation(src))
1280 Error(
"DropEntity - No inventory location");
1287 ground.SetGround(item, transform);
1295 if (item.GetInventory().GetCurrentInventoryLocation(src))
1303 Error(
"DropEntityWithTransform - No inventory location");
1310 owner.GetTransform(m4);
1315 float dist = randomPos[0] * m4[1][0] + randomPos[1] * m4[1][1] + randomPos[2] * m4[1][2];
1317 m4[3][0] = m4[3][0] + randomPos[0];
1318 m4[3][1] = m4[3][1] - dist + halfExtents[1];
1319 m4[3][2] = m4[3][2] + randomPos[2];
1321 item.PlaceOnSurfaceRotated(m4,
Vector(m4[3][0], m4[3][1], m4[3][2]));
1323 ground.SetGround(item, m4);
1331 if (item.GetInventory().GetCurrentInventoryLocation(src))
1340 Error(
"DropEntityInBounds - No inventory location");
1348 if (item.GetInventory().GetCurrentInventoryLocation(src))
1351 Error(
"[inv] Source location == HANDS, player has to handle this");
1357 Error(
"LocalDestroyEntity: No inventory location");
1364 if (lambda.
m_OldItem.GetInventory().GetCurrentInventoryLocation(src))
1371 Error(
"[inv] I::ReplaceItemWithNew - no inventory location");
void syncDebugPrint(string s)
void inventoryDebugPrint(string s)
@ USER_RESERVATION_CANCEL
Clear user reserved inventory space.
@ SYNC_MOVE
synchronous move. action is finished immeadiately, no animations involved
@ HAND_EVENT
event for hands
@ MOVE
generic move, may involve animations
enum InventoryCheckContext EQUAL
Find an exact reservation for item and dst, item and dst required.
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
@ SERVER
'Server' mode operation is required if and only if the operation runs only on server (creates and/or ...
@ PREDICTIVE
'Predictive' means that the operation uses Client-Side Prediction, i.e. the action runs the same code...
@ LOCAL
'Local' operation executes from where it is run
enum InventoryCheckContext DST
Find a reservation for the dst EXCLUDING the item, item and dst required.
InventoryValidationResult
@ JUNCTURE
'Juncture' operation is used whenever there is possibility of race condition, i.e....
InventoryValidationReason
enum InventoryCheckContext ITEM
Find a reservation for the item EXCLUDING the dst, item and dst required.
@ UNKNOWN
24 - Any other error. Can be returned from any call.
PlayerSpawnPreset slotName
@ SWAP
swapping from ground
void ClearInventoryReservation()
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
proto native DayZPlayer GetPlayer()
proto native void ObjectDelete(Object obj)
represents base for cargo storage for entities
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
proto native bool GetFlipCargo()
proto native int CountInventory()
almost identical to EnumerateInventory except it does not return items
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/....
void OnServerInventoryCommand(ParamsReadContext ctx)
bool OnInputUserDataProcess(ParamsReadContext ctx)
synchronization
bool LocalDestroyEntity(notnull EntityAI item)
static proto native bool CheckManipulatedObjectsDistances(notnull EntityAI e0, notnull EntityAI e1, float radius)
static proto native bool AddInventoryReservation(EntityAI item, InventoryLocation dst, int timeout_ms)
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 int GetAnyInventoryReservationCount()
proto native int GetAttachmentSlotsCount()
void Init()
script functions
void EEDelete(EntityAI parent)
proto native EntityAI CreateEntityInCargo(string typeName)
Create Entity of specified type in cargo of entity.
proto native bool CanAddEntityInCargoExLoc(InventoryLocation loc)
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 involv...
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
EntityAI CreateInInventory(string type)
creates entity somewhere in inventory
proto native bool FindFirstFreeLocationForNewEntity(string item_type, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFirstFreeLocationForNewEntity.
void OnInventoryFailure(InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
static proto native bool CanSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
test if ordinary swap can be performed.
bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
proto native EntityAI GetAttachmentFromIndex(int index)
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 anoth...
static proto native bool ServerHandEvent(notnull Man player, notnull EntityAI item, ParamsWriteContext ctx)
hand event to clients
proto native EntityAI CreateAttachment(string typeName)
Create Entity of specified type as attachment of entity.
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
proto native EntityAI CreateAttachmentEx(string typeName, int slotId)
Create Entity of specified type as attachment of entity.
bool ExtendInventoryReservationEx(EntityAI item, InventoryLocation dst, int timeout_ms)
static void SetGroundPosByOwnerBounds(EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector halfExtents, float angle, float cosAngle, float sinAngle)
bool CanRemoveEntity()
Returns if entity can be removed from its current location.
static proto native EntityAI LocationGetEntity(notnull InventoryLocation inv_loc)
proto native bool HasAttachment(notnull EntityAI e)
brief Returns True if entity is attached to this
proto native EntityAI FindPlaceholderForSlot(int slot)
Returns placeholder entity for slot (naked arms, legs etc)
bool TakeEntityToInventory(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
Put item anywhere into this entity (as attachment or into cargo, recursively)
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
bool IsAttachment()
Returns true if this Inventory owner is an attachment of something.
proto native bool CanAddEntityInCargo(notnull EntityAI e, bool flip)
proto native bool HasAttachmentEx(notnull EntityAI e, int slot)
brief Returns True if entity is attached to this in slot
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.
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.
proto native CargoBase GetCargoFromIndex(int index)
bool TakeEntityToTargetInventory(InventoryMode mode, notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
helper that finds location first, then moves the entity into it
bool DropEntityWithTransform(InventoryMode mode, EntityAI owner, notnull EntityAI item, vector transform[4])
proto native void LockInventory(int lockType)
bool OnInventoryJunctureRepairFromServer(ParamsReadContext ctx)
bool ClearInventoryReservationEx(EntityAI item, InventoryLocation dst)
proto native bool HasInventorySlot(int slotId)
static proto native bool ServerLocationSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, ParamsWriteContext ctx)
swaps two entities
bool HasAttachmentSlot(int slotId)
static int GetInventoryCheckContext()
bool IsInCargo()
Returns true if this Inventory owner is in cargo of something.
proto native bool CanRemoveAttachmentEx(EntityAI attachment, int slot)
proto native bool HasEntityInCargo(notnull EntityAI e)
bool CanAddEntityIntoHands(notnull EntityAI item)
Test if entity can be put into hands.
const int c_InventoryReservationTimeoutShortMS
bool TakeEntityToCargoEx(InventoryMode mode, notnull EntityAI item, int idx, int row, int col)
moves item on specific cargo location
proto native bool IsInventoryLocked()
proto native void UnlockInventory(int lockType)
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
proto native bool IsInventoryUnlocked()
static proto native bool TestDropEntityPos(EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1)
static proto native bool ClearInventoryReservation(EntityAI item, InventoryLocation dst)
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 bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
proto native bool CanAddEntityInCargoEx(notnull EntityAI e, int idx, int row, int col, bool flip)
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
proto native int FindFreeLocationsFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull array< ref InventoryLocation > locs)
searches inventory for suitable location for @item
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....
bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
move src to dst
static proto native bool CheckTakeItemRequest(notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
proto native void LockInventoryWithKey(notnull EntityAI key)
bool TakeEntityAsTargetAttachment(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
proto native bool CanAddAttachment(notnull EntityAI e)
Check if attachment can be added to any slot.
static proto native bool GetInventoryReservationCount(EntityAI item, InventoryLocation dst)
static proto native bool ExtendInventoryReservation(EntityAI item, InventoryLocation dst, int timeout_ms)
proto native bool IsPlaceholderEntity(notnull Object e)
bool AddEntityToInventory(notnull EntityAI item)
add entity somewhere in inventory
bool CanAddEntityIntoInventory(notnull EntityAI item)
Test if entity can be put to the inventory (Cargo, ProxyCargo, Attachment)
bool OnInventoryJunctureFromServer(ParamsReadContext ctx)
proto native bool HasEntityInCargoEx(notnull EntityAI e, int idx, int row, int col)
proto native bool GetSlotLock(int slot)
proto native EntityAI GetInventoryOwner()
Engine native 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 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 shorthan...
bool IsCargoInHiearchy()
Returns true if inventory owner or his hiearchy parents are in cargo.
bool ReplaceItemWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
static proto native bool HasInventoryReservationCanAdd(EntityAI item, InventoryLocation dst)
Internally: !HasInventoryReservationEx(item, dst, FindInventoryReservationMode.ITEM,...
static bool SetGroundPosByOwner(EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
proto native int GetSlotId(int index)
attachments
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 CanRemoveEntityInCargoEx(notnull EntityAI e, int idx, int row, int col)
const int c_InventoryReservationTimeoutMS
reservations
static int m_inventory_check_context
bool TakeEntityAsAttachment(InventoryMode mode, notnull EntityAI item)
static proto native bool LocationSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
swaps two entities
proto native bool CanRemoveEntityInCargo(notnull EntityAI e)
bool ForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
static bool LocationCanMoveEntitySyncCheck(notnull InventoryLocation src, notnull InventoryLocation dst)
static void OnServerInventoryCommandStatic(ParamsReadContext ctx)
static proto native bool HasInventoryReservation(EntityAI item, InventoryLocation dst)
Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY,...
static proto native bool LocationAddEntity(notnull InventoryLocation inv_loc)
adds item to inventory location
proto native bool HasKeys()
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
const float c_MaxItemDistanceRadius
anti-cheats
proto native int AttachmentCount()
Returns count of attachments attached to this item.
proto native bool CanLockInventoryWithKey(notnull EntityAI key)
locks
bool AddInventoryReservationEx(EntityAI item, InventoryLocation dst, int timeout_ms)
static bool SetGroundPosByTransform(EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector transform[4])
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 LocationCanAddEntity(notnull InventoryLocation inv_loc)
queries if the entity contained in inv_loc.m_item can be added to ground/attachment/cargo/hands/....
void OnInventoryJunctureFailureFromServer(ParamsReadContext ctx)
static bool MakeDstForSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2)
helper function for swap
proto native bool HasEntityInInventory(notnull EntityAI item)
query inventory if item is somewhere
proto native bool FindFreeLocationForEx(notnull EntityAI item, FindInventoryLocationType flags, notnull InventoryLocation exclude, out notnull InventoryLocation loc)
FindFreeLocationForEx.
bool TakeEntityToTargetCargo(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
Put item into into cargo of another entity.
bool AreChildrenAccessible()
Returns true if item is considered reachable within inventory.
static proto native bool CheckDropRequest(notnull Man requestingPlayer, notnull InventoryLocation src, float radius)
proto native void SetFlipCargo(bool flip)
proto native int GetSlotIdCount()
void OnStoreSave(ParamsWriteContext ctx)
db store hook
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)
static proto native bool CheckSwapItemsRequest(notnull Man requestingPlayer, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, float radius)
proto native int GetAttachmentSlotId(int index)
proto native void ResetFlipCargo()
proto native bool SetSlotLock(int slot, bool locked)
proto native EntityAI FindAttachmentByName(string slotName)
Returns attached entity in slot (you can use EntityAI.GetActionComponentName to get slot id)
bool CanAddEntityToInventory(notnull EntityAI item, int flag=FindInventoryLocationType.ANY)
ask inventory if item could be placed somewhere in inventory
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
bool TakeEntityAsAttachmentEx(InventoryMode mode, notnull EntityAI item, int 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!...
static proto native bool CheckMoveToDstRequest(notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
proto native bool CanAddSwappedEntity(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
proto native void UnlockInventoryWithKey(notnull EntityAI key)
proto native bool IsInventoryLockedForLockType(int lockType)
proto native bool CanRemoveAttachment(EntityAI attachment)
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)
static proto native bool CheckRequestSrc(notnull Man requestingPlayer, notnull InventoryLocation src, float radius)
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 inve...
bool DropEntityInBounds(InventoryMode mode, EntityAI owner, notnull EntityAI item, vector halfExtents, float angle, float cosAngle, float sinAngle)
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
proto native int GetScriptLockCount()
bool TakeEntityToCargo(InventoryMode mode, notnull EntityAI item)
moves item to cargo of this intentory
proto native void FlipCargo()
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
static proto native bool LocationRemoveEntity(notnull InventoryLocation inv_loc)
removes item from inventory location
bool TakeEntityAsTargetAttachmentEx(InventoryMode mode, notnull EntityAI target, notnull EntityAI item, int slot)
put item as attachment of target
bool DropEntity(InventoryMode mode, EntityAI owner, notnull EntityAI item)
bool CanAddEntityInto(notnull EntityAI item, FindInventoryLocationType flags=FindInventoryLocationType.ANY)
Asks inventory if item could be placed in inventory, hands, etc.
static bool LocationCanAddEntityEx(notnull InventoryLocation inv_loc)
bool OnStoreLoad(ParamsReadContext ctx, int version)
db load hooks
proto native bool CanUnlockInventoryWithKey(notnull EntityAI key)
script counterpart to engine's class Inventory
override string DumpToString()
Abstracted event, not to be used, only inherited.
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
static string DumpToStringNullSafe(InventoryLocation loc)
proto native void SetAttachment(notnull EntityAI parent, EntityAI e, int slotId)
sets current inventory location type to Attachment with slot id set to <slotId>
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetCargoAuto(notnull CargoBase cargo, EntityAI e, int row, int col, bool flip)
based on Cargo.IsProxyCargo uses SetProxyCargo or SetCargo respectively
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
bool ReadFromContext(ParamsReadContext ctx)
proto native EntityAI GetItem()
returns item of current inventory location
const int INVALID
Invalid slot (-1)
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
InventoryValidationResult m_Result
InventoryValidationReason m_Reason
static bool IsInventoryReservationLogEnable()
static bool IsSyncLogEnable()
static bool IsInventoryMoveLogEnable()
void Execute(HumanInventoryWithFSM fsm_to_notify=null)
base class for transformation operations (creating one item from another)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static vector RotateAroundZero(vector pos, vector axis, float cosAngle, float sinAngle)
Rotate a vector around 0,0,0.
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
enum ChatChannelType LEGACY
Legacy version, UNDER but without proxy support.
void Error(string err)
Messagebox with error message.
const int INVENTORY_ENTITY_DROP_OVERLAP_DEPTH
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].