61enum FindInventoryReservationMode
95 proto native
void DumpInventoryDebug ();
101 static proto native
void DumpStaticInventoryDebug ();
153 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);
343 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);
419 parent.GetInventory().GetCurrentInventoryLocation(lcn);
464 LogError(
"[syncinv] ServerInventoryCommand (cmd=SYNC_MOVE) dropped, item not in bubble");
477 if (!e.GetSrcEntity())
479 Error(
"[syncinv] ServerInventoryCommand (cmd=HAND_EVENT) dropped, item not in bubble");
482 e.m_Player.GetHumanInventory().ProcessHandEvent(e);
607 item2.GetInventory().GetCurrentInventoryLocation(il2);
610 if( item1.GetQuantity() > item1.GetTargetQuantityMax(slot) )
614 item1.GetInventory().GetCurrentInventoryLocation(il1);
617 if( item2.GetQuantity() > item2.GetTargetQuantityMax(slot) )
620 if(!item1.CanSwapEntities(item2, il2, il1) || !item2.CanSwapEntities(item1, il1, il2))
646 if ( item1_dst == null)
648 item2.GetInventory().GetCurrentInventoryLocation(il);
656 if ( item1.GetQuantity() > item1.GetTargetQuantityMax(slot) )
659 if ( item2_dst == null)
661 item1.GetInventory().GetCurrentInventoryLocation(il);
666 slot = item2_dst.GetSlot();
669 if (!item1.CanSwapEntities(item2, item2_dst, item1_dst) || !item2.CanSwapEntities(item1, item1_dst, item2_dst))
674 if ( item2.GetQuantity() > item2.GetTargetQuantityMax(slot) )
824 man.GetHumanInventory().OnEntityInHandsCreated(src);
833 Man player = item.GetHierarchyRootPlayer();
835 player.GetInventory().ClearInventoryReservationEx(item, null);
853 default:
Error(
"CreateInInventory: unknown location for item");
break;
979 if (item.GetInventory().GetCurrentInventoryLocation(src))
988 Error(
"[inv] I::Take2Inv(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
" Error - src has no inventory location");
998 if (item.GetInventory().GetCurrentInventoryLocation(src))
1002 if (target.GetInventory().FindFreeLocationFor(item, flags, dst))
1005 inventoryDebugPrint(
"[inv] I::Take2Target(" +
typename.EnumToString(
InventoryMode, mode) +
") target=" + target +
" item=" + item +
" Warning - no room for item in target");
1008 Error(
"[inv] I::Take2Target(" +
typename.EnumToString(
InventoryMode, mode) +
") target=" + target +
" item=" + item +
" Error - src has no inventory location");
1025 if (ret && dst.IsValid())
1066 if (item.GetInventory().GetCurrentInventoryLocation(src))
1073 Error(
"[inv] I::Take2Cgo(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
" row=" + row +
" col=" + col +
" Error - src has no inventory location");
1080 inventoryDebugPrint(
"[inv] I::Take2TargetCgoEx(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
"to cargo of target=" + cargo.GetCargoOwner() +
" row=" + row +
" col=" + col);
1082 if (item.GetInventory().GetCurrentInventoryLocation(src))
1085 dst.
SetCargoAuto(cargo, item, row, col, item.GetInventory().GetFlipCargo());
1089 Error(
"[inv] I::Take2TargetCgoEx(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
"to cargo of target=" + cargo.GetCargoOwner() +
" row=" + row +
" col=" + col);
1102 inventoryDebugPrint(
"[inv] I::Take2TargetAttEx(" +
typename.EnumToString(
InventoryMode, mode) +
") as ATT of target=" + target +
" item=" + item +
" slot=" + slot);
1104 if (item.GetInventory().GetCurrentInventoryLocation(src))
1107 EntityAI att = target.GetInventory().FindAttachment(slot);
1111 att.CombineItemsClient(item,
true );
1121 Error(
"[inv] I::Take2AttEx(" +
typename.EnumToString(
InventoryMode, mode) +
") item=" + item +
" Error - src has no inventory location");
1144 dst1.
SetFlip(src1.GetItem().GetInventory().GetFlipCargo());
1150 dst2.
SetFlip(src2.GetItem().GetInventory().GetFlipCargo());
1161 if (item1.GetInventory().GetCurrentInventoryLocation(src1) && item2.GetInventory().GetCurrentInventoryLocation(src2))
1173 if (item1.GetInventory().GetCurrentInventoryLocation(src1) && item2.GetInventory().GetCurrentInventoryLocation(src2))
1180 dst1.
SetFlip(dst1.GetItem().GetInventory().GetFlipCargo());
1204 ground.SetGround(item, m4);
1212 if (item.GetInventory().GetCurrentInventoryLocation(src))
1224 Error(
"DropEntity - No inventory location");
1231 ground.SetGround(item, transform);
1239 if (item.GetInventory().GetCurrentInventoryLocation(src))
1251 Error(
"DropEntityWithTransform - No inventory location");
1258 owner.GetTransform(m4);
1263 float dist = randomPos[0] * m4[1][0] + randomPos[1] * m4[1][1] + randomPos[2] * m4[1][2];
1265 m4[3][0] = m4[3][0] + randomPos[0];
1266 m4[3][1] = m4[3][1] - dist + halfExtents[1];
1267 m4[3][2] = m4[3][2] + randomPos[2];
1269 item.PlaceOnSurfaceRotated(m4,
Vector(m4[3][0], m4[3][1], m4[3][2]));
1271 ground.SetGround(item, m4);
1279 if (item.GetInventory().GetCurrentInventoryLocation(src))
1288 Error(
"DropEntityInBounds - No inventory location");
1296 if (item.GetInventory().GetCurrentInventoryLocation(src))
1299 Error(
"[inv] Source location == HANDS, player has to handle this");
1305 Error(
"LocalDestroyEntity: No inventory location");
1312 if (lambda.
m_OldItem.GetInventory().GetCurrentInventoryLocation(src))
1319 Error(
"[inv] I::ReplaceItemWithNew - no inventory location");
void syncDebugPrint(string s)
void inventoryDebugPrint(string s)
@ SWAP
swap two entities (simple swap of compatible objects)
enum InventoryCheckContext LEGACY
The original logic, finds anything depending on the parameters, item or dst required.
@ USER_RESERVATION_CANCEL
Clear user reserved inventory space.
@ FORCESWAP
Forced swap two entities. First goes to second's place, second goes "somewhere else".
@ DESTROY
destroy of entity right in inventory
@ REPLACE
replace of entity in inventory (@NOTE: hands goes through HAND_EVENT)
@ 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.
@ 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.
void ClearInventoryReservation()
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
void LogError(string message, LogTemplateID template_id=0)
Creates error log (optional) from LogTemplate which are registred.
proto native void ObjectDelete(Object obj)
proto native DayZPlayer GetPlayer()
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)
script counterpart to engine's class Inventory
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.
proto native bool IsInventoryLockedForLockType(int lockType)
proto native bool HasAttachmentEx(notnull EntityAI e, int slot)
brief Returns True if entity is attached to this in slot
proto native CargoBase GetCargoFromIndex(int index)
bool DropEntity(InventoryMode mode, EntityAI owner, notnull EntityAI item)
proto native bool CanUnlockInventoryWithKey(notnull EntityAI key)
proto native EntityAI CreateAttachmentEx(string typeName, int slotId)
Create Entity of specified type as attachment of entity.
EntityAI CreateInInventory(string type)
creates entity somewhere in inventory
static proto native bool LocationAddEntity(notnull InventoryLocation inv_loc)
adds item to inventory location
proto native bool CanAddSwappedEntity(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
bool OnInventoryJunctureFromServer(ParamsReadContext ctx)
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
bool IsCargoInHiearchy()
Returns true if item of his hiearchy parents are in cargo.
proto native EntityAI GetAttachmentFromIndex(int index)
bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
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 GetFlipCargo()
bool ForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
static proto native bool HasInventoryReservation(EntityAI item, InventoryLocation dst)
Internally: HasInventoryReservationEx(item, dst, FindInventoryReservationMode.LEGACY,...
proto native int CountInventory()
almost identical to EnumerateInventory except it does not return items
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 EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new item directly at location
proto native bool CanRemoveEntityInCargo(notnull EntityAI e)
void EEDelete(EntityAI parent)
bool CanRemoveEntity()
Returns if entity can be removed from its current location.
static proto native bool LocationSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
swaps two entities
proto native bool CanAddAttachment(notnull EntityAI e)
Check if attachment can be added to any slot.
const int c_InventoryReservationTimeoutMS
reservations
static proto native bool LocationRemoveEntity(notnull InventoryLocation inv_loc)
removes item from inventory location
proto native bool IsPlaceholderEntity(notnull Object e)
bool TakeEntityAsAttachmentEx(InventoryMode mode, notnull EntityAI item, int slot)
proto native void UnlockInventoryWithKey(notnull EntityAI key)
proto native int AttachmentCount()
Returns count of attachments attached to this item.
proto native bool IsInventoryLocked()
proto native bool CanAddEntityInCargo(notnull EntityAI e, bool flip)
static proto native bool ClearInventoryReservation(EntityAI item, InventoryLocation dst)
proto native EntityAI CreateEntityInCargo(string typeName)
Create Entity of specified type in cargo of entity.
bool TakeEntityToCargo(InventoryMode mode, notnull EntityAI item)
moves item to cargo of this intentory
static void SetGroundPosByOwnerBounds(EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector halfExtents, float angle, float cosAngle, float sinAngle)
const float c_MaxItemDistanceRadius
anti-cheats
proto native bool CanAddEntityInCargoEx(notnull EntityAI e, int idx, int row, int col, bool flip)
proto native bool CanLockInventoryWithKey(notnull EntityAI key)
locks
bool OnInputUserDataProcess(ParamsReadContext ctx)
synchronization
static proto native bool HasInventoryReservationCanAdd(EntityAI item, InventoryLocation dst)
Internally: !HasInventoryReservationEx(item, dst, FindInventoryReservationMode.ITEM,...
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 protected int m_inventory_check_context
proto native bool SetSlotLock(int slot, bool locked)
proto native bool CanAddEntityInCargoExLoc(InventoryLocation loc)
bool DropEntityInBounds(InventoryMode mode, EntityAI owner, notnull EntityAI item, vector halfExtents, float angle, float cosAngle, float sinAngle)
const int c_InventoryReservationTimeoutShortMS
proto native EntityAI CreateAttachment(string typeName)
Create Entity of specified type as attachment of entity.
bool ClearInventoryReservationEx(EntityAI item, InventoryLocation 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
proto native bool HasAttachment(notnull EntityAI e)
brief Returns True if entity is attached to this
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...
void OnServerInventoryCommand(ParamsReadContext ctx)
static bool SetGroundPosByOwner(EntityAI owner, notnull EntityAI item, out InventoryLocation ground)
static proto native bool CheckTakeItemRequest(notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
bool CanAddEntityInto(notnull EntityAI item, FindInventoryLocationType flags=FindInventoryLocationType.ANY)
Asks inventory if item could be placed in inventory, hands, etc.
bool AddInventoryReservationEx(EntityAI item, InventoryLocation dst, int timeout_ms)
bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
move src to dst
static void OnServerInventoryCommandStatic(ParamsReadContext ctx)
bool TakeEntityToCargoEx(InventoryMode mode, notnull EntityAI item, int idx, int row, int col)
moves item on specific cargo location
proto native void ResetFlipCargo()
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
static int GetInventoryCheckContext()
bool TakeEntityAsTargetAttachment(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
proto native bool IsInventoryUnlocked()
bool AddEntityToInventory(notnull EntityAI item)
add entity somewhere in inventory
proto native bool HasEntityInCargo(notnull EntityAI e)
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 void SetFlipCargo(bool flip)
bool ReplaceItemWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
bool TakeEntityAsAttachment(InventoryMode mode, notnull EntityAI item)
static proto native bool CheckMoveToDstRequest(notnull Man requestingPlayer, notnull InventoryLocation src, notnull InventoryLocation dst, float radius)
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native bool HasKeys()
proto native bool FindFreeLocationForEx(notnull EntityAI item, FindInventoryLocationType flags, notnull InventoryLocation exclude, out notnull InventoryLocation loc)
FindFreeLocationForEx.
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
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 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...
void Init()
script functions
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
static proto native bool AddInventoryReservation(EntityAI item, InventoryLocation dst, int timeout_ms)
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....
proto native bool HasInventorySlot(int slotId)
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...
proto native EntityAI FindAttachmentByName(string slotName)
Returns attached entity in slot (you can use EntityAI.GetActionComponentName to get slot id)
proto native void FlipCargo()
static proto native bool CheckRequestSrc(notnull Man requestingPlayer, notnull InventoryLocation src, float radius)
proto native CargoBase GetCargo()
cargo
bool TakeEntityToInventory(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
Put item anywhere into this entity (as attachment or into cargo, recursively)
static proto native bool CheckDropRequest(notnull Man requestingPlayer, notnull InventoryLocation src, float radius)
static bool LocationCanAddEntityEx(notnull InventoryLocation inv_loc)
proto native bool CanRemoveAttachment(EntityAI attachment)
proto native bool HasEntityInCargoEx(notnull EntityAI e, int idx, int row, int col)
static proto native bool GetInventoryReservationCount(EntityAI item, InventoryLocation dst)
proto native void LockInventoryWithKey(notnull EntityAI key)
bool CanAddEntityIntoInventory(notnull EntityAI item)
Test if entity can be put to the inventory (Cargo, ProxyCargo, Attachment)
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!...
proto native int GetAttachmentSlotsCount()
static proto native bool TestDropEntityPos(EntityAI owner, notnull EntityAI item, out vector mat[4], bool useValuesInMatrix=false, int conflictCheckDepth=-1)
proto native EntityAI FindPlaceholderForSlot(int slot)
Returns placeholder entity for slot (naked arms, legs etc)
proto native int GetSlotId(int index)
attachments
proto native bool FindFirstFreeLocationForNewEntity(string item_type, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFirstFreeLocationForNewEntity.
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 CanForceSwapEntities(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
test if forced swap can be performed.
static proto native bool ExtendInventoryReservation(EntityAI item, InventoryLocation dst, int timeout_ms)
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
proto native bool HasEntityInInventory(notnull EntityAI item)
query inventory if item is somewhere
proto native bool CanRemoveEntityInCargoEx(notnull EntityAI e, int idx, int row, int col)
bool OnStoreLoad(ParamsReadContext ctx, int version)
db load hooks
proto native bool GetSlotLock(int slot)
proto native void UnlockInventory(int lockType)
proto native int GetAttachmentSlotId(int index)
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/....
proto native int GetScriptLockCount()
static proto native bool CheckManipulatedObjectsDistances(notnull EntityAI e0, notnull EntityAI e1, float radius)
bool LocalDestroyEntity(notnull EntityAI item)
bool TakeEntityToTargetCargo(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
Put item into into cargo of another entity.
void OnInventoryFailure(InventoryCommandType type, InventoryValidationReason reason, InventoryLocation src, InventoryLocation dst)
proto native bool CanRemoveAttachmentEx(EntityAI attachment, int slot)
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)
static proto native bool CheckSwapItemsRequest(notnull Man requestingPlayer, notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2, float radius)
bool IsInCargo()
Returns true if this Inventory owner is in cargo of something.
static bool SetGroundPosByTransform(EntityAI owner, notnull EntityAI item, out InventoryLocation ground, vector transform[4])
static proto native bool LocationMoveEntity(notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
removes item from current inventory location and adds it to destination
bool TakeEntityToTargetInventory(InventoryMode mode, notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
helper that finds location first, then moves the entity into it
bool CanAddEntityIntoHands(notnull EntityAI item)
Test if entity can be put into hands.
void OnStoreSave(ParamsWriteContext ctx)
db store hook
proto native EntityAI GetInventoryOwner()
Engine native functions.
proto native int GetSlotIdCount()
static bool MakeDstForSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2)
helper function for swap
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.
void OnInventoryJunctureFailureFromServer(ParamsReadContext ctx)
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/....
bool DropEntityWithTransform(InventoryMode mode, EntityAI owner, notnull EntityAI item, vector transform[4])
bool CanAddEntityToInventory(notnull EntityAI item, int flag=FindInventoryLocationType.ANY)
ask inventory if item could be placed somewhere in inventory
bool TakeEntityAsTargetAttachmentEx(InventoryMode mode, notnull EntityAI target, notnull EntityAI item, int slot)
put item as attachment of target
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 bool CanSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
test if ordinary swap can be performed.
bool OnInventoryJunctureRepairFromServer(ParamsReadContext ctx)
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/....
proto native void LockInventory(int lockType)
static proto native bool ServerHandEvent(notnull Man player, notnull EntityAI item, ParamsWriteContext ctx)
hand event to clients
static proto native EntityAI LocationGetEntity(notnull InventoryLocation inv_loc)
static bool LocationCanMoveEntitySyncCheck(notnull InventoryLocation src, notnull InventoryLocation dst)
bool IsAttachment()
Returns true if this Inventory owner is an attachment of something.
bool ExtendInventoryReservationEx(EntityAI item, InventoryLocation dst, int timeout_ms)
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...
Abstracted event, not to be used, only inherited.
override string DumpToString()
proto native int GetType()
returns type of InventoryLocation
proto native bool IsValid()
verify current set inventory location
proto native int GetCol()
returns column 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 GetRow()
returns row 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 InventoryLocation CopyLocationFrom(notnull InventoryLocation rhs, bool copyFlip)
copies location to another location without m_item member
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native InventoryLocation Copy(notnull InventoryLocation rhs)
copies location data to another location
proto native void SetFlip(bool flip)
proto native EntityAI GetParent()
returns parent of current inventory location
bool ReadFromContext(ParamsReadContext ctx)
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 EntityAI GetItem()
returns item of current inventory location
proto native bool GetFlip()
returns flip status of cargo
proto native int GetSlot()
returns slot id if current type is Attachment
static string DumpToStringNullSafe(InventoryLocation loc)
provides access to slot configuration
static proto native owned string GetSlotName(int id)
converts slot_id to string
const int INVALID
Invalid slot (-1)
InventoryValidationResult m_Result
InventoryValidationReason m_Reason
static bool IsInventoryReservationLogEnable()
base class for transformation operations (creating one item from another)
void Execute(HumanInventoryWithFSM fsm_to_notify=null)
Serialization general interface. Serializer API works with:
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.
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
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].