Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
object.c
Go to the documentation of this file.
2 {
7 }
8 
9 class ObjectSnapCallback
10 {
11  Object m_Owner;
14 
17 
19 
22 
26  void OnSetup()
27  {
28  }
29 
32  void OnDebug(vector p0, vector p1, bool hasHit, bool found)
33  {
34  }
35 
40  bool OnFirstContact(Object other)
41  {
42  return false;
43  }
44 
49  bool OnQuery(Object other)
50  {
51  return true;
52  }
53 
58  bool OnCollide(Object other)
59  {
60  return true;
61  }
62 };
63 
64 class Object extends IEntity
65 {
66  private void ~Object();
67  private void Object();
68 
69  bool CanBeSkinned()
70  {
71  return false;
72  }
73 
82  void Delete()
83  {
84  GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Call(GetGame().ObjectDelete, this);
85  }
86 
87  proto native void AddProxyPhysics(string proxySelectionName);
88 
89  proto native void RemoveProxyPhysics(string proxySelectionName);
90 
92  void OnEnterTrigger(ScriptedEntity trigger) {}
93 
95  void OnLeaveTrigger(ScriptedEntity trigger) {}
96 
98  proto native bool GetLODS(notnull out array<LOD> lods);
99 
101  proto native owned string GetLODName(LOD lod);
102 
103  proto native vector GetBoundingCenter();
104 
106  LOD GetLODByName( string name )
107  {
108  array<LOD> lods = new array<LOD>;
109  GetLODS( lods );
110 
111  for ( int i = 0; i < lods.Count(); ++i )
112  {
113  string lod_name = GetLODName( lods.Get( i ) );
114  lod_name.ToLower();
115  name.ToLower();
116  if ( lod_name == name )
117  {
118  return lods.Get( i );
119  }
120  }
121 
122  return NULL;
123  }
124 
126  TStringArray GetHiddenSelections()
127  {
128  return HiddenSelectionsData.GetHiddenSelectionsConfig(GetType());
129  }
130 
132  TStringArray GetHiddenSelectionsTextures()
133  {
134  return HiddenSelectionsData.GetHiddenSelectionsTexturesConfig(GetType());
135  }
136 
138  TStringArray GetHiddenSelectionsMaterials()
139  {
140  return HiddenSelectionsData.GetHiddenSelectionsMaterialsConfig(GetType());
141  }
142 
144  void Explode(int damageType, string ammoType = "")
145  {
146  if (ammoType == "")
147  ammoType = ConfigGetString("ammoType");
148 
149  if (ammoType == "")
150  ammoType = "Dummy_Heavy";
151 
152  if ( GetGame().IsServer() )
153  {
154  SynchExplosion();
155  DamageSystem.ExplosionDamage(EntityAI.Cast(this), null, ammoType, GetPosition(), damageType);
156  }
157  }
158 
159  void SynchExplosion()
160  {
161  if ( GetGame().IsDedicatedServer() ) // Multiplayer server
162  {
163  Param1<EntityAI> p = new Param1<EntityAI>(null);
164  GetGame().RPCSingleParam( this, ERPCs.RPC_EXPLODE_EVENT, p, true);
165  }
166  else if ( !GetGame().IsMultiplayer() ) // Singleplayer
167  {
168  OnExplodeClient();
169  }
170  }
171 
173  void OnExplodeClient()
174  {
175  string ammoType = ConfigGetString("ammoType");
176 
177  if (ammoType == "")
178  ammoType = "Dummy_Heavy";
179 
180  vector pos = GetPosition();
181 
182  // Handle spawn of particle if one is configured in config
183  AmmoEffects.PlayAmmoParticle(ammoType, pos);
184 
185  // Handle spawn of Effect if one is configured in config
186  AmmoEffects.PlayAmmoEffect(ammoType, pos);
187  }
188 
189  void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType) { }
190 
192  proto native owned string GetActionComponentName(int componentIndex, string geometry = "");
193 
195  proto native owned vector GetActionComponentPosition(int componentIndex, string geometry = "");
196 
198  proto native owned int GetActionComponentNameList(int componentIndex, TStringArray nameList, string geometry = "");
199 
201  proto native bool IsActionComponentPartOfSelection(int componentIndex, string selectionName, string geometry = "");
202 
204  proto void GetActionComponentsForSelectionName(int level, string selectionName, TIntArray componentIndices);
205 
207  proto vector GetActionComponentCenter(int level, int componentIndex);
208 
210  proto vector GetActionComponentCenterOOB(int level, int componentIndex);
211 
213  proto void GetActionComponentMinMax(int level, int componentIndex, out vector min, out vector max);
214 
216  proto native bool ToDelete();
217 
221  proto native bool IsPendingDeletion();
222 
224  proto native int GetGeometryLevel();
225  proto native int GetFireGeometryLevel();
226  proto native int GetViewGeometryLevel();
227  proto native int GetMemoryLevel();
228 
229 #ifdef DEVELOPER
230  proto bool ToBonePivot(out int pivot, int level, int bone);
232  proto bool FromBonePivot(int pivot, out int level, out int bone);
233 #endif
234 
236  proto int GetBonePivot(int level, int component);
237 
239  proto native void GetBonePivotsForAnimationSource(int level, string animationSource, out TIntArray pivots);
240 
242  proto native vector GetBonePositionLS(int pivot);
243  proto native vector GetBonePositionMS(int pivot);
244  proto native vector GetBonePositionWS(int pivot);
245 
247  proto native void GetBoneRotationLS(int pivot, out float quaternion[4]);
248  proto native void GetBoneRotationMS(int pivot, out float quaternion[4]);
249  proto native void GetBoneRotationWS(int pivot, out float quaternion[4]);
250 
252  proto native void GetBoneTransformLS(int pivot, out vector transform[4]);
253  proto native void GetBoneTransformMS(int pivot, out vector transform[4]);
254  proto native void GetBoneTransformWS(int pivot, out vector transform[4]);
255 
262  proto native void GetTightlyPackedCorners(ETransformationAxis axis, out vector corners[4]);
263 
264 #ifdef DIAG_DEVELOPER
265  void DebugDrawTightlyPackedCorners(ETransformationAxis axis, int color)
266  {
267 #ifndef SERVER
268  vector points[2];
269  vector corners[4];
270 
271  GetTightlyPackedCorners(axis, corners);
272 
273  points[0] = corners[0];
274  points[1] = corners[1];
275  Shape.CreateLines(color, ShapeFlags.TRANSP | ShapeFlags.ONCE | ShapeFlags.NOOUTLINE | ShapeFlags.NOZBUFFER, points, 2);
276 
277  points[0] = corners[1];
278  points[1] = corners[3];
279  Shape.CreateLines(color, ShapeFlags.TRANSP | ShapeFlags.ONCE | ShapeFlags.NOOUTLINE | ShapeFlags.NOZBUFFER, points, 2);
280 
281  points[0] = corners[3];
282  points[1] = corners[2];
283  Shape.CreateLines(color, ShapeFlags.TRANSP | ShapeFlags.ONCE | ShapeFlags.NOOUTLINE | ShapeFlags.NOZBUFFER, points, 2);
284 
285  points[0] = corners[2];
286  points[1] = corners[0];
287  Shape.CreateLines(color, ShapeFlags.TRANSP | ShapeFlags.ONCE | ShapeFlags.NOOUTLINE | ShapeFlags.NOZBUFFER, points, 2);
288 #endif
289  }
290 #endif
291 
293  proto native vector GetPosition();
294 
297  proto native vector GetWorldPosition();
298 
300  proto native void SetPosition(vector vPos);
301 
305  proto native void PlaceOnSurface();
306 
311  proto native vector GetOrientation();
312 
317  proto native void SetOrientation(vector vOrientation);
318 
320  proto native vector GetDirection();
321 
327  proto native void SetDirection(vector vPos);
328 
330  proto native vector GetDirectionUp();
331 
333  proto native vector GetDirectionAside();
334 
336  proto native vector GetLocalPos(vector vPos);
338  proto native vector GetGlobalPos(vector vPos);
339 
341  proto native vector GetSpeed();
342 
344  proto native vector GetModelSpeed();
345 
347  proto native bool CanAffectPathgraph();
348 
350  proto native void SetAffectPathgraph(bool fromConfig, bool affect);
351 
352 
364  proto float ClippingInfo(out vector minMax[2]);
365 
376  proto native bool GetCollisionBox(out vector minMax[2]);
377 
382  proto native float GetCollisionRadius();
383 
385  proto native float GetDamage();
386 
387 
388  proto native void GetSelectionList(out TStringArray selectionList);
389 
391  float GetSurfaceNoise()
392  {
393  vector position = GetPosition();
394  return GetGame().SurfaceGetNoiseMultiplier(NULL, position, -1);
395  }
396 
398  string GetSurfaceType()
399  {
400  string surface_type;
401  int liquid_type;
402 
403  GetGame().SurfaceUnderObject(this, surface_type,liquid_type);
404 // Print(surface_type);
405 // Print(liquid_type);
406 
407  return surface_type;
408  }
409 
411  bool HasSelection( string selection )
412  {
413  TStringArray selections = new TStringArray;
414  GetSelectionList( selections );
415 
416  for ( int i = 0; i < selections.Count(); ++i )
417  {
418  if ( selections.Get( i ) == selection )
419  {
420  return true;
421  }
422  }
423 
424  return false;
425  }
426 
428  bool HasAnimation( string anim_name )
429  {
430  string cfg_path_vehicles = "CfgVehicles " + GetType() + " ";
431  if ( GetGame().ConfigIsExisting (cfg_path_vehicles) && GetGame().ConfigIsExisting (cfg_path_vehicles + "AnimationSources " + anim_name) )
432  {
433  return true;
434  }
435 
436  string cfg_path_weapons = "CfgWeapons " + GetType() + " ";
437  if ( GetGame().ConfigIsExisting (cfg_path_weapons) && GetGame().ConfigIsExisting (cfg_path_weapons + "AnimationSources " + anim_name) )
438  {
439  return true;
440  }
441 
442  string cfg_path_magazines = "CfgMagazines " + GetType() + " ";
443  if ( GetGame().ConfigIsExisting (cfg_path_magazines) && GetGame().ConfigIsExisting (cfg_path_magazines + "AnimationSources " + anim_name) )
444  {
445  return true;
446  }
447 
448  return false;
449  }
450 
452  /*bool HasEnergyManager()
453  {
454  return false;
455  }*/
456 
457  proto native int GetMemoryPointIndex(string memoryPointName);
458  proto native vector GetMemoryPointPos(string memoryPointName);
459  proto native vector GetMemoryPointPosByIndex(int pointIndex);
460  proto native bool MemoryPointExists(string memoryPoint);
461 
462  proto native void CreateDynamicPhysics(int interactionLayers);
463  proto native void EnableDynamicCCD(bool state);
464  proto native void SetDynamicPhysicsLifeTime(float lifeTime);
465 
467  void OnTreeCutDown(EntityAI cutting_entity);
468 
470  string GetType()
471  {
472  string ret;
473  GetGame().ObjectGetType(this, ret);
474 
475  return ret;
476  }
477 
479  string GetDisplayName()
480  {
481  string tmp;
482  if (NameOverride(tmp))
483  {
484  tmp = Widget.TranslateString(tmp);
485  }
486  else
487  {
488  GetGame().ObjectGetDisplayName(this, tmp);
489  }
490  return tmp;
491  }
492 
493  //Used to specify this object will always display it's own name when attached to another object
494  bool DisplayNameRuinAttach()
495  {
496  return false;
497  }
498 
500  string GetModelName()
501  {
502  return GetGame().GetModelName(GetType());
503  }
504 
506  proto native owned string GetShapeName();
507 
508  int Release()
509  {
510  return GetGame().ObjectRelease(this);
511  }
512 
514  bool IsKindOf(string type)
515  {
516  return GetGame().ObjectIsKindOf(this, type);
517  }
518 
519  // Check alive state
520  bool IsAlive()
521  {
522  return !IsDamageDestroyed();
523  }
524 
526  bool IsMan()
527  {
528  return false;
529  }
530 
532  bool IsDayZCreature()
533  {
534  return false;
535  }
536 
538  bool IsEntityAI()
539  {
540  return false;
541  }
542 
544  bool IsStaticTransmitter()
545  {
546  return false;
547  }
548 
550  bool IsTransmitter()
551  {
552  return false;
553  }
554 
556  bool IsItemBase()
557  {
558  return false;
559  }
560 
561  //Returns true for protector cases and similar items. Usually can be nested in other cargo while full, unlike clothing..
562  bool IsContainer()
563  {
564  return false;
565  }
566 
568  bool IsMagazine()
569  {
570  return false;
571  }
572 
574  bool IsAmmoPile()
575  {
576  return false;
577  }
578 
580  bool IsInventoryItem()
581  {
582  return false;
583  }
584 
586  bool IsClothing()
587  {
588  return false;
589  }
590 
592  bool IsFireplace()
593  {
594  return false;
595  }
596 
598  bool IsTree()
599  {
600  return false;
601  }
602 
604  bool IsRock()
605  {
606  return false;
607  }
608 
610  bool IsWoodBase()
611  {
612  return false;
613  }
614 
616  bool IsBush()
617  {
618  return false;
619  }
620 
621  bool IsCuttable()
622  {
623  return false;
624  }
625 
627  bool IsPeltBase()
628  {
629  return false;
630  }
631 
633  bool IsWeapon()
634  {
635  return false;
636  }
637 
639  bool IsMeleeWeapon()
640  {
641  return false;
642  }
643 
645  bool IsBuilding()
646  {
647  return false;
648  }
649 
650  EWaterSourceObjectType GetWaterSourceObjectType()
651  {
652  return EWaterSourceObjectType.NONE;
653  }
654 
657  bool IsWell()
658  {
659  return false;
660  }
662  bool ShootsExplosiveAmmo()//placed on Object so that we can optimize early checks in DayZGame without casting
663  {
664  return false;
665  }
666 
668  bool IsFuelStation()
669  {
670  return false;
671  }
672 
674  bool IsTransport()
675  {
676  return false;
677  }
678 
680  bool IsElectricAppliance()
681  {
682  return false;
683  }
684 
686  bool CanUseConstruction()
687  {
688  return false;
689  }
690 
693  {
694  return false;
695  }
696 
698  bool CanUseHandConstruction()
699  {
700  return false;
701  }
702 
703  bool IsBeingBackstabbed()
704  {
705  return false;
706  }
707 
708  void SetBeingBackstabbed(int backstabType){}
709 
711  bool IsFood()
712  {
713  return ( IsFruit() || IsMeat() || IsCorpse() || IsMushroom() );
714  }
715 
716  bool IsFruit()
717  {
718  return false;
719  }
720 
721  bool IsMeat()
722  {
723  return false;
724  }
725 
726  bool IsCorpse()
727  {
728  return false;
729  }
730 
731  bool IsMushroom()
732  {
733  return false;
734  }
735 
737  bool IsHealthVisible()
738  {
739  return true;
740  }
741 
743  bool ShowZonesHealth()
744  {
745  return false;
746  }
747 
748  bool IsParticle()
749  {
750  return false;
751  }
752 
753  bool IsItemTent()
754  {
755  return false;
756  }
757 
758  bool IsScriptedLight()
759  {
760  return false;
761  }
762 
763  bool IsHologram()
764  {
765  return false;
766  }
767 
768  bool HasProxyParts()
769  {
770  return false;
771  }
772 
773  bool CanObstruct()
774  {
775  return IsPlainObject() && !IsScenery();
776  }
777 
778  bool CanProxyObstruct()
779  {
780  return HasProxyParts() || CanUseConstruction();
781  }
782 
784  bool CanProxyObstructSelf()
785  {
786  return false;
787  }
788 
789  bool CanBeIgnoredByDroppedItem()
790  {
791  return IsBush() || IsTree() || IsMan() || IsDayZCreature() || IsItemBase();
792  }
793 
794  bool CanBeAutoDeleted()
795  {
796  return true;
797  }
798 
800  bool DisableVicinityIcon()
801  {
802  return false;
803  }
804 
807  proto void GetNetworkID( out int lowBits, out int highBits );
808 
809  string GetNetworkIDString()
810  {
811  int low, high;
812  GetNetworkID( low, high );
813  return high.ToString() + low.ToString();
814  }
815 
816  override string GetDebugName()
817  {
818  return GetDebugNameNative();
819  }
820 
821  static string GetDebugName(Object o)
822  {
823  if (o)
824  return o.GetDebugName();
825  return "null";
826  }
827 
829  proto string GetDebugNameNative();
830 
832  void RPC(int rpc_type, array<ref Param> params, bool guaranteed, PlayerIdentity recipient = NULL)
833  {
834  GetGame().RPC(this, rpc_type, params, guaranteed, recipient);
835  }
836 
838  void RPCSingleParam(int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient = NULL)
839  {
840  GetGame().RPCSingleParam(this, rpc_type, param, guaranteed, recipient);
841  }
842 
848  void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx);
849 
850  vector GetSelectionPositionOld(string name)
851  {
852  return GetGame().ObjectGetSelectionPosition(this, name);
853  }
854 
855  vector GetSelectionPositionLS(string name)
856  {
857  return GetGame().ObjectGetSelectionPositionLS(this, name);
858  }
859 
860  vector GetSelectionPositionMS(string name)
861  {
862  return GetGame().ObjectGetSelectionPositionMS(this, name);
863  }
864 
865  vector GetSelectionPositionWS(string name)
866  {
867  return GetGame().ObjectGetSelectionPositionWS(this, name);
868  }
869 
870 
871  vector ModelToWorld(vector modelPos)
872  {
873  return GetGame().ObjectModelToWorld(this, modelPos);
874  }
875 
876  vector WorldToModel(vector worldPos)
877  {
878  return GetGame().ObjectWorldToModel(this, worldPos);
879  }
880 
881  // config class API
882 
883  proto string ConfigGetString(string entryName);
890  proto string ConfigGetStringRaw(string entryName);
891  proto int ConfigGetInt(string entryName);
892  bool ConfigGetBool(string entryName)
893  {
894  return (ConfigGetInt(entryName) == 1);
895  }
896 
897  proto float ConfigGetFloat(string entryName);
898  proto vector ConfigGetVector(string entryName);
899  //proto ParamEntry ConfigGetEntry(string entryName);
900 
906  proto native void ConfigGetTextArray(string entryName, out TStringArray values);
907 
914  proto native void ConfigGetTextArrayRaw(string entryName, out TStringArray values);
915 
921  proto native void ConfigGetFloatArray(string entryName, out TFloatArray values);
922 
928  proto native void ConfigGetIntArray(string entryName, out TIntArray values);
929 
934  proto native bool ConfigIsExisting(string entryName);
935 
937  bool KindOf( string tag )
938  {
939  bool found = false;
940  string item_name = this.GetType();
941  TStringArray item_tag_array = new TStringArray;
942  ConfigGetTextArray("cfgVehicles " + item_name + " itemInfo", item_tag_array);
943 
944  int array_size = item_tag_array.Count();
945  for (int i = 0; i < array_size; i++)
946  {
947  if ( item_tag_array.Get(i) == tag )
948  {
949  found = true;
950  break;
951  }
952  }
953  return found;
954  }
955 
956  bool IsAnyInherited( array<typename> typenames )
957  {
958  bool ret;
959  for( int i = 0; i < typenames.Count(); i++ )
960  {
961  ret = ret || this.IsInherited( typenames.Get(i) );
962  }
963  return ret;
964  }
965 
969  proto native bool IsPlainObject();
970 
974  proto native bool IsScenery();
975 
976  // Damage system
980  proto native bool HasDamageSystem();
981 
985  proto native bool IsDamageDestroyed();
986 
991  proto native void SetDestructTime(float time);
992 
998  proto native float GetHealth(string zoneName, string healthType);
999 
1005  proto native float GetHealth01(string zoneName, string healthType);
1006 
1012  proto native float GetMaxHealth(string zoneName, string healthType);
1013 
1019  proto native void SetHealth(string zoneName, string healthType, float value);
1020 
1024  proto native void SetFullHealth();
1025 
1031  proto native void AddHealth(string zoneName, string healthType, float value);
1032 
1038  proto native void DecreaseHealth(string zoneName, string healthType, float value);
1039 
1045  void DecreaseHealth(string zoneName, string healthType, float value, bool auto_delete)
1046  {
1047  DecreaseHealth( zoneName, healthType, value);
1048 
1049  float result_health = GetHealth(zoneName, healthType);
1050 
1051  if ( auto_delete && result_health <= 0 )
1052  {
1053  GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Call(GetGame().ObjectDelete, this);
1054  }
1055  }
1056 
1058  float GetHealth()
1059  {
1060  return GetHealth("", "");
1061  }
1063  float GetHealth01()
1064  {
1065  return GetHealth01("", "");
1066  }
1068  float GetMaxHealth()
1069  {
1070  return GetMaxHealth("", "");
1071  }
1073  void SetHealth(float health)
1074  {
1075  SetHealth("", "", health);
1076  }
1078  void SetGlobalHealth(float health)
1079  {
1080  SetHealth("", "", health);
1081  }
1083  void SetHealthLevel(int healthLevel, string zone = "")
1084  {
1085  SetHealth01(zone,"", GetHealthLevelValue(healthLevel, zone));
1086  }
1088  void AddHealthLevel(int healthLevelDelta, string zone = "")
1089  {
1090  int maxHealthLevel = GetNumberOfHealthLevels(zone) - 1;
1091  int newHealthLevel = Math.Clamp(GetHealthLevel(zone) + healthLevelDelta,0,maxHealthLevel);
1092  SetHealthLevel(newHealthLevel,zone);
1093  }
1094 
1096  void SetHealth01(string zoneName, string healthType, float coef)
1097  {
1098  SetHealth(zoneName,healthType,(GetMaxHealth(zoneName,healthType)*coef));
1099  }
1101  void SetHealthMax(string zoneName = "", string healthType = "")
1102  {
1103  SetHealth(zoneName,healthType,GetMaxHealth(zoneName,healthType));
1104  }
1106  void AddHealth( float add_health)
1107  {
1108  AddHealth("", "", add_health);
1109  }
1111  void DecreaseHealth(float dec_health, bool auto_delete = true)
1112  {
1113  DecreaseHealth("", "", dec_health, auto_delete);
1114  }
1116  void DecreaseHealthCoef(float dec_health_coef, bool auto_delete = true)
1117  {
1118  float current_health = GetHealth();
1119  float final_health_coef = GetHealth01() - dec_health_coef;
1120  float final_health = GetMaxHealth() * final_health_coef;
1121  DecreaseHealth("", "", current_health - final_health);
1122  }
1123 
1134  proto native void ProcessDirectDamage(int damageType, EntityAI source, string componentName, string ammoName, vector modelPos, float damageCoef = 1.0, int flags = 0);
1135 
1140  bool EEOnDamageCalculated(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
1141  {
1142  return true;
1143  }
1144 
1149  proto native void GetDamageZones(out TStringArray dmgZones);
1150 
1155  proto native vector GetDamageZonePos(string zoneName);
1160  proto native owned string GetDamageZoneNameByComponentIndex(int componentIndex);
1161 
1167  proto native int GetHealthLevel(string zone = "");
1168 
1174  proto native int GetNumberOfHealthLevels(string zone = "");
1175 
1181  proto native float GetHealthLevelValue(int healthLevel, string zone = "");
1182 
1183 
1187  proto native bool GetAllowDamage();
1192  proto native void SetAllowDamage(bool val);
1193 
1197  proto native bool GetCanBeDestroyed();
1198 
1203  proto native void SetCanBeDestroyed(bool val);
1204 
1215  bool IsRuined()
1216  {
1217  return IsDamageDestroyed();
1218  }
1219 
1221  void OnSimulationEnabled() {}
1222 
1224  void OnSimulationDisabled() {}
1225 
1226  void GetActions(typename action_input_type, out array<ActionBase_Basic> actions)
1227  {
1228  }
1229 
1231  SoundOnVehicle PlaySound(string sound_name, float range, bool create_local = true)
1232  {
1233  return GetGame().CreateSoundOnObject(this, sound_name, range, false, create_local);
1234  }
1235 
1237  SoundOnVehicle PlaySoundLoop(string sound_name, float range, bool create_local = true)
1238  {
1239  return GetGame().CreateSoundOnObject(this, sound_name, range, true, create_local);
1240  }
1241 
1243  bool PlaySoundSet( out EffectSound sound, string sound_set, float fade_in, float fade_out, bool loop = false )
1244  {
1245  if ( GetGame() && !GetGame().IsDedicatedServer() )
1246  {
1247  if ( sound )
1248  {
1249  if ( loop )
1250  {
1251  return true;
1252  }
1253  else
1254  {
1255  StopSoundSet( sound ); //auto stop for non-looped sounds
1256  }
1257  }
1258 
1259  sound = SEffectManager.PlaySoundOnObject( sound_set, this, fade_in, fade_out, loop );
1260  sound.SetAutodestroy( true );
1261 
1262  return true;
1263  }
1264 
1265  return false;
1266  }
1267 
1269  bool PlaySoundSetLoop( out EffectSound sound, string sound_set, float fade_in, float fade_out )
1270  {
1271  return PlaySoundSet( sound, sound_set, fade_in, fade_out, true );
1272  }
1273 
1275  bool PlaySoundSetAtMemoryPointLoopedSafe(out EffectSound sound, string soundSet, string memoryPoint,float play_fade_in = 0, float stop_fade_out = 0)
1276  {
1277  if (sound && sound.IsPlaying())
1278  {
1279  sound.SoundStop();
1280  }
1281  return PlaySoundSetAtMemoryPointLooped(sound, soundSet, memoryPoint, play_fade_in, stop_fade_out);
1282  }
1283 
1284  bool PlaySoundSetAtMemoryPointLooped(out EffectSound sound, string soundSet, string memoryPoint, float play_fade_in = 0, float stop_fade_out = 0)
1285  {
1286  return PlaySoundSetAtMemoryPoint(sound, soundSet, memoryPoint, true, play_fade_in, stop_fade_out);
1287  }
1288 
1289 
1290  bool PlaySoundSetAtMemoryPoint(out EffectSound sound, string soundSet, string memoryPoint, bool looped = false, float play_fade_in = 0, float stop_fade_out = 0)
1291  {
1292  vector pos;
1293 
1294  if (MemoryPointExists(memoryPoint))
1295  {
1296  pos = GetMemoryPointPos(memoryPoint);
1297  pos = ModelToWorld(pos);
1298  }
1299  else
1300  {
1301  ErrorEx(string.Format("Memory point %1 not found when playing soundset %2 at memory point location", memoryPoint, soundSet));
1302  return false;
1303  }
1304 
1305  sound = SEffectManager.PlaySoundEnviroment(soundSet, pos, play_fade_in, stop_fade_out, looped);
1306  return true;
1307  }
1308 
1310  bool StopSoundSet( out EffectSound sound )
1311  {
1312  if ( sound && GetGame() && ( !GetGame().IsDedicatedServer() ) )
1313  {
1314  sound.SoundStop();
1315  sound = null;
1316 
1317  return true;
1318  }
1319 
1320  return false;
1321  }
1322 
1323  void PostAreaDamageActions();
1324  void PreAreaDamageActions();
1325 
1326  void SpawnDamageDealtEffect();
1327  void OnReceivedHit(ImpactEffectsData hitData);
1328 
1330  void OnPlayerRecievedHit();
1331 
1332  bool HasNetworkID()
1333  {
1334  int lo = 0;
1335  int hi = 0;
1336  GetNetworkID(lo, hi);
1337  return lo | hi;
1338  }
1339 
1340  bool NameOverride(out string output)
1341  {
1342  return false;
1343  }
1344 
1345  bool DescriptionOverride(out string output)
1346  {
1347  return false;
1348  }
1349 
1350  EntityAI ProcessMeleeItemDamage(int mode = 0) {}
1351 
1352  bool CanBeRepairedToPristine()
1353  {
1354  return false;
1355  }
1356 
1357  vector GetCenter()
1358  {
1359  if ( MemoryPointExists("ce_center") )
1360  {
1361  //Print("CE_CENTER found");
1362  return ModelToWorld( GetMemoryPointPos("ce_center") );
1363  }
1364  else
1365  {
1366  //Print("CE_CENTER DOING A BAMBOOZLE => not found");
1367  return GetPosition() + Vector(0, 0.2, 0);
1368  }
1369  }
1370 
1371  #ifdef DEVELOPER
1372  void SetDebugItem();
1373  #endif
1374 
1375  void AddArrow(Object arrow, int componentIndex, vector closeBonePosWS, vector closeBoneRotWS)
1376  {
1377  int pivot = GetBonePivot(GetFireGeometryLevel(), componentIndex);
1378  vector parentTransMat[4];
1379  vector arrowTransMat[4];
1380 
1381  if (pivot == -1)
1382  {
1383  GetTransform(parentTransMat);
1384  }
1385  else
1386  {
1387  GetBoneTransformWS(pivot, parentTransMat);
1388  }
1389 
1390  float scale = GetScale();
1391  scale = 1 / (scale * scale);
1392 
1393  arrow.GetTransform(arrowTransMat);
1394  Math3D.MatrixInvMultiply4(parentTransMat, arrowTransMat, arrowTransMat);
1395 
1396  // orthogonalize matrix - parent might be skewed
1397  Math3D.MatrixOrthogonalize4(arrowTransMat);
1398 
1399  arrowTransMat[3] = arrowTransMat[3] * scale;
1400 
1401  arrow.SetTransform(arrowTransMat);
1402 
1403  AddChild(arrow, pivot);
1404  }
1405 
1406  bool CanBeActionTarget()
1407  {
1408  return !IsHologram();
1409  }
1410 
1412  {
1413  return false;
1414  }
1415 
1416  //Debug
1417  //----------------------------------------------
1418  /*void DbgAddPxyPhy(string slot)
1419  {
1420  Print("AddProxyPhysics slot: " + slot);
1421  AddProxyPhysics(slot);
1422  }*/
1423 };
GetGame
proto native CGame GetGame()
CALL_CATEGORY_SYSTEM
const int CALL_CATEGORY_SYSTEM
Definition: tools.c:8
Release
private void Release(vector pos)
Definition: easteregg.c:185
CanBeActionTarget
override bool CanBeActionTarget()
Definition: woodbase.c:246
Param
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition: param.c:11
IsFireplace
override bool IsFireplace()
Definition: fireplacebase.c:504
CanUseConstructionBuild
override bool CanUseConstructionBuild()
Definition: basebuildingbase.c:829
TStringArray
array< string > TStringArray
Definition: enscript.c:685
m_OwnerPosition
vector m_OwnerPosition
The owner performing the snap callback.
Definition: object.c:12
EWaterSourceObjectType
EWaterSourceObjectType
Definition: ewatersourceobjecttype.c:1
IsDamageDestroyed
protected bool IsDamageDestroyed(ActionTarget target)
Definition: actionbase.c:913
GetActions
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
Definition: advancedcommunication.c:68
HiddenSelectionsData
Definition: hiddenselectionsdata.c:1
OnSetup
void OnSetup()
The transformation currently being debugged.
Definition: object.c:26
IsMushroom
override bool IsMushroom()
Definition: edible_base.c:254
ETransformationAxis
ETransformationAxis
Definition: etransformationaxis.c:1
IsFruit
override bool IsFruit()
Definition: edible_base.c:249
ShowZonesHealth
override bool ShowZonesHealth()
Definition: basebuildingbase.c:916
OnCollide
bool OnCollide(Object other)
Ray cast line test from owner to a tested position.
Definition: object.c:58
Explode
override void Explode(int damageType, string ammoType="")
Definition: trap_landmine.c:220
component
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
LOD
LOD class.
Definition: gameplay.c:202
CanBeSkinned
override bool CanBeSkinned()
Definition: dayzanimal.c:60
m_Extents
vector m_Extents
The true center of the bounding box of the object to be dropped in model space.
Definition: object.c:16
m_Transform
vector m_Transform[4]
If 'OnDebug' is to be called.
Definition: object.c:21
GetSpeed
proto native vector GetSpeed()
IsTransport
protected bool IsTransport(ActionTarget target)
Definition: actionbase.c:923
ErrorEx
enum ShapeType ErrorEx
IEntity
Definition: enentity.c:164
ALL_TRANSFER
@ ALL_TRANSFER
Definition: object.c:3
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
OnRPC
void OnRPC(ParamsReadContext ctx)
Definition: displaystatus.c:216
ShootsExplosiveAmmo
override bool ShootsExplosiveAmmo()
Definition: ammunitionpiles.c:167
PlayerIdentity
The class that will be instanced (moddable)
Definition: gameplay.c:377
NO_ATTACHMENT_TRANSFER
@ NO_ATTACHMENT_TRANSFER
Do not transfer damage to attachments.
Definition: object.c:4
GetPosition
class JsonUndergroundAreaTriggerData GetPosition
Definition: undergroundarealoader.c:9
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition: effectsound.c:4
ScriptedEntity
Definition: triggercarrierbase.c:1
vector
Definition: enconvert.c:105
m_OwnerDirection
vector m_OwnerDirection
The position of the owner in world space.
Definition: object.c:13
OnQuery
bool OnQuery(Object other)
Initial query around the owner position to see if an object should be processed in contact testing.
Definition: object.c:49
IsParticle
bool IsParticle()
Check whether the Effect is EffectParticle without casting.
Definition: effect.c:134
IsWoodBase
override bool IsWoodBase()
Definition: woodbase.c:41
TotalDamageResult
Definition: damagesystem.c:1
OnDebug
void OnDebug(vector p0, vector p1, bool hasHit, bool found)
Debug callback for rendering on the screen.
Definition: object.c:32
ShapeFlags
ShapeFlags
Definition: endebug.c:125
Object
Definition: objecttyped.c:1
m_DebugEnabled
bool m_DebugEnabled
How much should the direction be favoured.
Definition: object.c:20
AddArrow
override void AddArrow(Object arrow, int componentIndex, vector closeBonePosWS, vector closeBoneRotWS)
Definition: dayzanimal.c:75
m_Owner
enum ProcessDirectDamageFlags m_Owner
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition: isboxcollidinggeometryproxyclasses.c:27
CanObstruct
override bool CanObstruct()
Definition: basebuildingbase.c:82
m_Offset
vector m_Offset
The direction of the owner in world space.
Definition: object.c:15
m_DirectionFunc
vector m_DirectionFunc
The size of the boundig box, centered.
Definition: object.c:18
NO_GLOBAL_TRANSFER
@ NO_GLOBAL_TRANSFER
Do not transfer damage to global.
Definition: object.c:5
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
IsMeat
override bool IsMeat()
Definition: edible_base.c:239
IsDayZCreature
override bool IsDayZCreature()
Definition: dayzanimal.c:55
AmmoEffects
Static data holder for certain ammo config values.
Definition: ammoeffects.c:5
SetPosition
proto native void SetPosition(vector position)
Set the world position of the Effect.
Definition: effect.c:436
GetDebugName
override string GetDebugName()
Definition: dayzplayer.c:1126
IsHologram
override bool IsHologram()
Definition: itembase.c:962
IsItemBase
override bool IsItemBase()
Definition: itembase.c:2489
IsCuttable
override bool IsCuttable()
Definition: woodbase.c:46
NO_TRANSFER
@ NO_TRANSFER
NO_ATTACHMENT_TRANSFER | NO_GLOBAL_TRANSFER.
Definition: object.c:6
AddChild
proto native void AddChild(Widget child, bool immedUpdate=true)
PlaySound
void PlaySound()
Definition: hungersoundhandler.c:38
ERPCs
ERPCs
Definition: erpcs.c:1
IsBuilding
protected bool IsBuilding(ActionTarget target)
Definition: actionbase.c:918
IsCorpse
override bool IsCorpse()
Definition: edible_base.c:244
IsPendingDeletion
bool IsPendingDeletion()
Get whether the Effect is queued up for being cleaned up.
Definition: effect.c:256
Object
class LOD Object
CanUseConstruction
override bool CanUseConstruction()
Definition: basebuildingbase.c:824
OnFirstContact
bool OnFirstContact(Object other)
Called for first layer contacts to determine if this object should be snapped around or default rv ra...
Definition: object.c:40
Widget
Definition: enwidgets.c:189
ProcessDirectDamageFlags
ProcessDirectDamageFlags
Definition: object.c:1
Math
Definition: enmath.c:6
SetDirection
proto native void SetDirection(vector direction)
SEffectManager
Manager class for managing Effect (EffectParticle, EffectSound)
Definition: effectmanager.c:5
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
EntityAI
Definition: building.c:5
HasFixedActionTargetCursorPosition
override bool HasFixedActionTargetCursorPosition()
Definition: dayzanimal.c:115
GetType
override int GetType()
Definition: huddebugwincharagents.c:49
Math3D
Definition: enmath3d.c:27
KindOf
override bool KindOf(string tag)
Definition: itembase.c:2495
Shape
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead
OnExplosionEffects
override void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
Definition: destructioneffects.c:39
GetDebugNameNative
proto string GetDebugNameNative()
Gets the debug name for the ParticleManager.
GetOrientation
vector GetOrientation()
Definition: areadamagemanager.c:306
points
< h scale="0.8">< image set="dayz_gui" name="icon_pin"/> Welcome to the DayZ Stress Test Branch</h >< h scale="0.6"> This branch serves for time limited development tests that are open to the community Our goal in each of these tests is to gather performance and stability data from servers under heavy load</h ></br >< h scale="0.8">< image set="dayz_gui" name="icon_pin"/> Stress test Schedule</h >< h scale="0.6"> We ll only run the Stress Tests when our development team needs data and or specific feedback Stress Tests will be announced on our Twitter and and will usually run for a couple of hours</h ></br >< h scale="0.8">< image set="dayz_gui" name="icon_pin"/> Current Stress Test</h >< h scale="0.6"> In the first bunch of Stress we ll mostly focus on watching server performance under heavy PvP gameplay load For detailed information about an ongoing Stress please visit dayz com dev hub</h ></br >< h scale="0.8">< image set="dayz_gui" name="icon_pin"/> Important Note</h >< h scale="0.6"> Stress Tests do not represent a typical DayZ gameplay experience Spawn points
Definition: news_feed.txt:26