38 if (!
g_Game.IsDedicatedServer())
40 if (player.IsPlacingLocal())
42 Hologram hologram = player.GetHologramLocal();
58 if (
g_Game.IsDedicatedServer())
60 if (action_data.m_Player.IsPlacingServer())
62 if (
g_Game.IsMultiplayer())
63 action_data.m_Player.GetHologramServer().EvaluateCollision(action_data.m_MainItem);
65 if (!action_data.m_Player.GetHologramServer().IsColliding())
67 if (action_data.m_MainItem.CanBePlaced(action_data.m_Player, action_data.m_Player.GetHologramServer().GetProjectionEntity().GetPosition()))
79 if (super.SetupAction(player, target, item, action_data, extra_data))
85 poActionData.m_AlreadyPlaced =
false;
87 if (!
g_Game.IsDedicatedServer())
89 Hologram hologram = player.GetHologramLocal();
97 poActionData.m_Player.SetLocalProjectionPosition(poActionData.m_Position);
98 poActionData.m_Player.SetLocalProjectionOrientation(poActionData.m_Orientation);
106 if (!poActionData.m_MainItem)
121 if (
g_Game.IsMultiplayer())
122 poActionData.m_Player.PlacingCompleteLocal();
127 super.OnStartServer(action_data);
133 if (
g_Game.IsMultiplayer())
135 poActionData.m_Player.SetLocalProjectionPosition(poActionData.m_Position);
136 poActionData.m_Player.SetLocalProjectionOrientation(poActionData.m_Orientation);
139 if (poActionData.m_MainItem)
141 poActionData.m_Player.PlacingStartServer(poActionData.m_MainItem);
142 poActionData.m_MainItem.SetIsBeingPlaced(
true);
145 if (poActionData.m_MainItem.GetPlaceSoundset() !=
string.Empty)
146 poActionData.m_MainItem.StartItemSoundServer(SoundConstants.ITEM_PLACE);
148 if (poActionData.m_MainItem.GetLoopDeploySoundset() !=
string.Empty)
149 poActionData.m_MainItem.StartItemSoundServer(SoundConstants.ITEM_DEPLOY_LOOP);
158 EntityAI entity_for_placing = poActionData.m_MainItem;
159 vector position = poActionData.m_Player.GetLocalProjectionPosition();
160 vector orientation = poActionData.m_Player.GetLocalProjectionOrientation();
162 poActionData.m_AlreadyPlaced =
true;
164 entity_for_placing.OnPlacementComplete(poActionData.m_Player, position, orientation);
169 super.OnFinishProgressServer(action_data);
171 if (action_data.m_MainItem.GetDeploySoundset() !=
string.Empty)
172 action_data.m_MainItem.StartItemSoundServer(SoundConstants.ITEM_DEPLOY);
173 if (action_data.m_MainItem.GetLoopDeploySoundset() !=
string.Empty)
174 action_data.m_MainItem.StopItemSoundServer(SoundConstants.ITEM_DEPLOY_LOOP);
176 if (!
g_Game.IsMultiplayer())
177 action_data.m_Player.PlacingCompleteLocal();
182 super.OnEndClient(action_data);
188 if (!poActionData.m_AlreadyPlaced)
190 poActionData.m_Player.PlacingCancelLocal();
193 poActionData.m_Player.GetActionManager().RequestEndAction();
194 if (poActionData.m_Player.GetHologramLocal())
195 poActionData.m_Player.GetHologramLocal().SetUpdatePosition(
true);
198 if (poActionData.m_MainItem.GetInventory().GetCurrentInventoryLocation(source) && source.GetType() ==
InventoryLocationType.GROUND)
200 poActionData.m_Player.PredictiveTakeEntityToHands(poActionData.m_MainItem);
207 super.OnEndServer(action_data);
210 if (!poActionData || !poActionData.m_MainItem)
213 if (!poActionData.m_AlreadyPlaced)
215 poActionData.m_MainItem.SetIsBeingPlaced(
false);
217 if (
g_Game.IsMultiplayer())
219 poActionData.m_Player.PlacingCancelServer();
224 poActionData.m_Player.PlacingCancelLocal();
225 poActionData.m_Player.PlacingCancelServer();
230 if (poActionData.m_MainItem.IsBasebuildingKit())
232 poActionData.m_MainItem.Delete();
236 if (poActionData.m_MainItem.GetLoopDeploySoundset() !=
string.Empty)
237 poActionData.m_MainItem.StopItemSoundServer(SoundConstants.ITEM_DEPLOY_LOOP);
245 if (!
g_Game.IsDedicatedServer())
248 ClearInventoryReservationEx(action_data);
257 super.WriteToContext(ctx, action_data);
263 ctx.Write(poActionData.m_Position);
264 ctx.Write(poActionData.m_Orientation);
269 if (!action_recive_data)
272 super.ReadFromContext(ctx, action_recive_data);
275 vector entity_position =
"0 0 0";
276 vector entity_orientation =
"0 0 0";
277 if (!ctx.Read(entity_position))
279 if (!ctx.Read(entity_orientation))
282 recive_data_po.m_Position = entity_position;
283 recive_data_po.m_Orientation = entity_orientation;
290 super.HandleReciveData(action_recive_data, action_data);
295 action_data_po.m_Position = recive_data_po.m_Position;
296 action_data_po.m_Orientation = recive_data_po.m_Orientation;
301 Debug.Log(
string.Format(
"HandleReciveData | received pos: %1", action_data_po.m_Position),
"hologramLogs");
310 if (item.IsHeavyBehaviour())
314 else if (item.IsOneHandedBehaviour())
318 else if (item.IsTwoHandedBehaviour())
324 Debug.Log(
"Error: check " + item +
" behaviour");
329 if (item.IsHeavyBehaviour())
333 else if (item.IsOneHandedBehaviour())
337 else if (item.IsTwoHandedBehaviour())
343 Debug.Log(
"Error: check " + item +
" behaviour");
override void OnFinishProgressServer(ActionData action_data)
override void OnStartAnimationLoop(ActionData action_data)
override bool HasProgress()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnStartServer(ActionData action_data)
override void OnEndServer(ActionData action_data)
override bool ActionConditionContinue(ActionData action_data)
override void OnFinishProgressClient(ActionData action_data)
override void HandleReciveData(ActionReciveData action_recive_data, ActionData action_data)
override bool HasAlternativeInterrupt()
override bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
void DropDuringPlacing()
DEPRECATED.
PlaceObjectActionReciveData ActionReciveData ActionDeployObject()
override bool CanBeUsedWithBrokenLegs()
override bool IsDeploymentAction()
void SetupAnimation(ItemBase item)
override bool ActionUsesHologram()
override void OnStartClient(ActionData action_data)
override void OnEndClient(ActionData action_data)
void SetUpdatePosition(bool state)
vector GetProjectionOrientation()
EntityAI GetProjectionEntity()
vector GetProjectionPosition()
override bool CanBePlaced(Man player, vector position)
override bool IsDeployable()
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
DayZPlayerConstants
defined in C++
Serializer ParamsReadContext
Serializer ParamsWriteContext
proto native bool IsCLIParam(string param)
Returns if command line argument is present.
void ReadFromContext(ParamsReadContext ctx)
void WriteToContext(ParamsWriteContext ctx)
InventoryLocationType
types of Inventory Location