45 hndDebugPrint(
"[inv] ReplaceItemWithNewLambdaBase Step A) Prepare inventory locations, old_item=" +
m_OldItem);
78 Error(
"[inv] ReplaceItemWithNewLambdaBase Step A.1) failed to get old_item inventory location");
90 Error(
"[inv] ReplaceItemWithNewLambdaBase Step B) failed to remove old_item rom current inventory location");
99 Error(
"[inv] ReplaceItemWithNewLambdaBase Step B) failed to undo remove");
138 new_item.SetOrientation(
m_OldItem.GetOrientation());
151 hndDebugPrint(
"[inv] ReplaceItemWithNewLambdaBase Step D) Created new new_item=" + new_item);
187 hndDebugPrint(
"[inv] ReplaceItemWithNewLambdaBase Step E) Copying props " + old_item +
" --> " + new_item);
206 hndDebugPrint(
"[inv] ReplaceItemWithNewLambdaBase Step G) CreateNetworkObjectInfo =" + new_item);
218 hndDebugPrint(
"[inv] ReplaceItemWithNewLambdaBase Step H) OnSuccess=" + new_item);
228 Print(
"Error [inv] ReplaceItemWithNewLambdaBase OnAbort");
234 hndDebugPrint(
"[syncinv] t=" + t +
" lambda.Execute start ");
248 fsm_to_notify.ProcessHandAbortEvent(
new HandEventHumanCommandActionAborted(fsm_to_notify.GetManOwner()));
269 fsm_to_notify.ProcessHandAbortEvent(
new HandEventHumanCommandActionAborted(fsm_to_notify.GetManOwner()));
287 Print(
"[syncinv] warning, lambda cannot be executed, skipping!");
289 fsm_to_notify.ProcessHandAbortEvent(
new HandEventHumanCommandActionAborted(fsm_to_notify.GetManOwner()));
295 hndDebugPrint(
"[syncinv] te=" + te +
" lambda.Execute end, exec time=" + dt);
const int ECE_OBJECT_SWAP
const int ECE_PLACE_ON_SURFACE
void hndDebugPrint(string s)
InventoryLocationType
types of Inventory Location
proto native void RemoteObjectTreeDelete(Object obj)
RemoteObjectDelete - deletes only remote object (unregisters from network). do not use if not sure wh...
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto native bool ConfigIsExisting(string path)
proto native void RemoteObjectTreeCreate(Object obj)
RemoteObjectCreate - postponed registration of network object (and creation of remote object)....
proto int GetTime()
returns mission time in milliseconds
script counterpart to engine's class Inventory
static proto native bool LocationAddEntity(notnull InventoryLocation inv_loc)
adds item to inventory location
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 LocationRemoveEntity(notnull InventoryLocation inv_loc)
removes item from inventory location
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....
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/....
HumanInventory... with FSM (synchronous, no anims)
proto native int GetType()
returns type of InventoryLocation
proto native vector GetPos()
returns position of item in world if type is Ground
proto native void SetGroundEx(EntityAI e, vector pos, float dir[4])
sets current inventory location type to Ground with transformation mat
proto native InventoryLocation CopyLocationFrom(notnull InventoryLocation rhs, bool copyFlip)
copies location to another location without m_item member
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
proto native EntityAI GetParent()
returns parent of current inventory location
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 void GetDir(out float dir[4])
returns direction of item in world if type is Ground
proto native int GetSlot()
returns slot id if current type is Attachment
static string DumpToStringNullSafe(InventoryLocation loc)
base class for transformation operations (creating one item from another)
protected void DeleteOldEntity()
Step F. - deletes physically old item.
void VerifyItemTypeBySlotType()
protected void UndoRemoveOldItemFromLocation()
void ReplaceItemWithNewLambdaBase(EntityAI old_item, string new_item_type)
protected bool CanExecuteLambda()
protected void RemoveNetworkObjectInfo()
Step C. - remove network part of the object @NOTE this operation does not delete the object,...
protected void CreateNetworkObjectInfo(EntityAI new_item)
Step G. - create NetworkObjectInfo for new item.
void Execute(HumanInventoryWithFSM fsm_to_notify=null)
protected void OnSuccess(EntityAI new_item)
Step H. - notification on finish.
protected bool PrepareLocations()
Step A. - prepare inventory locations.
private bool m_RemoveNetworkObjectInfoPassed
protected EntityAI CreateNewEntity()
Step D. - create new entity (LOCAL) with specified type.
void CopyOldPropertiesToNew(notnull EntityAI old_item, EntityAI new_item)
Step E. copy properties from old object to the created one.
void OverrideNewLocation(InventoryLocation newLocation)
protected bool m_RemoveFromLocationPassed
protected bool WantCreateNewEntity()
protected void UndoRemoveNetworkObjectInfo()
protected ref InventoryLocation m_NewLocation
protected void OnAbort()
Step Out - notification on abort.
protected ref InventoryLocation m_OldLocation
protected void RemoveOldItemFromLocation()
Step B. - free location for new item @NOTE this operation does not delete the object,...
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
static void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
static const string Empty