DayZ 1.24
Loading...
Searching...
No Matches
Object.c
Go to the documentation of this file.
8
9class ObjectSnapCallback
10{
14
17
19
22
26 void OnSetup()
27 {
28 }
29
32 void OnDebug(vector p0, vector p1, bool hasHit, bool found)
33 {
34 }
35
41 {
42 return false;
43 }
44
50 {
51 return true;
52 }
53
59 {
60 return true;
61 }
62};
63
64class Object extends IEntity
65{
66 private void ~Object();
67 private void Object();
68
70 {
71 return false;
72 }
73
82 void Delete()
83 {
84 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Call(GetGame().ObjectDelete, this);
85 }
86
88
90
93
96
99
102
104
107 {
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 return lods.Get(i);
118 }
119
120 return NULL;
121 }
122
128
134
140
142 void Explode(int damageType, string ammoType = "")
143 {
144 if (ammoType == "")
145 ammoType = ConfigGetString("ammoType");
146
147 if (ammoType == "")
148 ammoType = "Dummy_Heavy";
149
150 if (GetGame().IsServer())
151 {
152 SynchExplosion();
153 DamageSystem.ExplosionDamage(EntityAI.Cast(this), null, ammoType, GetPosition(), damageType);
154 }
155 }
156
158 {
159 if (GetGame().IsDedicatedServer()) // Multiplayer server
160 {
162 GetGame().RPCSingleParam(this, ERPCs.RPC_EXPLODE_EVENT, p, true);
163 }
164 else if (!GetGame().IsMultiplayer()) // Singleplayer
165 OnExplodeClient();
166 }
167
170 {
171 string ammoType = ConfigGetString("ammoType");
172
173 if (ammoType == "")
174 ammoType = "Dummy_Heavy";
175
176 vector pos = GetPosition();
177
178 // Handle spawn of particle if one is configured in config
180
181 // Handle spawn of Effect if one is configured in config
183 }
184
186
189
192
195
198
201
204
207
210
213
218
224
225#ifdef DEVELOPER
227 proto bool ToBonePivot(out int pivot, int level, int bone);
228 proto bool FromBonePivot(int pivot, out int level, out int bone);
229#endif
230
233
236
241
246
251
259
260#ifdef DIAG_DEVELOPER
262 {
263#ifndef SERVER
264 vector points[2];
265 vector corners[4];
266
267 GetTightlyPackedCorners(axis, corners);
268
269 points[0] = corners[0];
270 points[1] = corners[1];
271 Shape.CreateLines(color, ShapeFlags.TRANSP | ShapeFlags.ONCE | ShapeFlags.NOOUTLINE | ShapeFlags.NOZBUFFER, points, 2);
272
273 points[0] = corners[1];
274 points[1] = corners[3];
275 Shape.CreateLines(color, ShapeFlags.TRANSP | ShapeFlags.ONCE | ShapeFlags.NOOUTLINE | ShapeFlags.NOZBUFFER, points, 2);
276
277 points[0] = corners[3];
278 points[1] = corners[2];
279 Shape.CreateLines(color, ShapeFlags.TRANSP | ShapeFlags.ONCE | ShapeFlags.NOOUTLINE | ShapeFlags.NOZBUFFER, points, 2);
280
281 points[0] = corners[2];
282 points[1] = corners[0];
283 Shape.CreateLines(color, ShapeFlags.TRANSP | ShapeFlags.ONCE | ShapeFlags.NOOUTLINE | ShapeFlags.NOZBUFFER, points, 2);
284#endif
285 }
286#endif
287
290
294
297
302
308
314
317
324
327
330
335
338
341
344
347
348
361
373
379
382
383
385
388 {
390 return GetGame().SurfaceGetNoiseMultiplier(NULL, position, -1);
391 }
392
395 {
396 string surface_type;
397 int liquid_type;
398
399 GetGame().SurfaceUnderObject(this, surface_type, liquid_type);
400 // Print(surface_type);
401 // Print(liquid_type);
402
403 return surface_type;
404 }
405
407 bool HasSelection(string selection)
408 {
410 GetSelectionList(selections);
411
412 for (int i = 0; i < selections.Count(); ++i)
413 {
414 if (selections.Get(i) == selection)
415 return true;
416 }
417
418 return false;
419 }
420
423 {
424 string cfg_path_vehicles = "CfgVehicles " + GetType() + " ";
425 if (GetGame().ConfigIsExisting(cfg_path_vehicles) && GetGame().ConfigIsExisting(cfg_path_vehicles + "AnimationSources " + anim_name))
426 return true;
427
428 string cfg_path_weapons = "CfgWeapons " + GetType() + " ";
429 if (GetGame().ConfigIsExisting(cfg_path_weapons) && GetGame().ConfigIsExisting(cfg_path_weapons + "AnimationSources " + anim_name))
430 return true;
431
432 string cfg_path_magazines = "CfgMagazines " + GetType() + " ";
433 if (GetGame().ConfigIsExisting(cfg_path_magazines) && GetGame().ConfigIsExisting(cfg_path_magazines + "AnimationSources " + anim_name))
434 return true;
435
436 return false;
437 }
438
440 /*bool HasEnergyManager()
441 {
442 return false;
443 }*/
444
449
453
456
458 string GetType()
459 {
460 string ret;
461 GetGame().ObjectGetType(this, ret);
462
463 return ret;
464 }
465
468 {
469 string tmp;
470 if (NameOverride(tmp))
471 tmp = Widget.TranslateString(tmp);
472 else
473 GetGame().ObjectGetDisplayName(this, tmp);
474 return tmp;
475 }
476
477 //Used to specify this object will always display it's own name when attached to another object
479 {
480 return false;
481 }
482
485 {
486 return GetGame().GetModelName(GetType());
487 }
488
491
493 {
494 return GetGame().ObjectRelease(this);
495 }
496
498 bool IsKindOf(string type)
499 {
500 return GetGame().ObjectIsKindOf(this, type);
501 }
502
503 // Check alive state
504 bool IsAlive()
505 {
506 return !IsDamageDestroyed();
507 }
508
510 bool IsMan()
511 {
512 return false;
513 }
514
517 {
518 return false;
519 }
520
523 {
524 return false;
525 }
526
529 {
530 return false;
531 }
532
535 {
536 return false;
537 }
538
541 {
542 return false;
543 }
544
545 //Returns true for protector cases and similar items. Usually can be nested in other cargo while full, unlike clothing..
547 {
548 return false;
549 }
550
553 {
554 return false;
555 }
556
559 {
560 return false;
561 }
562
565 {
566 return false;
567 }
568
571 {
572 return false;
573 }
574
577 {
578 return false;
579 }
580
582 bool IsTree()
583 {
584 return false;
585 }
586
588 bool IsRock()
589 {
590 return false;
591 }
592
595 {
596 return false;
597 }
598
600 bool IsBush()
601 {
602 return false;
603 }
604
606 {
607 return false;
608 }
609
612 {
613 return false;
614 }
615
617 bool IsWeapon()
618 {
619 return false;
620 }
621
624 {
625 return false;
626 }
627
630 {
631 return false;
632 }
633
638
641 bool IsWell()
642 {
643 return false;
644 }
646 bool ShootsExplosiveAmmo()//placed on Object so that we can optimize early checks in DayZGame without casting
647 {
648 return false;
649 }
650
653 {
654 return false;
655 }
656
659 {
660 return false;
661 }
662
665 {
666 return false;
667 }
668
671 {
672 return false;
673 }
674
677 {
678 return false;
679 }
680
683 {
684 return false;
685 }
686
688 {
689 return false;
690 }
691
693
695 bool IsFood()
696 {
697 return (IsFruit() || IsMeat() || IsCorpse() || IsMushroom());
698 }
699
700 bool IsFruit()
701 {
702 return false;
703 }
704
705 bool IsMeat()
706 {
707 return false;
708 }
709
710 bool IsCorpse()
711 {
712 return false;
713 }
714
716 {
717 return false;
718 }
719
722 {
723 return true;
724 }
725
728 {
729 return false;
730 }
731
733 {
734 return false;
735 }
736
738 {
739 return false;
740 }
741
743 {
744 return false;
745 }
746
748 {
749 return false;
750 }
751
753 {
754 return false;
755 }
756
758 {
759 return IsPlainObject() && !IsScenery();
760 }
761
763 {
764 return HasProxyParts() || CanUseConstruction();
765 }
766
769 {
770 return false;
771 }
772
774 {
775 return IsBush() || IsTree() || IsMan() || IsDayZCreature() || IsItemBase();
776 }
777
779 {
780 return true;
781 }
782
785 {
786 return false;
787 }
788
792
794 {
795 int low, high;
796 GetNetworkID(low, high);
797 return high.ToString() + low.ToString();
798 }
799
800 override string GetDebugName()
801 {
802 return GetDebugNameNative();
803 }
804
805 static string GetDebugName(Object o)
806 {
807 if (o)
808 return o.GetDebugName();
809 return "null";
810 }
811
814
820
823 {
824 GetGame().RPCSingleParam(this, rpc_type, param, guaranteed, recipient);
825 }
826
833
835 {
836 return GetGame().ObjectGetSelectionPosition(this, name);
837 }
838
840 {
841 return GetGame().ObjectGetSelectionPositionLS(this, name);
842 }
843
845 {
846 return GetGame().ObjectGetSelectionPositionMS(this, name);
847 }
848
850 {
851 return GetGame().ObjectGetSelectionPositionWS(this, name);
852 }
853
854
856 {
857 return GetGame().ObjectModelToWorld(this, modelPos);
858 }
859
861 {
862 return GetGame().ObjectWorldToModel(this, worldPos);
863 }
864
865 // config class API
866
877 {
878 return (ConfigGetInt(entryName) == 1);
879 }
880
883 //proto ParamEntry ConfigGetEntry(string entryName);
884
891
899
906
913
919
921 bool KindOf(string tag)
922 {
923 bool found = false;
924 string item_name = this.GetType();
926 ConfigGetTextArray("cfgVehicles " + item_name + " itemInfo", item_tag_array);
927
928 int array_size = item_tag_array.Count();
929 for (int i = 0; i < array_size; i++)
930 {
931 if (item_tag_array.Get(i) == tag)
932 {
933 found = true;
934 break;
935 }
936 }
937 return found;
938 }
939
941 {
942 bool ret;
943 for (int i = 0; i < typenames.Count(); i++)
944 ret = ret || this.IsInherited(typenames.Get(i));
945 return ret;
946 }
947
952
957
958 // Damage system
963
968
974
980 proto native float GetHealth(string zoneName, string healthType);
981
988
995
1001 proto native void SetHealth(string zoneName, string healthType, float value);
1002
1007
1013 proto native void AddHealth(string zoneName, string healthType, float value);
1014
1021
1027 void DecreaseHealth(string zoneName, string healthType, float value, bool auto_delete)
1028 {
1029 DecreaseHealth(zoneName, healthType, value);
1030
1031 float result_health = GetHealth(zoneName, healthType);
1032
1033 if (auto_delete && result_health <= 0)
1034 GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).Call(GetGame().ObjectDelete, this);
1035 }
1036
1039 {
1040 return GetHealth("", "");
1041 }
1044 {
1045 return GetHealth01("", "");
1046 }
1049 {
1050 return GetMaxHealth("", "");
1051 }
1053 void SetHealth(float health)
1054 {
1055 SetHealth("", "", health);
1056 }
1059 {
1060 SetHealth("", "", health);
1061 }
1063 void SetHealthLevel(int healthLevel, string zone = "")
1064 {
1065 SetHealth01(zone, "", GetHealthLevelValue(healthLevel, zone));
1066 }
1068 void AddHealthLevel(int healthLevelDelta, string zone = "")
1069 {
1070 int maxHealthLevel = GetNumberOfHealthLevels(zone) - 1;
1071 int newHealthLevel = Math.Clamp(GetHealthLevel(zone) + healthLevelDelta, 0, maxHealthLevel);
1072 SetHealthLevel(newHealthLevel, zone);
1073 }
1074
1076 void SetHealth01(string zoneName, string healthType, float coef)
1077 {
1078 SetHealth(zoneName, healthType, (GetMaxHealth(zoneName, healthType)*coef));
1079 }
1081 void SetHealthMax(string zoneName = "", string healthType = "")
1082 {
1083 SetHealth(zoneName, healthType, GetMaxHealth(zoneName, healthType));
1084 }
1087 {
1088 AddHealth("", "", add_health);
1089 }
1091 void DecreaseHealth(float dec_health, bool auto_delete = true)
1092 {
1093 DecreaseHealth("", "", dec_health, auto_delete);
1094 }
1097 {
1098 float current_health = GetHealth();
1099 float final_health_coef = GetHealth01() - dec_health_coef;
1100 float final_health = GetMaxHealth() * final_health_coef;
1101 DecreaseHealth("", "", current_health - final_health);
1102 }
1103
1115
1121 {
1122 return true;
1123 }
1124
1130
1141
1148
1155
1162
1163
1173
1178
1184
1196 {
1197 return IsDamageDestroyed();
1198 }
1199
1202
1205
1209
1212 {
1213 return GetGame().CreateSoundOnObject(this, sound_name, range, false, create_local);
1214 }
1215
1218 {
1219 return GetGame().CreateSoundOnObject(this, sound_name, range, true, create_local);
1220 }
1221
1223 bool PlaySoundSet(out EffectSound sound, string sound_set, float fade_in, float fade_out, bool loop = false)
1224 {
1225 if (GetGame() && !GetGame().IsDedicatedServer())
1226 {
1227 if (sound)
1228 {
1229 if (loop)
1230 return true;
1231 else
1232 {
1233 StopSoundSet(sound); //auto stop for non-looped sounds
1234 }
1235 }
1236
1238 sound.SetAutodestroy(true);
1239
1240 return true;
1241 }
1242
1243 return false;
1244 }
1245
1248 {
1249 return PlaySoundSet(sound, sound_set, fade_in, fade_out, true);
1250 }
1251
1254 {
1255 if (sound && sound.IsPlaying())
1256 sound.SoundStop();
1257 return PlaySoundSetAtMemoryPointLooped(sound, soundSet, memoryPoint, play_fade_in, stop_fade_out);
1258 }
1259
1261 {
1262 return PlaySoundSetAtMemoryPoint(sound, soundSet, memoryPoint, true, play_fade_in, stop_fade_out);
1263 }
1264
1265
1266 bool PlaySoundSetAtMemoryPoint(out EffectSound sound, string soundSet, string memoryPoint, bool looped = false, float play_fade_in = 0, float stop_fade_out = 0)
1267 {
1268 vector pos;
1269
1270 if (MemoryPointExists(memoryPoint))
1271 {
1272 pos = GetMemoryPointPos(memoryPoint);
1273 pos = ModelToWorld(pos);
1274 }
1275 else
1276 {
1277 ErrorEx(string.Format("Memory point %1 not found when playing soundset %2 at memory point location", memoryPoint, soundSet));
1278 return false;
1279 }
1280
1282 return true;
1283 }
1284
1287 {
1288 if (sound && GetGame() && (!GetGame().IsDedicatedServer()))
1289 {
1290 sound.SoundStop();
1291 sound = null;
1292
1293 return true;
1294 }
1295
1296 return false;
1297 }
1298
1301
1304
1307
1309 {
1310 int lo = 0;
1311 int hi = 0;
1312 GetNetworkID(lo, hi);
1313 return lo | hi;
1314 }
1315
1317 {
1318 return false;
1319 }
1320
1322 {
1323 return false;
1324 }
1325
1327
1329 {
1330 return false;
1331 }
1332
1334 {
1335 if (MemoryPointExists("ce_center"))
1336 {
1337 //Print("CE_CENTER found");
1338 return ModelToWorld(GetMemoryPointPos("ce_center"));
1339 }
1340 else
1341 {
1342 //Print("CE_CENTER DOING A BAMBOOZLE => not found");
1343 return GetPosition() + Vector(0, 0.2, 0);
1344 }
1345 }
1346
1347#ifdef DEVELOPER
1348 void SetDebugItem();
1349#endif
1350
1352 {
1353 int pivot = GetBonePivot(GetFireGeometryLevel(), componentIndex);
1356
1357 if (pivot == -1)
1358 GetTransform(parentTransMat);
1359 else
1360 GetBoneTransformWS(pivot, parentTransMat);
1361
1362 float scale = GetScale();
1363 scale = 1 / (scale * scale);
1364
1365 arrow.GetTransform(arrowTransMat);
1367
1368 // orthogonalize matrix - parent might be skewed
1370
1371 arrowTransMat[3] = arrowTransMat[3] * scale;
1372
1373 arrow.SetTransform(arrowTransMat);
1374
1376 }
1377
1379 {
1380 return !IsHologram();
1381 }
1382
1384 {
1385 return false;
1386 }
1387
1388 //Debug
1389 //----------------------------------------------
1390 /*void DbgAddPxyPhy(string slot)
1391 {
1392 Print("AddProxyPhysics slot: " + slot);
1393 AddProxyPhysics(slot);
1394 }*/
1395};
eBleedingSourceType GetType()
bool IsDamageDestroyed(ActionTarget target)
Definition ActionBase.c:841
override bool CanUseConstruction()
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
override bool IsDayZCreature()
Definition DayZAnimal.c:55
ERPCs
Definition ERPCs.c:2
ETransformationAxis
EWaterSourceObjectType
override bool IsCorpse()
override bool IsMeat()
override bool IsFruit()
override bool IsMushroom()
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override bool IsHologram()
Definition ItemBase.c:5641
override bool IsItemBase()
Definition ItemBase.c:7168
void OnDebug(vector p0, vector p1, bool hasHit, bool found)
Debug callback for rendering on the screen.
Definition Object.c:32
bool OnCollide(Object other)
Ray cast line test from owner to a tested position.
Definition Object.c:58
vector m_DirectionFunc
The size of the boundig box, centered.
Definition Object.c:18
enum ProcessDirectDamageFlags m_Owner
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
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
vector m_Offset
The direction of the owner in world space.
Definition Object.c:15
ProcessDirectDamageFlags
Definition Object.c:2
@ NO_ATTACHMENT_TRANSFER
Do not transfer damage to attachments.
Definition Object.c:4
@ ALL_TRANSFER
Definition Object.c:3
@ NO_GLOBAL_TRANSFER
Do not transfer damage to global.
Definition Object.c:5
@ NO_TRANSFER
NO_ATTACHMENT_TRANSFER | NO_GLOBAL_TRANSFER.
Definition Object.c:6
vector m_OwnerDirection
The position of the owner in world space.
Definition Object.c:13
vector m_Transform[4]
If 'OnDebug' is to be called.
Definition Object.c:21
bool m_DebugEnabled
How much should the direction be favoured.
Definition Object.c:20
vector m_OwnerPosition
The owner performing the snap callback.
Definition Object.c:12
vector m_Extents
The true center of the bounding box of the object to be dropped in model space.
Definition Object.c:16
void OnSetup()
The transformation currently being debugged.
Definition Object.c:26
proto string GetDebugNameNative()
Gets the debug name for the ParticleManager.
class JsonUndergroundAreaTriggerData GetPosition
Static data holder for certain ammo config values.
Definition AmmoEffects.c:6
static bool PlayAmmoEffect(string ammoType, vector pos)
Attempt to play the ammo effect at pos if found, returns true on success.
Definition AmmoEffects.c:85
static bool PlayAmmoParticle(string ammoType, vector pos)
Attempt to play the ammo particle at pos if found, returns true on success.
Definition AmmoEffects.c:43
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
static array< string > GetHiddenSelectionsTexturesConfig(string type)
static array< string > GetHiddenSelectionsMaterialsConfig(string type)
static array< string > GetHiddenSelectionsConfig(string type)
proto native bool IsActionComponentPartOfSelection(int componentIndex, string selectionName, string geometry="")
return true if selection containts action component, 'geometry' can be "fire" or "view" (default "" f...
proto native void GetBoneRotationWS(int pivot, out float quaternion[4])
proto native bool GetCollisionBox(out vector minMax[2])
Gets collision bounding box.
bool IsBeingBackstabbed()
Definition Object.c:687
bool IsFireplace()
Returns if this entity is fireplacebase.
Definition Object.c:576
bool DisplayNameRuinAttach()
Definition Object.c:478
void OnSimulationDisabled()
Event called from C++ when simulation is disabled.
Definition Object.c:1204
proto native void GetBoneRotationMS(int pivot, out float quaternion[4])
proto native void SetDestructTime(float time)
Sets the time over which to perform DestructTent/DestructTree.
proto native bool IsDamageDestroyed()
Checks if object is destroyed.
EWaterSourceObjectType GetWaterSourceObjectType()
Definition Object.c:634
proto native owned string GetShapeName()
Return path and name of the model.
bool ShootsExplosiveAmmo()
Returns if this entity is a weapon which can shoot explosive ammo.
Definition Object.c:646
void OnTreeCutDown(EntityAI cutting_entity)
Called when tree is chopped down. 'cutting_entity' can be tool, or player, if cutting bush with bare ...
proto native float GetHealth(string zoneName, string healthType)
Returns current state of health.
proto native float GetHealth01(string zoneName, string healthType)
Returns current state of health in range <0, 1>.
bool StopSoundSet(out EffectSound sound)
EffectSound - stops soundset and returns state of the sound (true - stopped, false - not playing)
Definition Object.c:1286
bool IsWell()
Definition Object.c:641
proto float ConfigGetFloat(string entryName)
bool IsEntityAI()
Returns if this entity is EntityAI.
Definition Object.c:522
proto native int GetMemoryLevel()
bool PlaySoundSetAtMemoryPointLoopedSafe(out EffectSound sound, string soundSet, string memoryPoint, float play_fade_in=0, float stop_fade_out=0)
Same as PlaySoundSetAtMemoryPointLooped, only requests stoppage of the currently playing EffectSound ...
Definition Object.c:1253
float GetHealth01()
Equivalent of GetHealth01("", "");.
Definition Object.c:1043
bool IsTransport()
Returns if this entity is transport.
Definition Object.c:658
bool IsMagazine()
Returns if this entity is Magazine.
Definition Object.c:552
LOD GetLODByName(string name)
Retrieve LOD by given name.
Definition Object.c:106
proto native void EnableDynamicCCD(bool state)
void RPCSingleParam(int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=NULL)
Remote procedure call shortcut, see CGame.RPCSingleParam / CGame.RPC.
Definition Object.c:822
proto native vector GetWorldPosition()
proto string ConfigGetStringRaw(string entryName)
Get a raw strings from config entry.
proto native void SetAffectPathgraph(bool fromConfig, bool affect)
Sets if object's geometry affects pathgraph generation. If first parameter is true,...
proto native bool IsPlainObject()
Is this just static object without config? So we can avoid calling unnecessary methods.
proto float ClippingInfo(out vector minMax[2])
Get Clipping info.
proto native owned vector GetActionComponentPosition(int componentIndex, string geometry="")
returns action component position by given component index, 'geometry' can be "fire" or "view" (defau...
proto native void RemoveProxyPhysics(string proxySelectionName)
proto native void ConfigGetTextArrayRaw(string entryName, out TStringArray values)
Get array of raw strings from config entry.
bool IsAmmoPile()
Returns if this entity is Ammo Pile.
Definition Object.c:558
void PreAreaDamageActions()
void OnExplosionEffects(Object source, Object directHit, int componentIndex, string surface, vector pos, vector surfNormal, float energyFactor, float explosionFactor, bool isWater, string ammoType)
Definition Object.c:185
bool IsInventoryItem()
Returns if this entity is InventoryItem.
Definition Object.c:564
proto native void SetFullHealth()
Sets full health to all zones and removes fatal damage when applicable.
proto native void PlaceOnSurface()
Place object on surface.
bool IsContainer()
Definition Object.c:546
proto native void GetBonePivotsForAnimationSource(int level, string animationSource, out TIntArray pivots)
Get the pivots assigned to the animation source at the specified LOD.
proto native bool ConfigIsExisting(string entryName)
Checks if given entry exists.
bool IsFruit()
Definition Object.c:700
proto native void SetDirection(vector vPos)
Set direction of object.
vector GetCenter()
Definition Object.c:1333
bool IsCorpse()
Definition Object.c:710
bool HasNetworkID()
Definition Object.c:1308
void OnReceivedHit(ImpactEffectsData hitData)
vector ModelToWorld(vector modelPos)
Definition Object.c:855
proto int GetBonePivot(int level, int component)
Get the pivot point of the bone from the component index in the LOD, level can be geometry,...
proto native int GetFireGeometryLevel()
proto native float GetHealthLevelValue(int healthLevel, string zone="")
Returns cutoff value for health level specified in object's config class parameter healthLevels.
int Release()
Definition Object.c:492
proto native float GetDamage()
Get total damage (clipped to range 0..1)
proto native vector GetSpeed()
Retrieve object's speed in global space.
bool CanUseConstructionBuild()
Returns if this entity can be built, specifically.
Definition Object.c:676
proto native vector GetDamageZonePos(string zoneName)
Obtains middle position of damage zone based on it's name.
proto vector ConfigGetVector(string entryName)
void SetHealth(float health)
Equivalent of SetHealth("", "", float value);.
Definition Object.c:1053
proto native float GetMaxHealth(string zoneName, string healthType)
Returns maximum value of health.
void SpawnDamageDealtEffect()
void Object()
void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
Definition Object.c:1206
string GetModelName()
Returns name of the model of this object without the '.p3d' suffix.
Definition Object.c:484
proto native bool ToDelete()
Flag to determine this object is marked to be deleted soon.
proto native void ProcessDirectDamage(int damageType, EntityAI source, string componentName, string ammoName, vector modelPos, float damageCoef=1.0, int flags=0)
Applies damage on object.
string GetDisplayName()
Get display name of entity.
Definition Object.c:467
void SynchExplosion()
Definition Object.c:157
string GetNetworkIDString()
Definition Object.c:793
bool IsWoodBase()
Returns whether object is PlanBase.
Definition Object.c:594
proto native void SetPosition(vector vPos)
Set position.
bool DisableVicinityIcon()
Disables icon in the vicinity, useful for large, immovable items, that are not buildings.
Definition Object.c:784
bool IsKindOf(string type)
Check config class name of the object.
Definition Object.c:498
proto native void GetBoneRotationLS(int pivot, out float quaternion[4])
returns local space, model space, world space orientation (quaternion) of a bone
proto native void ConfigGetTextArray(string entryName, out TStringArray values)
Get array of strings from config entry.
TStringArray GetHiddenSelections()
Returns the hiddenSelections array from the object's config.
Definition Object.c:124
override string GetDebugName()
Definition Object.c:800
void DecreaseHealth(float dec_health, bool auto_delete=true)
Equivalent of DecreaseHealth("", "", float value, bool auto_delete);.
Definition Object.c:1091
bool PlaySoundSetLoop(out EffectSound sound, string sound_set, float fade_in, float fade_out)
EffectSound - plays soundset on this object in loop and returns state of the sound (true - played,...
Definition Object.c:1247
proto native void AddProxyPhysics(string proxySelectionName)
proto native vector GetPosition()
Retrieve position.
proto native bool GetCanBeDestroyed()
Returns if object is destroyable.
void SetGlobalHealth(float health)
Equivalent of SetHealth("", "", float value);.
Definition Object.c:1058
proto native int GetHealthLevel(string zone="")
Returns global health level specified in object's config class parameter healthLevels (range is usual...
proto native void GetBoneTransformWS(int pivot, out vector transform[4])
bool IsCuttable()
Definition Object.c:605
bool CanUseConstruction()
Returns if this entity can be constucted,deconstructed (e.g. fence,watchtower)
Definition Object.c:670
bool KindOf(string tag)
Compares config class name to given string.
Definition Object.c:921
bool IsMan()
Returns if this entity is Man.
Definition Object.c:510
bool IsTree()
Returns if this entity is tree.
Definition Object.c:582
proto native void SetAllowDamage(bool val)
Enable or disable object to receive damage.
void AddHealth(float add_health)
Equivalent of AddHealth("", "", float value);.
Definition Object.c:1086
proto vector GetActionComponentCenterOOB(int level, int componentIndex)
The center of the component, in model space.
proto native void GetSelectionList(out TStringArray selectionList)
bool PlaySoundSet(out EffectSound sound, string sound_set, float fade_in, float fade_out, bool loop=false)
EffectSound - plays soundset on this object and returns state of the sound (true - played,...
Definition Object.c:1223
bool IsFuelStation()
Returns if this entity is Fuel Station (extends Building)
Definition Object.c:652
proto native void SetCanBeDestroyed(bool val)
Enable or disable destruction of object (after health is depleated)
proto native bool IsPendingDeletion()
proto string ConfigGetString(string entryName)
bool HasProxyParts()
Definition Object.c:752
bool IsItemBase()
Returns if this entity is ItemBase.
Definition Object.c:540
proto native vector GetOrientation()
Retrieve orientation (yaw, pitch, roll) in degrees
vector GetSelectionPositionLS(string name)
Definition Object.c:839
bool NameOverride(out string output)
Definition Object.c:1316
string GetSurfaceType()
Returns type of surface under object.
Definition Object.c:394
TStringArray GetHiddenSelectionsTextures()
Returns the hiddenSelectionsTextures array from the object's config.
Definition Object.c:130
vector GetSelectionPositionWS(string name)
Definition Object.c:849
bool CanBeIgnoredByDroppedItem()
Definition Object.c:773
bool ConfigGetBool(string entryName)
Definition Object.c:876
void OnEnterTrigger(ScriptedEntity trigger)
Object entered trigger.
Definition Object.c:92
bool IsFood()
Returns if this entity if a food item.
Definition Object.c:695
bool IsAnyInherited(array< typename > typenames)
Definition Object.c:940
float GetHealth()
Equivalent of GetHealth("", "");.
Definition Object.c:1038
proto native void GetDamageZones(out TStringArray dmgZones)
Obtains a list of nammes of all object's damage zones.
proto native vector GetMemoryPointPosByIndex(int pointIndex)
bool EEOnDamageCalculated(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
Event called from C++ right before damage is applied.
Definition Object.c:1120
bool PlaySoundSetAtMemoryPoint(out EffectSound sound, string soundSet, string memoryPoint, bool looped=false, float play_fade_in=0, float stop_fade_out=0)
Definition Object.c:1266
bool ShowZonesHealth()
Returns true if the health of damage zones should be displayed (instead of global HP of the entity) (...
Definition Object.c:727
bool HasAnimation(string anim_name)
Searches object's config for the given animation name. Returns true if it was found,...
Definition Object.c:422
SoundOnVehicle PlaySound(string sound_name, float range, bool create_local=true)
Plays the given sound once on this object's instance. Range is in meters. Created sound is only local...
Definition Object.c:1211
proto native bool GetAllowDamage()
Returns if object can receive damage.
bool IsScriptedLight()
Definition Object.c:742
void PostAreaDamageActions()
void Delete()
Delete this object in next frame.
Definition Object.c:82
vector WorldToModel(vector worldPos)
Definition Object.c:860
bool HasFixedActionTargetCursorPosition()
Definition Object.c:1383
bool CanObstruct()
Definition Object.c:757
proto native vector GetLocalPos(vector vPos)
Calculate local position of other entity to this entity.
bool IsBush()
Returns if this entity is bush.
Definition Object.c:600
bool IsWeapon()
Returns if this entity is Weapon.
Definition Object.c:617
bool CanProxyObstructSelf()
can the object's own proxy geometry obstruct it? Currently checking 'ObjIntersectView'
Definition Object.c:768
float GetMaxHealth()
Equivalent of GetMaxHealth("", "");.
Definition Object.c:1048
proto native void AddHealth(string zoneName, string healthType, float value)
Adds health.
void AddHealthLevel(int healthLevelDelta, string zone="")
Similar to 'SetHealthLevel', but allows to jump up/down 'healthLevelDelta' amount of health levels fr...
Definition Object.c:1068
bool IsItemTent()
Definition Object.c:737
static string GetDebugName(Object o)
Definition Object.c:805
proto native vector GetDirectionAside()
Retrieve direction aside vector.
proto native bool GetLODS(notnull out array< LOD > lods)
Retrieve all LODS.
proto native int GetGeometryLevel()
Native functions for getting the level used for calculating the pivot.
bool IsPeltBase()
Returns if this entity is Pelt_Base.
Definition Object.c:611
proto native void GetTightlyPackedCorners(ETransformationAxis axis, out vector corners[4])
Get corner positions in worldspace aligned to the orientation of the object (currently only TOP/BOTTO...
proto native void SetOrientation(vector vOrientation)
Set orientation (yaw, pitch, roll) in degrees
void DecreaseHealthCoef(float dec_health_coef, bool auto_delete=true)
Decreases health by the given coeficient.
Definition Object.c:1096
proto native void GetBoneTransformMS(int pivot, out vector transform[4])
float GetSurfaceNoise()
Returns noise multiplier of surface under object.
Definition Object.c:387
bool IsRuined()
Returns whether the object is ruined (0 Health).
Definition Object.c:1195
proto native bool CanAffectPathgraph()
Returns true if object's geometry can affect pathgraph generation.
proto int ConfigGetInt(string entryName)
proto vector GetActionComponentCenter(int level, int componentIndex)
The center of the component, in model space.
proto void GetActionComponentsForSelectionName(int level, string selectionName, TIntArray componentIndices)
outputs action component index list by given selection, 'geometry' can be "fire" or "view" (default "...
vector GetSelectionPositionOld(string name)
Definition Object.c:834
proto native vector GetBonePositionWS(int pivot)
TStringArray GetHiddenSelectionsMaterials()
Returns the hiddenSelectionsMaterials array from the object's config.
Definition Object.c:136
bool IsClothing()
Returns if this entity is Clothing.
Definition Object.c:570
proto native bool MemoryPointExists(string memoryPoint)
proto void GetActionComponentMinMax(int level, int componentIndex, out vector min, out vector max)
The AABB of the component.
proto native owned string GetActionComponentName(int componentIndex, string geometry="")
returns action component name by given component index, 'geometry' can be "fire" or "view" (default "...
void SetHealthMax(string zoneName="", string healthType="")
Sets health to its maximum (zone or global)
Definition Object.c:1081
bool IsBuilding()
Returns if this entity is Building.
Definition Object.c:629
void AddArrow(Object arrow, int componentIndex, vector closeBonePosWS, vector closeBoneRotWS)
Definition Object.c:1351
void OnSimulationEnabled()
Event called from C++ when simulation is enabled.
Definition Object.c:1201
proto native void ConfigGetIntArray(string entryName, out TIntArray values)
Get array of integers from config entry.
void DecreaseHealth(string zoneName, string healthType, float value, bool auto_delete)
Decreases health with the option of auto-deleting the object if its ruined.
Definition Object.c:1027
bool IsHealthVisible()
Returns if the health of this entity should be displayed (widgets, inventory)
Definition Object.c:721
bool IsRock()
Returns if this entity is rock.
Definition Object.c:588
proto native vector GetDirection()
Retrieve direction vector.
bool IsDayZCreature()
Checks if this instance is of type DayZCreature.
Definition Object.c:516
proto native int GetMemoryPointIndex(string memoryPointName)
If Returns true if this item has EnergyManager in its config. Otherwise returns false.
void OnPlayerRecievedHit()
DEPRECATED.
string GetType()
Get config class of object.
Definition Object.c:458
SoundOnVehicle PlaySoundLoop(string sound_name, float range, bool create_local=true)
Plays the given sound in loop on this object's instance. Range is in meters. Created sound is only lo...
Definition Object.c:1217
bool HasSelection(string selection)
Returns true if the given selection was found in the p3d file. False if otherwise.
Definition Object.c:407
bool IsTransmitter()
Returns if this entity is a non-static Transmitter.
Definition Object.c:534
void Explode(int damageType, string ammoType="")
Creates an explosion on this object by its ammoType in config.
Definition Object.c:142
proto native void SetDynamicPhysicsLifeTime(float lifeTime)
void SetHealthLevel(int healthLevel, string zone="")
Sets specific health level. It will use the cutoff value as returned by 'GetHealthLevelValue' as the ...
Definition Object.c:1063
bool IsMeat()
Definition Object.c:705
proto native bool HasDamageSystem()
Checks if object's DamageSystem has been initialized(despite the name, does not really reliably answe...
bool CanProxyObstruct()
Definition Object.c:762
void SetHealth01(string zoneName, string healthType, float coef)
Sets health relative to its maximum.
Definition Object.c:1076
proto native void ConfigGetFloatArray(string entryName, out TFloatArray values)
Get array of floats from config entry.
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Called after remote procedure call is recieved for this object.
bool CanUseHandConstruction()
Returns if this entity can be constructed without tools.
Definition Object.c:682
proto native owned string GetLODName(LOD lod)
Retrieve LOD name.
void OnExplodeClient()
Called on clients when this object explodes.
Definition Object.c:169
void ~Object()
bool IsMushroom()
Definition Object.c:715
bool DescriptionOverride(out string output)
Definition Object.c:1321
proto native void SetHealth(string zoneName, string healthType, float value)
Sets current state of health.
bool CanBeAutoDeleted()
Definition Object.c:778
proto native bool IsScenery()
Is this Scenery? (handy for excluding terain when it is not needed)
void OnLeaveTrigger(ScriptedEntity trigger)
Object left trigger.
Definition Object.c:95
bool IsAlive()
Definition Object.c:504
bool CanBeSkinned()
Definition Object.c:69
bool IsHologram()
Definition Object.c:747
proto native owned int GetActionComponentNameList(int componentIndex, TStringArray nameList, string geometry="")
outputs action component name list by given component index, 'geometry' can be "fire" or "view" (defa...
proto native owned string GetDamageZoneNameByComponentIndex(int componentIndex)
Obtains name of damage zone based on index of specific component.
bool IsMeleeWeapon()
returns if this entity is Melee Weapon
Definition Object.c:623
proto string GetDebugNameNative()
native GetDebugName which is internally overloaded where needed
proto native vector GetBonePositionLS(int pivot)
returns local space, model space, world space position of the bone
proto native int GetViewGeometryLevel()
proto void GetNetworkID(out int lowBits, out int highBits)
bool IsParticle()
Definition Object.c:732
vector GetSelectionPositionMS(string name)
Definition Object.c:844
void SetBeingBackstabbed(int backstabType)
Definition Object.c:692
proto native vector GetBonePositionMS(int pivot)
bool IsStaticTransmitter()
Returns if this entity is Static Transmitter.
Definition Object.c:528
proto native vector GetDirectionUp()
Retrieve direction up vector.
proto native int GetNumberOfHealthLevels(string zone="")
Returns global number of health levels specified in object's config class parameter healthLevels (ran...
proto native void CreateDynamicPhysics(int interactionLayers)
bool PlaySoundSetAtMemoryPointLooped(out EffectSound sound, string soundSet, string memoryPoint, float play_fade_in=0, float stop_fade_out=0)
Definition Object.c:1260
void RPC(int rpc_type, array< ref Param > params, bool guaranteed, PlayerIdentity recipient=NULL)
Remote procedure call shortcut, see CGame.RPC / CGame.RPCSingleParam.
Definition Object.c:816
bool CanBeActionTarget()
Definition Object.c:1378
proto native void GetBoneTransformLS(int pivot, out vector transform[4])
returns local space, model space, world space transformations of a bone
proto native vector GetBoundingCenter()
proto native vector GetMemoryPointPos(string memoryPointName)
proto native void DecreaseHealth(string zoneName, string healthType, float value)
Decreases health.
bool CanBeRepairedToPristine()
Definition Object.c:1328
proto native float GetCollisionRadius()
Gets collision radius (bounding sphere)
EntityAI ProcessMeleeItemDamage(int mode=0)
Definition Object.c:1326
bool IsElectricAppliance()
Returns if this is an appliance, that can be plugged into electric circuit (== not energy source)
Definition Object.c:664
proto native vector GetModelSpeed()
Retrieve object's speed in local space.
proto native vector GetGlobalPos(vector vPos)
Calculate global position to this entity from local position.
LOD class.
Definition gameplay.c:203
Definition EnMath.c:7
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
The class that will be instanced (moddable)
Definition gameplay.c:376
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySoundEnviroment(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound, updating environment variables.
static EffectSound PlaySoundOnObject(string sound_set, Object parent_object, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
proto native CGame GetGame()
enum ShapeType ErrorEx
ShapeFlags
Definition EnDebug.c:126
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead
array< string > TStringArray
Definition EnScript.c:666
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto void MatrixInvMultiply4(vector mat0[4], vector mat1[4], out vector res[4])
Invert-transforms matrix.
static proto void MatrixOrthogonalize4(vector mat[4])
Orthogonalizes matrix.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8
proto native void AddChild(Widget child, bool immedUpdate=true)