12 m_ActionData.m_ActionComponent =
new CAContinuousTime(m_ActionData.m_MainItem.GetDeployTime());
76 if (!poActionData.m_MainItem)
81 EntityAI entity_for_placing = poActionData.m_MainItem;
88 if (poActionData.m_Player.GetHologramServer())
93 poActionData.m_Player.GetHologramServer().EvaluateCollision(poActionData.m_MainItem);
94 if (
g_Game.IsMultiplayer() && poActionData.m_Player.GetHologramServer().IsColliding())
97 poActionData.m_Player.GetHologramServer().PlaceEntity(entity_for_placing);
99 if (
g_Game.IsMultiplayer())
100 poActionData.m_Player.GetHologramServer().CheckPowerSource();
105 Debug.
Log(
string.Format(
"Hologram of %1 found, deployment successful.", poActionData.m_MainItem),
"hologramLogs");
106 Debug.
Log(
string.Format(
"Pos Comparison | player: %1 | hologram: %2 | action data: %3", poActionData.m_Player.GetPosition(),poActionData.m_Player.GetLocalProjectionPosition(),position),
"hologramLogs");
112 Debug.
Log(
string.Format(
"Expected hologram of %1 not found, failing deployment!", poActionData.m_MainItem),
Type().
ToString());
118 position = poActionData.m_Player.GetPosition();
119 orientation = poActionData.m_Player.GetOrientation();
120 position = position + (poActionData.m_Player.GetDirection() *
POSITION_OFFSET);
124 poActionData.m_MainItem.SetIsBeingPlaced(
false);
127 entity_for_placing.OnPlacementComplete(poActionData.m_Player, position, orientation);
128 poActionData.m_Player.PlacingCompleteServer();
135 super.OnItemLocationChanged(item);
137 if (!
g_Game.IsDedicatedServer())
146 super.OnUpdate(action_data);
150 if (item == action_data.m_MainItem)
153 item.GetInventory().GetCurrentInventoryLocation(loc);
164 bool accepted = super.AddActionJuncture(action_data);
166 EntityAI targetEntity = action_data.m_MainItem;
169 targetEntity.GetInventory().GetCurrentInventoryLocation(targetIl);
172 if (!
g_Game.AddActionJuncture(action_data.m_Player, targetEntity, 10000, action_data))
179 action_data.m_ReservedInventoryLocations.Insert(targetIl);
194 if (
g_Game.IsDedicatedServer())
196 player.LocalDropEntity(item);
198 player.SyncDeferredEventToRemotes();
202 player.LocalDropEntity(item);
208 if (action_data.m_MainItem.IsBasebuildingKit())
211 EntityAI entity_for_placing = action_data.m_MainItem;
212 vector rotation_matrix[3];
220 if (entity_for_placing.GetInventory().GetCurrentInventoryLocation(source))
222 destination.
SetGroundEx(entity_for_placing, position, direction);
224 if (
g_Game.IsMultiplayer())
225 action_data.m_Player.ServerTakeToDst(source, destination);
235 action_data.m_Player.GetInventory().TakeToDst(
InventoryMode.LOCAL, source, destination);
237 action_data.m_Player.GetDayZPlayerInventory().RedirectToHandEvent(
InventoryMode.LOCAL, source, destination);
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void DropDuringPlacing()
DEPRECATED.
ActionEat CreateActionComponent
bool InventoryReservation(ActionData action_data)
ref CCIBase m_ConditionItem
ref CCTBase m_ConditionTarget
void ClearActionJuncture(ActionData action_data)
void ActionContinuousBase()
override void OnFinishProgressServer(ActionData action_data)
void MoveEntityToFinalPositionSinglePlayer(ActionData action_data, InventoryLocation source, InventoryLocation destination)
const float POSITION_OFFSET
override void OnUpdate(ActionData action_data)
override bool AddActionJuncture(ActionData action_data)
override ActionData CreateActionData()
override bool HasProgress()
ref array< ItemBase > m_MovedItems
override void CreateConditionComponents()
void DropDuringPlacing(PlayerBase player)
void MoveEntityToFinalPosition(ActionData action_data, vector position, vector orientation)
override bool HasTarget()
override Vector2 GetCameraUDAngle()
override void OnItemLocationChanged(ItemBase item)
bool ActionUsesHologram()
Super root of all classes in Enforce script.
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
proto native int GetType()
returns type of InventoryLocation
proto native void SetGroundEx(EntityAI e, vector pos, float dir[4])
override bool IsBasebuildingKit()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto void MatrixToQuat(vector mat[3], out float d[4])
Converts rotation matrix to quaternion.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.
InventoryLocationType
types of Inventory Location