1#ifdef FEATURE_NETWORK_RECONCILIATION
2class Person
extends Pawn
12#ifdef FEATURE_NETWORK_RECONCILIATION
13class Man
extends Person
132 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveDropEntity input data not sent yet, cannot allow another input action");
182 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToHands input data not sent yet, cannot allow another input action");
204 if (!
g_Game.IsDedicatedServer() )
215 if (item.GetInventory().GetCurrentInventoryLocation(src_item))
217 if (itemInHands == null)
224 GetInventory().SwapEntities(mode, itemInHands, item);
243 Print(
"[inv] PredictiveMoveItemFromHandsToInventory input data not sent yet, cannot allow another input action");
255 if (entityInHands.m_OldLocation && entityInHands.m_OldLocation.IsValid())
258 entityInHands.GetInventory().GetCurrentInventoryLocation(invLoc);
261 EntityAI oldLocationParent = entityInHands.m_OldLocation.GetParent();
262 if (oldLocationParent && oldLocationParent.GetHierarchyRootPlayer())
268 if (!oldLocEntity && humanInventory.
TakeToDst(invMode, invLoc, entityInHands.m_OldLocation))
278 if (humanInventory.
TakeToDst(invMode, invLoc, newLocation))
317 bool code =
GetHumanInventory().ReplaceItemElsewhereWithNewInHands(mode, lambda);
357 bool code =
GetHumanInventory().ReplaceItemInHandsWithNewElsewhere(mode, lambda);
385 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToInventory input data not sent yet, cannot allow another input action");
426 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveSwapEntities input data not sent yet, cannot allow another input action");
430 EntityAI item1Parent = item1.GetHierarchyParent();
431 EntityAI item2Parent = item2.GetHierarchyParent();
434 if (need_j1 || need_j2)
455 Error(
"[inv] (Man@" +
this +
") SwapEntitiesImpl - cannot swap items!");
476 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveForceSwapEntities input data not sent yet, cannot allow another input action");
480 EntityAI item1Parent = item1.GetHierarchyParent();
481 EntityAI item2Parent = item2.GetHierarchyParent();
484 if (need_j1 || need_j2)
523 Print(
"[inv] " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetInventory input data not sent yet, cannot allow another input action");
535 if( GetInventory().CanAddAttachment( item ) )
545 int slot_id = itemInventory.
GetSlotId(i);
564 bool code = GetInventory().TakeEntityToTargetInventory(mode, target, flags, item);
580 Print(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetCargoEx input data not sent yet, cannot allow another input action");
603 bool code = GetInventory().TakeEntityToTargetCargoEx(mode, cargo, item, row, col);
619 Print(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetCargo input data not sent yet, cannot allow another input action");
662 Print(
"[inv] " +
GetDebugName(
this) +
" STS = " + GetSimulationTimeStamp() +
" ::PredictiveTakeEntityToTargetAttachmentEx input data not sent yet, cannot allow another input action");
685 bool code = GetInventory().TakeEntityAsTargetAttachmentEx(mode, target, item, slot);
701 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeEntityToTargetAttachment input data not sent yet, cannot allow another input action");
742 Print(
"[inv] " + GetSimulationTimeStamp() +
" Man@" +
this +
" ::PredictiveTakeToDst input data not sent yet, cannot allow another input action");
779 return !GetIsFrozen();
884 [
Obsolete(
"1.30: Use JunctureTakeEntityToTargetCargo instead")]
890 [
Obsolete(
"1.30: Use TakeEntityToTargetCargoImpl instead")]
901 [
Obsolete(
"1.30: Use JunctureTakeEntityToTargetAttachment instead")]
907 [
Obsolete(
"1.30: Use TakeEntityToTargetAttachmentImpl instead")]
918 [
Obsolete(
"1.30: Use JunctureTakeEntityToTargetAttachmentEx instead")]
924 [
Obsolete(
"1.30: Use TakeEntityToTargetAttachmentExImpl instead")]
void syncDebugPrint(string s)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
FindInventoryLocationType
flags for searching locations in inventory
represents base for cargo storage for entities
bool ReplaceItemInHandsWithNewImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
hand replace
override bool ServerTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
override bool IsHealthVisible()
proto native void StatUpdateByTime(string name)
Updates stat counter by time.
override bool PredictiveTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
void AddItemToDelete(EntityAI item)
override bool LocalTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
override bool PredictiveTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
override bool LocalTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
bool JunctureTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
to target cgo ex juncture
ref ScriptInvoker m_OnItemAddedToHands
bool JunctureTakeEntityAsAttachment(notnull EntityAI item)
as att juncture
bool TakeEntityToCargoImpl(InventoryMode mode, notnull EntityAI item)
bool ServerReplaceItemInHandsWithNewElsewhere(ReplaceItemWithNewLambdaBase lambda)
void UpdateInventoryMenu()
bool JunctureTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
to target cgo juncture
bool IsUnconsciousStateOnly()
uncon command might be still in progress but state already changed (for simple checks only - eg....
bool LocalReplaceItemElsewhereWithNewInHands(ReplaceItemWithNewLambdaBase lambda)
override bool PredictiveDropEntity(notnull EntityAI item)
override bool ServerTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
bool JunctureDropEntity(notnull EntityAI item)
drop juncture
bool LocalReplaceItemInHandsWithNewElsewhere(ReplaceItemWithNewLambdaBase lambda)
ScriptInvoker GetOnItemAddedToHands()
bool IsInventorySoftLocked()
override void EEItemIntoHands(EntityAI item)
void SetInventorySoftLock(bool status)
override bool PredictiveTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
bool LocalReplaceItemInHandsWithNew(ReplaceItemWithNewLambdaBase lambda)
override bool LocalTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
bool IsInTransport()
returns true if man is in transport, false otherwise
proto native void StatSyncToClient()
override bool ServerTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
bool ServerSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
array< InventoryItem > OnDrawOptics2D()
void LocalDestroyEntityInHands()
proto native EntityAI GetEntityInHands()
Returns the current entity in hands.
ref CachedEquipmentStorageBase m_CachedEquipmentStorage
proto native void SetMasterAttenuation(string masterAttenuation)
override bool PredictiveTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
void JunctureTakeEntityToHands(notnull EntityAI item)
hand juncture
bool SwapEntitiesImpl(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
override bool ServerTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
bool ReplaceItemWithNewImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
!hand -> !hand replace
bool JunctureTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
as att ex juncture
bool ReplaceItemElsewhereWithNewInHandsImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
!hand replace -> hand
void TakeEntityToHandsImpl(InventoryMode mode, EntityAI item)
bool ServerReplaceItemWithNew(ReplaceItemWithNewLambdaBase lambda)
override bool LocalTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
proto native float StatGet(string name)
Gets counter value of the specified stat type.
void OnItemInHandsChanged()
override bool LocalTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
override bool PredictiveTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
proto native owned string GetMasterAttenuation()
override bool PredictiveTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
bool PredictiveForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
bool JunctureSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
swap juncture
bool JunctureTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
to target inv juncture
proto native void StatInvokeUpdate()
override bool CanBeSkinned()
proto native EntityAI GetDrivingVehicle()
Returns vehicle which this Man object is driving. If this Man object isn't as driver of any vehicle i...
void ServerTakeEntityToHands(EntityAI item)
void LocalTakeEntityToHands(EntityAI item)
bool TakeEntityAsAttachmentExImpl(InventoryMode mode, notnull EntityAI item, int slot)
override bool CanDropEntity(notnull EntityAI item)
CachedEquipmentStorageBase GetCachedEquipment()
override bool ServerTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
bool LocalSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
proto native owned string GetCurrentWeaponMode()
bool PhysicalPredictiveDropItem(EntityAI entity, bool heavy_item_only=true)
proto native void SetFaceTexture(string texture_name)
Texture that is used on the Man's face and hands.
void StopDeathDarkeningEffect()
bool PredictiveTakeOrSwapAttachment(notnull EntityAI item)
proto void StatGetCounter(string name, out string value)
Gets counter value as string of the specified stat type.
override bool HasFixedActionTargetCursorPosition()
override bool DisableVicinityIcon()
bool JunctureTakeEntityToCargo(notnull EntityAI item)
to cgo juncture
bool TakeEntityToTargetAttachmentExImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item, int slot)
bool JunctureTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
to inv juncture
bool ServerReplaceItemElsewhereWithNewInHands(ReplaceItemWithNewLambdaBase lambda)
bool LocalForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
bool JunctureTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
to target att ex juncture
bool JunctureTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
to dst juncture
proto native void SetSpeechRestricted(bool state)
Set speech restriction.
proto native void SetFaceMaterial(string material_name)
Material that is used on the Man's face and hands.
proto native bool IsCameraInsideVehicle()
bool ForceSwapEntitiesImpl(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
override bool ServerTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
proto native bool StatRegister(string name)
override bool LocalTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
bool TakeToDstImpl(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
bool JunctureTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
to target att juncture
bool ServerForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
void OnItemInHandsChangedEx(bool pInstant=false, bool pChangeAnimationInstance=true)
override bool LocalTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
override bool ServerDropEntity(notnull EntityAI item)
proto native void StatUpdate(string name, float value)
Updates stat counter with given value.
proto native PlayerIdentity GetIdentity()
Returns player's identity.
bool NeedInventoryJunctureFromServer(notnull EntityAI item, EntityAI currParent, EntityAI newParent)
proto native bool IsSpeechRestricted()
Check if player has resctricted speech.
bool TakeEntityToTargetAttachmentImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
proto native UAInterface GetInputInterface()
Returns player's input interface.
proto native void StatUpdateByPosition(string name)
Updates stat counter by player's actual position.
bool JunctureForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
ForceSwap juncture.
bool CanPlaceItem(EntityAI item)
void SetProcessUIWarning(bool state)
ref ScriptInvoker m_OnItemRemovedFromHands
void JunctureDeleteItem(EntityAI item)
bool DropEntityImpl(InventoryMode mode, notnull EntityAI owner, notnull EntityAI item)
bool TakeEntityToTargetCargoImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
bool TakeEntityToTargetCargoExImpl(InventoryMode mode, notnull CargoBase cargo, notnull EntityAI item, int row, int col)
proto void StatGetAsTime(string name, out string value)
Gets counter value as formatted time string of the specified stat type.
bool ServerReplaceItemInHandsWithNew(ReplaceItemWithNewLambdaBase lambda)
proto native bool IsSoundInsideBuilding()
void PredictiveMoveItemFromHandsToInventory()
ToDo: Old system method. Might should be adjusted to new system at some point.
proto native HumanInventory GetHumanInventory()
override bool LocalDropEntity(notnull EntityAI item)
override void EEItemOutOfHands(EntityAI item)
void OnGameplayDataHandlerSync()
bool TakeEntityToTargetInventoryImpl(InventoryMode mode, notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
ScriptInvoker GetOnItemRemovedFromHands()
void PredictiveTakeEntityToHands(EntityAI item)
bool TakeEntityAsAttachmentImpl(InventoryMode mode, notnull EntityAI item)
proto native void StatUpdateByGivenPos(string name, vector pos)
Updates stat counter by given position.
bool PredictiveSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
override bool PredictiveTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
bool ReplaceItemInHandsWithNewElsewhereImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
hand replace2
bool LocalReplaceItemWithNew(ReplaceItemWithNewLambdaBase lambda)
bool TakeEntityToInventoryImpl(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
static proto native EntityAI LocationGetEntity(notnull InventoryLocation inv_loc)
static proto native bool ClearInventoryReservation(EntityAI item, InventoryLocation dst)
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
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...
proto native int GetSlotId(int index)
attachments
proto native int GetSlotIdCount()
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
script counterpart to engine's class Inventory
override bool TakeEntityToInventory(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
inventory for plain man/human
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
static string DumpToStringNullSafe(InventoryLocation loc)
proto native int GetSlot()
returns slot id if current type is Attachment
static bool IsSyncLogEnable()
The class that will be instanced (moddable)
base class for transformation operations (creating one item from another)
ScriptInvoker Class provide list of callbacks usage:
Native class for boats - handles physics simulation.
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
override string GetDebugName()
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
proto native void SetFlags(ShapeFlags flags)
void Obsolete(string msg="")