DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
TentBase.c
Go to the documentation of this file.
1class TentBase extends ItemBase
2{
3 const int OPENING_0 = 1;
4 const int OPENING_1 = 2;
5 const int OPENING_2 = 4;
6 const int OPENING_3 = 8;
7 const int OPENING_4 = 16;
8 const int OPENING_5 = 32;
9 const int OPENING_6 = 64;
10 const int OPENING_7 = 128;
11 const int OPENING_8 = 256;
12 const int OPENING_9 = 512;
13 const int OPENING_10 = 1024;
14 const int OPENING_11 = 2048;
15 const int OPENING_12 = 4096;
16 const int OPENING_13 = 8192;
17 const int OPENING_14 = 16384;
18 const int OPENING_15 = 32768;
19
20 static const int PACKED = 0;
21 static const int PITCHED = 1;
22 const float MAX_PLACEMENT_HEIGHT_DIFF = 1.5;
23
24 protected int m_State;
25 protected int m_StateLocal = -1;
26 protected bool m_IsEntrance;
27 protected bool m_IsWindow;
28 protected bool m_IsToggle;
29 protected bool m_IsBeingPacked = false;
30 protected int m_OpeningMask = 0;
31 protected int m_OpeningMaskLocal = -1;
32
37 ref protected EffectSound m_DeployLoopSound;
38 protected CamoNet m_CamoNet;
39 protected vector m_HalfExtents; // The Y value contains a heightoffset and not the halfextent !!!
40
41 void TentBase()
42 {
43 m_ToggleAnimations = new map<ref ToggleAnimations, bool>;
44 m_ShowAnimationsWhenPitched = new array<string>;
45 m_ShowAnimationsWhenPacked = new array<string>;
46
48 RegisterNetSyncVariableInt("m_State");
49 RegisterNetSyncVariableBool("m_IsSoundSynchRemote");
50 RegisterNetSyncVariableBool("m_IsEntrance");
51 RegisterNetSyncVariableBool("m_IsWindow");
52 RegisterNetSyncVariableBool("m_IsToggle");
53 RegisterNetSyncVariableBool("m_IsDeploySound");
54 RegisterNetSyncVariableInt("m_OpeningMask");
55 RegisterNetSyncVariableBool("m_IsBeingPacked");
56
57 ProcessInvulnerabilityCheck(GetInvulnerabilityTypeString());
58 }
59
60 void ~TentBase()
61 {
62 if (GetGame())
63 {
64 DestroyClutterCutter();
65 }
66
68 }
69
71 {
72 return "disableContainerDamage";
73 }
74
75 override bool HasProxyParts()
76 {
77 return true;
78 }
79
80 override bool IsItemTent()
81 {
82 return true;
83 }
84
86 {
87 return false;
88 }
89
90 override int GetMeleeTargetType()
91 {
92 return EMeleeTargetType.NONALIGNABLE;
93 }
94
96 {
97 super.OnStoreSave(ctx);
98
99 ctx.Write(m_State);
100 ctx.Write(m_OpeningMask);
101 }
102
103 override bool OnStoreLoad(ParamsReadContext ctx, int version)
104 {
105 if (!super.OnStoreLoad(ctx, version))
106 return false;
107
108 ctx.Read(m_State);
109 if (version >= 110)
110 {
111 if (!ctx.Read(m_OpeningMask))
112 Print("ERROR: no opening mask found! Default openinng settings initialized.");
113 }
114
115 if (m_State == PITCHED)
116 {
117 TryPitch(true);
118
119 if (GetGame().IsServer())
120 {
122 {
124 m_ClutterCutter.SetOrientation(GetOrientation());
125 }
126
127 RefreshAttachements();
128 }
129 }
130 else
131 {
132 Pack(true);
133 }
134
135 return true;
136 }
137
138 override void RefreshPhysics()
139 {
140 super.RefreshPhysics();
141
142 if (m_State == PITCHED)
143 {
144 TryPitch(false, true);
145 }
146 else
147 {
148 Pack(false, true);
149 }
150 }
151
152 override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
153 {
154 super.OnItemLocationChanged(old_owner, new_owner);
155
156 if (new_owner || old_owner)
157 {
158 if (GetInventory().CountInventory() == 1) // refuse to pack tent with anything inside
159 Pack(false);
160 }
161 }
162
164 {
165 super.OnVariablesSynchronized();
166
167 if (IsDeploySound())
168 {
170 }
171 else
172 {
173 if (m_State == PITCHED)
174 {
175 if (IsManipulatedEntrance() && IsSoundSynchRemote())
176 {
177 if (m_IsToggle)
178 {
179 SoundTentOpenPlay();
180 }
181 else
182 {
183 SoundTentClosePlay();
184 }
185 }
186 else if (IsManipulatedWindow() && IsSoundSynchRemote())
187 {
188 if (m_IsToggle)
189 {
190 SoundTentOpenWindowPlay();
191 }
192 else
193 {
194 SoundTentCloseWindowPlay();
195 }
196 }
197 }
198 }
199
201 {
203 }
204
206 {
208 }
209
210 if (m_State != m_StateLocal)
211 {
212 if (m_State == PACKED)
213 Pack(false);
214 else
215 TryPitch(false);
216
217 m_StateLocal = m_State;
218 }
219
220 if ((m_OpeningMaskLocal != m_OpeningMask)) //opening synchronization for physics recalculation
221 {
222 HandleOpeningsPhysics();
223 m_OpeningMaskLocal = m_OpeningMask;
224
225 if (m_State == PACKED)
226 {
227 Pack(false); //intentional
228 }
229 }
230 }
231
232 override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
233 {
234 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
235
237 return;
238
239 if (zone == "" && GetState() == PITCHED && newLevel == GameConstants.STATE_RUINED && GetGame().IsServer())
240 MiscGameplayFunctions.DropAllItemsInInventoryInBounds(this, m_HalfExtents);
241
242 if (zone != "Body" && zone != "Inventory" && zone != "")
243 {
244 if (newLevel == GameConstants.STATE_RUINED)
245 {
246 array<string> selections = new array<string>;
247 DamageSystem.GetComponentNamesFromDamageZone(this,zone,selections);
248 for (int j = 0; j < selections.Count(); j++)
249 {
250 if (selections.Get(j) != "")
251 {
252 RemoveProxyPhysics(selections.Get(j)); //To keep
253 //HideSelection(selections.Get(j)); //To change
254 AnimateCamonetByOpeningSelection(selections.Get(j)); //To keep
255 }
256 }
257 }
258 else if (oldLevel == GameConstants.STATE_RUINED)
259 {
260 if (GetState() == PITCHED)
261 {
262 TryPitch(true);
263 }
264 }
265 }
266 }
267
268 void HideAllAnimationsAndProxyPhysics(bool hide_animations = true, bool hide_physics = true)
269 {
270 string cfg_path = "cfgVehicles " + GetType() + " AnimationSources";
271
272 if (GetGame().ConfigIsExisting(cfg_path))
273 {
274 int selections = GetGame().ConfigGetChildrenCount(cfg_path);
275 string proxy_selection_name;
276
277 for (int i = 0; i < selections; i++)
278 {
279 string selection_name;
280 GetGame().ConfigGetChildName(cfg_path, i, selection_name);
281 if (hide_animations)
282 {
283 SetAnimationPhase(selection_name, 1);
284 }
285
286 proxy_selection_name = selection_name;
287 proxy_selection_name.ToLower();
288 if (hide_physics)
289 {
290 RemoveProxyPhysics(proxy_selection_name);
291 }
292 }
293 }
294 }
295
297 {
298 return CanBeManipulated();
299 }
300
301 override bool CanPutIntoHands(EntityAI parent)
302 {
303 if (!super.CanPutIntoHands(parent))
304 {
305 return false;
306 }
307
308 return CanBeManipulated();
309 }
310
311 override bool CanPutInCargo(EntityAI parent)
312 {
313 if (!super.CanPutInCargo(parent))
314 {
315 return false;
316 }
317
318 return CanBeManipulated();
319 }
320
322 {
323 return CanBeManipulated();
324 }
325
327 {
328 return true;
329 }
330
332 {
333 int slot_id_camo;
334 int slot_id_xlights;
335 EntityAI eai_xlights;
336
337 slot_id_camo = InventorySlots.GetSlotIdFromString("CamoNet");
338 m_CamoNet = CamoNet.Cast(GetInventory().FindAttachment(slot_id_camo));
339
340 slot_id_xlights = InventorySlots.GetSlotIdFromString("Lights");
341 eai_xlights = GetInventory().FindAttachment(slot_id_xlights);
342
343 if (m_CamoNet)
344 {
346 //SetAnimationPhase("Camonet", 0);
347
348 if (!IsKindOf ("MediumTent"))
349 {
350 AddProxyPhysics("camonet");
351 }
352 }
353
354 if (eai_xlights)
355 {
356 SetAnimationPhase("Xlights", 0);
357 SetAnimationPhase("Xlights_glass_r", 0);
358 SetAnimationPhase("Xlights_glass_g", 0);
359 SetAnimationPhase("Xlights_glass_b", 0);
360 SetAnimationPhase("Xlights_glass_y", 0);
361 }
362 }
363
364 override void EEItemAttached(EntityAI item, string slot_name)
365 {
366 super.EEItemAttached(item, slot_name);
367
368 if (item.IsKindOf ("CamoNet"))
369 {
370 m_CamoNet = CamoNet.Cast(item);
372 //SetAnimationPhase("Camonet", 0);
373
374 if (!IsKindOf ("MediumTent"))
375 {
376 AddProxyPhysics("camonet");
377 }
378 }
379
380 if (item.IsKindOf ("XmasLights"))
381 {
382 SetAnimationPhase("Xlights", 0);
383 SetAnimationPhase("Xlights_glass_r", 0);
384 SetAnimationPhase("Xlights_glass_g", 0);
385 SetAnimationPhase("Xlights_glass_b", 0);
386 SetAnimationPhase("Xlights_glass_y", 0);
387
388 XmasLights xlights = XmasLights.Cast(item);
389 xlights.AttachToObject(this);
390 }
391 }
392
393 override void EEItemDetached(EntityAI item, string slot_name)
394 {
395 super.EEItemDetached(item, slot_name);
396
397 if (item.IsKindOf ("CamoNet"))
398 {
399 m_CamoNet = null;
401 //SetAnimationPhase("Camonet", 1);
402
403 if (!IsKindOf ("MediumTent"))
404 {
405 RemoveProxyPhysics("camonet");
406 }
407 }
408
409 if (item.IsKindOf ("XmasLights"))
410 {
411 SetAnimationPhase("Xlights", 1);
412 SetAnimationPhase("Xlights_glass_r", 1);
413 SetAnimationPhase("Xlights_glass_g", 1);
414 SetAnimationPhase("Xlights_glass_b", 1);
415 SetAnimationPhase("Xlights_glass_y", 1);
416
417 XmasLights xlights = XmasLights.Cast(item);
418 xlights.DetachFromObject(this);
419 }
420 }
421
422 override int GetViewIndex()
423 {
424 if (MemoryPointExists("invView2"))
425 {
427 GetInventory().GetCurrentInventoryLocation(il);
428 InventoryLocationType type = il.GetType();
429
430 if (GetState() == PACKED)
431 {
432 switch (type)
433 {
434 case InventoryLocationType.CARGO:
435 {
436 return 0;
437 }
438 case InventoryLocationType.ATTACHMENT:
439 {
440 return 1;
441 }
442 case InventoryLocationType.HANDS:
443 {
444 return 0;
445 }
446 case InventoryLocationType.GROUND:
447 {
448 return 0;
449 }
450 case InventoryLocationType.PROXYCARGO:
451 {
452 return 0;
453 }
454 default:
455 {
456 return 0;
457 }
458 }
459 }
460 else
461 {
462 switch (type)
463 {
464 case InventoryLocationType.CARGO:
465 {
466 return 0;
467 }
468 case InventoryLocationType.ATTACHMENT:
469 {
470 return 1;
471 }
472 case InventoryLocationType.HANDS:
473 {
474 return 0;
475 }
476 case InventoryLocationType.GROUND:
477 {
478 return 1;
479 }
480 case InventoryLocationType.PROXYCARGO:
481 {
482 return 0;
483 }
484 default:
485 {
486 return 0;
487 }
488 }
489 }
490 }
491 return 0;
492 }
493
495 {
496 return m_State;
497 }
498
500 {
501 return m_StateLocal;
502 }
503
505 {
506 if (GetState() == PITCHED)
507 {
508 if (GetInventory().GetCargo().GetItemCount() == 0 && GetInventory().AttachmentCount() == 0)
509 {
510 return true;
511 }
512 }
513
514 return false;
515 }
516
518 {
519 if (GetState() == PACKED)
520 {
521 return true;
522 }
523 else
524 {
525 return false;
526 }
527 }
528
530 {
531 if (item.IsKindOf ("CamoNet") && GetState() == PITCHED)
532 {
533 return true;
534 }
535
536 return false;
537 }
538
540 {
541 return false;
542 }
543
544 void Pack(bool update_navmesh, bool init = false)
545 {
546 HideAllAnimationsAndProxyPhysics();
547
548 m_State = PACKED;
549 m_IsEntrance = PACKED;
550 m_IsWindow = PACKED;
551 m_IsToggle = PACKED;
552
553 Refresh();
554
555 GetInventory().LockInventory(HIDE_INV_FROM_SCRIPT);
556
557 if (update_navmesh)
558 {
559 RegenerateNavmesh();
560 }
561
562 DestroyClutterCutter();
563
564 if (GetGame().IsServer() && !IsHologram())
565 MiscGameplayFunctions.DropAllItemsInInventoryInBounds(this, m_HalfExtents);
566
567 SetSynchDirty();
568
569 if ((!GetGame().IsDedicatedServer()) && !init)
570 {
571 GetOnViewIndexChanged().Invoke();
572 }
573 }
574
575 void Pitch(bool update_navmesh, bool init = false)
576 {
577 HideAllAnimationsAndProxyPhysics();
578
579 m_State = PITCHED;
580 m_IsEntrance = PITCHED;
581 m_IsWindow = PITCHED;
582 m_IsToggle = PITCHED;
583
584 Refresh();
585
586 GetInventory().UnlockInventory(HIDE_INV_FROM_SCRIPT);
587
588 if (update_navmesh)
589 {
590 RegenerateNavmesh();
591 }
592
593 SetSynchDirty();
594
595 if ((!GetGame().IsDedicatedServer()) && !init)
596 {
597 GetOnViewIndexChanged().Invoke();
598 }
599 }
600
601 protected void TryPitch(bool update_navmesh, bool init = false)
602 {
603 if (GetHierarchyRootPlayer())
604 {
605 if (GetGame().IsDedicatedServer())
606 {
607 Pack(update_navmesh,init);
608 }
609
610 return;
611 }
612
613 Pitch(update_navmesh,init);
614 }
615
617 {
618 string proxy_selection_name;
619 string animation_name;
620
621 if (GetState() == PITCHED)
622 {
623 for (int i = 0; i < m_ShowAnimationsWhenPitched.Count(); i++)
624 {
625 animation_name = m_ShowAnimationsWhenPitched.Get(i);
626
627 SetAnimationPhase(animation_name, 0);
628 }
629
630 HandleOpeningsVisuals();
631 }
632 else
633 {
634 for (int j = 0; j < m_ShowAnimationsWhenPacked.Count(); j++)
635 {
636 animation_name = m_ShowAnimationsWhenPacked.Get(j);
637
638 SetAnimationPhase(animation_name, 0);
639 }
640 }
641 }
642
644 {
645 string proxy_selection_name;
646 string animation_name;
647
648 if (GetState() == PITCHED)
649 {
650 for (int i = 0; i < m_ShowAnimationsWhenPitched.Count(); i++)
651 {
652 animation_name = m_ShowAnimationsWhenPitched.Get(i);
653
654 proxy_selection_name = animation_name;
655 proxy_selection_name.ToLower();
656 AddProxyPhysics(proxy_selection_name);
657 }
658
659 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Call(HandleOpeningsPhysics);
660 }
661 else
662 {
663 for (int j = 0; j < m_ShowAnimationsWhenPacked.Count(); j++)
664 {
665 animation_name = m_ShowAnimationsWhenPacked.Get(j);
666
667 proxy_selection_name = animation_name;
668 proxy_selection_name.ToLower();
669 AddProxyPhysics(proxy_selection_name);
670 }
671 }
672 }
673
674 //refresh visual/physics state
675 void Refresh()
676 {
679 }
680
681 bool CanToggleAnimations(string selection)
682 {
683 for (int i = 0; i < m_ToggleAnimations.Count(); i++)
684 {
685 ToggleAnimations toggle = m_ToggleAnimations.GetKey(i);
686 string toggle_off = toggle.GetToggleOff();
687 toggle_off.ToLower();
688 string toggle_on = toggle.GetToggleOn();
689 toggle_on.ToLower();
690
691 if (toggle_off == selection || toggle_on == selection)
692 {
693 string zone;
694 DamageSystem.GetDamageZoneFromComponentName(this,selection,zone);
695 return GetHealthLevel(zone) < GameConstants.STATE_RUINED;
696 }
697 }
698
699 return false;
700 }
701
703 {
704 m_IsEntrance = false;
705 m_IsWindow = false;
706 m_IsToggle = false;
707 }
708
710 {
711 m_IsEntrance = true;
712 }
713
715 {
716 m_IsWindow = true;
717 }
718
720 {
721 return m_IsEntrance;
722 }
723
725 {
726 return m_IsWindow;
727 }
728
729 //used by user action
730 void ToggleAnimation(string selection)
731 {
732 if (m_State == PACKED)
733 {
734 return;
735 }
736
737 bool is_closed;
738 ResetToggle();
739
740 for (int i = 0; i < m_ToggleAnimations.Count(); i++)
741 {
742 ToggleAnimations toggle = m_ToggleAnimations.GetKey(i);
743
744 string toggle_off = toggle.GetToggleOff();
745 toggle_off.ToLower();
746 string toggle_on = toggle.GetToggleOn();
747 toggle_on.ToLower();
748
749 if (toggle_off == selection || toggle_on == selection)
750 {
751 is_closed = m_OpeningMask & toggle.GetOpeningBit();
752 if (is_closed)
753 {
754 SetAnimationPhase(toggle.GetToggleOff(), 0);
755 AddProxyPhysics(toggle.GetToggleOff());
756 SetAnimationPhase(toggle.GetToggleOn(), 1);
757 RemoveProxyPhysics(toggle.GetToggleOn());
758 m_ToggleAnimations.Set(toggle, false);
759 m_IsToggle = true;
760 m_OpeningMask &= ~toggle.GetOpeningBit();
761
762 if (selection.Contains("window"))
763 {
764 ManipulateWindow();
765 }
766
767 if (selection.Contains("entrance") || selection.Contains("door"))
768 {
769 ManipulateEntrance();
770 }
771
772 AnimateCamonetToggle(toggle);
773 }
774 else
775 {
776 SetAnimationPhase(toggle.GetToggleOff(), 1);
777 RemoveProxyPhysics(toggle.GetToggleOff());
778 SetAnimationPhase(toggle.GetToggleOn(), 0);
779 AddProxyPhysics(toggle.GetToggleOn());
780 m_ToggleAnimations.Set(toggle, true);
781 m_IsToggle = false;
782 m_OpeningMask |= toggle.GetOpeningBit();
783
784 if (selection.Contains("window"))
785 {
786 ManipulateWindow();
787 }
788
789 if (selection.Contains("entrance") || selection.Contains("door"))
790 {
791 ManipulateEntrance();
792 }
793
794 AnimateCamonetToggle(toggle);
795 }
796 }
797 }
798 SetSynchDirty();
800 }
801
803 {
804 SetAnimationPhase("CamoNet", hide);
805 }
806
808
809 void AnimateCamonetByOpeningSelection(string opening_selection) {};
810
811 string GetSoundOpen() {};
812
813 string GetSoundClose() {};
814
816
818
820 {
822 sound.SetAutodestroy(true);
823 }
824
826 {
828 sound.SetAutodestroy(true);
829 }
830
832 {
834 sound.SetAutodestroy(true);
835 }
836
838 {
840 sound.SetAutodestroy(true);
841 }
842
844 {
845 SetAffectPathgraph(true, false);
846
847 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, this);
848 }
849
851 string GetClutterCutter() {};
852
854 {
855 if (GetGame().IsMultiplayer() || GetGame().IsServer())
856 {
857 if (m_ClutterCutter)
858 {
860 }
861 }
862 }
863
864 //================================================================
865 // ADVANCED PLACEMENT
866 //================================================================
867
868 override bool IsDeployable()
869 {
870 return true;
871 }
872
873 override void OnPlacementComplete(Man player, vector position = "0 0 0", vector orientation = "0 0 0")
874 {
875 super.OnPlacementComplete(player, position, orientation);
876
877 if (GetGame().IsServer())
878 {
879 TryPitch(true);
880
881 SetIsDeploySound(true);
882 }
883 }
884
886 {
887 if (!GetGame().IsDedicatedServer())
888 {
890 {
892 }
893 }
894 }
895
897 {
898 if (!GetGame().IsDedicatedServer())
899 {
902 }
903 }
904
905 override void SetActions()
906 {
907 super.SetActions();
908
913 }
914
916 {
917 bool is_closed;
918 bool is_ruined;
919 string zone;
920 string component;
921 ToggleAnimations toggle;
922
923 for (int i = 0; i < m_ToggleAnimations.Count(); i++)
924 {
925 toggle = m_ToggleAnimations.GetKey(i);
926 is_closed = m_OpeningMask & toggle.GetOpeningBit();
927 component = toggle.GetToggleOff(); //either one works
928 component.ToLower();
929 DamageSystem.GetDamageZoneFromComponentName(this,component,zone);
930 //is_ruined = (GetHealthLevel(zone) == GameConstants.STATE_RUINED);
931
932 if (is_closed)
933 {
934 SetAnimationPhase(toggle.GetToggleOff(),1);
935 SetAnimationPhase(toggle.GetToggleOn(),is_ruined);
936 m_ToggleAnimations.Set(toggle, false);
937 }
938 else
939 {
940 SetAnimationPhase(toggle.GetToggleOn(),1);
941 SetAnimationPhase(toggle.GetToggleOff(),is_ruined);
942 m_ToggleAnimations.Set(toggle, true);
943 }
944 //AnimateCamonetToggle(toggle);
945 }
946 }
947
949 {
950 bool is_closed;
951 bool is_ruined;
952 int hplevel;
953 string zone;
954 string component;
955 ToggleAnimations toggle;
956
957 for (int i = 0; i < m_ToggleAnimations.Count(); i++)
958 {
959 toggle = m_ToggleAnimations.GetKey(i);
960 is_closed = m_OpeningMask & toggle.GetOpeningBit();
961 component = toggle.GetToggleOff(); //either one works
962 component.ToLower();
963 DamageSystem.GetDamageZoneFromComponentName(this,component,zone);
964 is_ruined = (GetHealthLevel(zone) == GameConstants.STATE_RUINED);
965
966 //re-adding physics to avoid proxy physics stacking
967 RemoveProxyPhysics(toggle.GetToggleOff());
968 RemoveProxyPhysics(toggle.GetToggleOn());
969
970 if (!is_ruined && GetState() == PITCHED)
971 {
972 if (is_closed)
973 {
974 AddProxyPhysics(toggle.GetToggleOn());
975 }
976 else
977 {
978 AddProxyPhysics(toggle.GetToggleOff());
979 }
980 }
981 }
982 }
983
985 {
986 return 110;
987 }
988
990 {
991 if (GetHealthLevel() == GameConstants.STATE_RUINED || m_IsBeingPacked)
992 return false;
993
994 return super.CanReceiveItemIntoCargo(item);
995 }
996
997 override bool CanLoadItemIntoCargo(EntityAI item)
998 {
999 if (!super.CanLoadItemIntoCargo(item))
1000 return false;
1001 if (GetHealthLevel() == GameConstants.STATE_RUINED)
1002 return false;
1003
1004 return true;
1005 }
1006
1007 override bool CanReceiveAttachment(EntityAI attachment, int slotId)
1008 {
1009 if (GetHealthLevel() == GameConstants.STATE_RUINED)
1010 return false;
1011
1012 return super.CanReceiveAttachment(attachment, slotId);
1013 }
1014
1015 override bool CanLoadAttachment(EntityAI attachment)
1016 {
1017 if (GetHealthLevel() == GameConstants.STATE_RUINED)
1018 return false;
1019
1020 return super.CanLoadAttachment(attachment);
1021 }
1022
1023 override bool CanBePlaced(Man player, vector position)
1024 {
1025 vector playerpos = player.GetPosition();
1026 float delta1 = playerpos[1] - position[1];
1027
1028 if (delta1 > MAX_PLACEMENT_HEIGHT_DIFF || delta1 < -MAX_PLACEMENT_HEIGHT_DIFF)
1029 return false;
1030 return true;
1031 }
1032
1033 void SetIsBeingPacked(bool isBeingPacked)
1034 {
1035 m_IsBeingPacked = isBeingPacked;
1036 SetSynchDirty();
1037 }
1038};
eBleedingSourceType GetType()
PlaceObjectActionReciveData ActionReciveData ActionDeployObject()
ActionPackTentCB ActionContinuousBaseCB ActionPackTent()
void AddAction(typename actionName)
vector GetOrientation()
override string GetInvulnerabilityTypeString()
const int ECE_PLACE_ON_SURFACE
void UpdateVisuals()
void UpdatePhysics()
Container_Base m_HalfExtents
EMeleeTargetType
protected Object m_ClutterCutter
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override bool IsHologram()
Definition ItemBase.c:5556
void PlayDeploySound()
Definition ItemBase.c:8920
void SoundSynchRemote()
Definition ItemBase.c:8883
void SetIsDeploySound(bool is_deploy_sound)
Definition ItemBase.c:8910
bool IsDeploySound()
Definition ItemBase.c:8915
bool CanPlayDeployLoopSound()
Definition ItemBase.c:8947
bool m_FixDamageSystemInit
Definition ItemBase.c:4695
bool IsSoundSynchRemote()
Definition ItemBase.c:8890
enum MagnumStableStateID init
void Refresh()
protected float m_DrainThreshold protected bool m_State
protected ref EffectSound m_DeployLoopSound
Definition TrapBase.c:47
void PlayDeployLoopSound()
Definition TrapBase.c:651
void StopDeployLoopSound()
Definition TrapBase.c:661
class JsonUndergroundAreaTriggerData GetPosition
proto native void ObjectDelete(Object obj)
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
override ScriptCallQueue GetCallQueue(int call_category)
Definition DayZGame.c:1153
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
void SetSoundFadeOut(float fade_out)
Set the sound fade out duration.
void SoundStop()
Stops sound.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
InventoryLocation.
proto native int GetType()
returns type of InventoryLocation
provides access to slot configuration
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
void ManipulateWindow()
Definition TentBase.c:714
protected int m_State
Definition TentBase.c:24
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Definition TentBase.c:152
string GetSoundClose()
Definition TentBase.c:813
override void OnStoreSave(ParamsWriteContext ctx)
Definition TentBase.c:95
void AnimateCamonetByOpeningSelection(string opening_selection)
Definition TentBase.c:809
void HideAllAnimationsAndProxyPhysics(bool hide_animations=true, bool hide_physics=true)
Definition TentBase.c:268
override bool CanReceiveItemIntoCargo(EntityAI item)
Definition TentBase.c:989
protected Object m_ClutterCutter
Definition TentBase.c:36
override bool CanBeRepairedToPristine()
Definition TentBase.c:326
void HandleCamoNetAttachment(bool hide)
Definition TentBase.c:802
override bool CanLoadItemIntoCargo(EntityAI item)
Definition TentBase.c:997
int GetState()
Definition TentBase.c:494
void RefreshAttachements()
Definition TentBase.c:331
void SetIsBeingPacked(bool isBeingPacked)
Definition TentBase.c:1033
override int GetViewIndex()
Definition TentBase.c:422
bool CanBePacked()
Definition TentBase.c:504
protected ref array< string > m_ShowAnimationsWhenPitched
Definition TentBase.c:34
protected bool m_IsToggle
Definition TentBase.c:28
protected ref array< string > m_ShowAnimationsWhenPacked
Definition TentBase.c:35
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
Definition TentBase.c:232
void PlayDeployLoopSound()
Definition TentBase.c:885
void UpdateVisuals()
Definition TentBase.c:616
void StopDeployLoopSound()
Definition TentBase.c:896
void Pack(bool update_navmesh, bool init=false)
Definition TentBase.c:544
protected bool m_IsEntrance
Definition TentBase.c:26
void DestroyClutterCutter()
Definition TentBase.c:853
override void RefreshPhysics()
Definition TentBase.c:138
override bool CanPutInCargo(EntityAI parent)
Definition TentBase.c:311
string GetSoundOpen()
Definition TentBase.c:811
override bool CanBePlaced(Man player, vector position)
Definition TentBase.c:1023
protected void TryPitch(bool update_navmesh, bool init=false)
Definition TentBase.c:601
void SoundTentClosePlay()
Definition TentBase.c:825
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition TentBase.c:873
protected ref map< ref ToggleAnimations, bool > m_ToggleAnimations
Definition TentBase.c:33
override int GetMeleeTargetType()
Definition TentBase.c:90
string GetSoundOpenWindow()
Definition TentBase.c:815
string GetSoundCloseWindow()
Definition TentBase.c:817
bool HasClutterCutter()
Definition TentBase.c:850
void HandleOpeningsPhysics()
Definition TentBase.c:948
override void EEItemDetached(EntityAI item, string slot_name)
Definition TentBase.c:393
override int GetDamageSystemVersionChange()
Definition TentBase.c:984
protected CamoNet m_CamoNet
Definition TentBase.c:38
string GetClutterCutter()
Definition TentBase.c:851
void Pitch(bool update_navmesh, bool init=false)
Definition TentBase.c:575
int GetStateLocal()
Definition TentBase.c:499
void SoundTentOpenPlay()
Definition TentBase.c:819
override bool HasProxyParts()
Definition TentBase.c:75
override bool CanPutIntoHands(EntityAI parent)
Definition TentBase.c:301
override bool IsIgnoredByConstruction()
Definition TentBase.c:539
override bool IsItemTent()
Definition TentBase.c:80
void ~TentBase()
Definition TentBase.c:60
bool CanBeManipulated()
Definition TentBase.c:517
bool ConditionIntoInventory(EntityAI player)
Definition TentBase.c:296
bool IsManipulatedWindow()
Definition TentBase.c:724
override bool IsDeployable()
Definition TentBase.c:868
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Definition TentBase.c:103
void SoundTentCloseWindowPlay()
Definition TentBase.c:837
bool CanToggleAnimations(string selection)
Definition TentBase.c:681
protected vector m_HalfExtents
Definition TentBase.c:39
protected bool m_IsWindow
Definition TentBase.c:27
override void EEItemAttached(EntityAI item, string slot_name)
Definition TentBase.c:364
void UpdatePhysics()
Definition TentBase.c:643
void Refresh()
Definition TentBase.c:675
void SoundTentOpenWindowPlay()
Definition TentBase.c:831
bool IsManipulatedEntrance()
Definition TentBase.c:719
void RegenerateNavmesh()
Definition TentBase.c:843
override void OnVariablesSynchronized()
Definition TentBase.c:163
void HandleOpeningsVisuals()
Definition TentBase.c:915
bool CanAttach(ItemBase item)
Definition TentBase.c:529
void ToggleAnimation(string selection)
Definition TentBase.c:730
void TentBase()
Definition TentBase.c:41
bool ConditionOutOfHands(EntityAI player)
Definition TentBase.c:321
void AnimateCamonetToggle(ToggleAnimations toggle)
Definition TentBase.c:807
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition TentBase.c:1007
void ResetToggle()
Definition TentBase.c:702
override bool CanBeRepairedByCrafting()
Definition TentBase.c:85
void ManipulateEntrance()
Definition TentBase.c:709
override bool CanLoadAttachment(EntityAI attachment)
Definition TentBase.c:1015
override string GetInvulnerabilityTypeString()
Definition TentBase.c:70
override void SetActions()
Definition TentBase.c:905
Manager class for managing Effect (EffectParticle, EffectSound)
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto void Call(func fn, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
proto bool Write(void value_out)
proto bool Read(void value_in)
override void AnimateCamonetByOpeningSelection(string opening_selection)
Definition PartyTent.c:143
override bool HasClutterCutter()
Definition CarTent.c:36
override string GetLoopDeploySoundset()
Definition CarTent.c:55
override string GetSoundClose()
Definition CarTent.c:31
override string GetClutterCutter()
Definition MediumTent.c:41
override void HandleCamoNetAttachment(bool hide)
Definition PartyTent.c:86
override string GetSoundOpen()
Definition CarTent.c:26
override string GetSoundCloseWindow()
Definition PartyTent.c:41
override void AnimateCamonetToggle(ToggleAnimations toggle)
Definition PartyTent.c:129
override string GetSoundOpenWindow()
Definition PartyTent.c:36
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static const vector Zero
Definition EnConvert.c:110
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
const int STATE_RUINED
Definition constants.c:742
string Get(int index)
Gets n-th character from string.
Definition EnString.c:434
bool Contains(string sample)
Returns true if sample is substring of string.
Definition EnString.c:286
proto int ToLower()
Changes string to lowercase. Returns length.
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8
proto native int GetState()
returns one of STATE_...