DayZ Scripts
v1.21.156300 · Jun 20, 2023
 
Loading...
Searching...
No Matches
DayZAnimal.c
Go to the documentation of this file.
2{
3 private void DayZCreatureAnimInterface() {}
4 private void ~DayZCreatureAnimInterface() {}
5
6 //-----------------------------------------------------
7 // Binds, returns -1 when error, otherwise if ok
8
10 proto native TAnimGraphCommand BindCommand(string pCommandName);
13 proto native TAnimGraphVariable BindVariableFloat(string pVariable);
14 proto native TAnimGraphVariable BindVariableInt(string pVariable);
15 proto native TAnimGraphVariable BindVariableBool(string pVariable);
16
18 proto native TAnimGraphTag BindTag(string pTagName);
19
21 proto native TAnimGraphEvent BindEvent(string pEventName);
22}
23
24class DayZCreature extends EntityAI
25{
26 #ifdef _DAYZ_CREATURE_DEBUG_SHADOW
27 proto native void DebugSetShadow(DayZCreature creature);
28 #endif
29
30 proto native bool RegisterAnimationEvent(string event_name, string function_name);
31
32 proto native void SetAnimationInstanceByName(string animation_instance_name, int instance_uuid, float duration);
34
36
37
38 proto native void UpdateSimulationPrecision(int simLOD);
39
40 //---------------------------------------------------------
41 // helper functions for disabling simulation upon death
42 proto native void StartDeath();
43 proto native void ResetDeath();
44
45 proto native void ResetDeathCooldown();
46 proto native bool IsDeathProcessed();
47 proto native bool IsDeathConditionMet();
48
49 //---------------------------------------------------------
50 // bone transforms
51
53 proto native int GetBoneIndexByName(string pBoneName);
54
55 override bool IsDayZCreature()
56 {
57 return true;
58 }
59
60 override bool CanBeSkinned()
61 {
62 return true;
63 }
64
66 {
67 return IsRuined();
68 }
69
70 override bool IsManagingArrows()
71 {
72 return true;
73 }
74
75 override void AddArrow(Object arrow, int componentIndex, vector closeBonePosWS, vector closeBoneRotWS)
76 {
78 GetActionComponentNameList(componentIndex, CachedObjectsArrays.ARRAY_STRING, "fire");
79
80 int pivot = -1;
81
82
83 for (int i = 0; i < CachedObjectsArrays.ARRAY_STRING.Count() && pivot == -1; i++)
84 {
86 }
87
88 vector parentTransMat[4];
89 vector arrowTransMat[4];
90
91 if (pivot == -1)
92 {
93 GetTransform(parentTransMat);
94 }
95 else
96 {
97 vector rotMatrix[3];
98 Math3D.YawPitchRollMatrix(closeBoneRotWS * Math.RAD2DEG,rotMatrix);
99
100 parentTransMat[0] = rotMatrix[0];
101 parentTransMat[1] = rotMatrix[1];
102 parentTransMat[2] = rotMatrix[2];
103 parentTransMat[3] = closeBonePosWS;
104 }
105
106 arrow.GetTransform(arrowTransMat);
107 Math3D.MatrixInvMultiply4(parentTransMat, arrowTransMat, arrowTransMat);
108 // orthogonalize matrix - parent might be skewed
109 Math3D.MatrixOrthogonalize4(arrowTransMat);
110 arrow.SetTransform(arrowTransMat);
111
112 AddChild(arrow, pivot);
113 }
114}
115
117{
118 proto native AIAgent GetAIAgent();
119
120 proto native bool IsSoundInsideBuilding();
121#ifdef DIAG_DEVELOPER
122 proto native void DebugDisableAIControl();
123 proto native void DebugRestoreAIControl();
124#endif
125 proto native void AddDamageSphere(string bone_name, string ammo_name, float radius, float duration, bool invertTeams);
126
132 proto native void InitAIAgent(AIGroup group);
133 proto native void DestroyAIAgent();
134
135 int m_EffectTriggerCount;//how many effect triggers is this AI inside of(overlapping triggers)
136
137
139 {
140 RegisterAnimEvents();
141 SetFlags(EntityFlags.TOUCHTRIGGERS, false);
142 }
143
144
146 {
147 m_EffectTriggerCount++;
148 }
149
151 {
152 m_EffectTriggerCount--;
153 }
154
155 void AddDamageSphere(AnimDamageParams damage_params)
156 {
157 AddDamageSphere(damage_params.m_sBoneName, damage_params.m_sAmmoName, damage_params.m_fRadius, damage_params.m_fDuration, damage_params.m_bInvertTeams);
158 }
159
160 override void EEKilled(Object killer)
161 {
162 super.EEKilled(killer);
163 CreateComponent(COMP_TYPE_BODY_STAGING); // TO DO: This is never called on clients in multiplayer! That's why skinning doesn't work properly in MP. DAYZ-28269
164 }
165
167 {
168 return AnimBootsType.None;
169 }
170
172 {
173 if(so == NULL)
174 {
175 return NULL;
176 }
177
179 AbstractWave wave = GetGame().GetSoundScene().Play3D(so, sob);
180 return wave;
181 }
182
183 void OnSoundEvent(int event_id, string event_user_string)
184 {
185 AnimSoundEvent sound_event = GetCreatureAIType().GetSoundEvent(event_id);
186 if(sound_event != NULL)
187 {
188 ProcessSoundEvent(sound_event);
189 }
190 }
191
192 void OnSoundVoiceEvent(int event_id, string event_user_string)
193 {
194 AnimSoundVoiceEvent voice_event = GetCreatureAIType().GetSoundVoiceEvent(event_id);
195 if(voice_event != NULL)
196 {
197 ProcessSoundVoiceEvent(voice_event);
198 }
199 }
200
201 void OnStepEvent(int event_id, string event_user_string)
202 {
203 AnimStepEvent step_event = GetCreatureAIType().GetStepEvent(event_id);
204 if(step_event != NULL)
205 {
206 ProcessStepEvent(step_event);
207 }
208 }
209
210 void OnDamageEvent(int event_id, string event_user_string)
211 {
212 AnimDamageEvent damage_event = GetCreatureAIType().GetDamageEvent(event_id);
213 if(damage_event != NULL)
214 {
215 ProcessDamageEvent(damage_event);
216 }
217 }
218
219 protected void RegisterAnimEvents()
220 {
221 if(!RegisterAnimationEvent("Sound", "OnSoundEvent"))
222 {
223 Print("Error registering anim. event (Sound)");
224 }
225
226 if(!RegisterAnimationEvent("SoundVoice", "OnSoundVoiceEvent"))
227 {
228 Print("Error registering anim. event (SoundVoice)");
229 }
230
231 if(!GetGame().IsDedicatedServer())
232 {
233 if(!RegisterAnimationEvent("Step", "OnStepEvent"))
234 {
235 Print("Error registering anim. event (Step)");
236 }
237 }
238
239 if(!RegisterAnimationEvent("Damage", "OnDamageEvent"))
240 {
241 Print("Error registering anim. event (Damage)");
242 }
243 }
244
245 private void ProcessSoundEvent(AnimSoundEvent sound_event)
246 {
247 if(!GetGame().IsDedicatedServer())
248 {
249 SoundObjectBuilder objectBuilder = sound_event.GetSoundBuilder();
250 if(NULL != objectBuilder)
251 {
252 objectBuilder.UpdateEnvSoundControllers(GetPosition());
253 SoundObject soundObject = objectBuilder.BuildSoundObject();
254 PlaySound(soundObject, objectBuilder);
255 }
256 }
257
258 if(GetGame().IsServer())
259 {
260 if(sound_event.m_NoiseParams != NULL)
261 GetGame().GetNoiseSystem().AddNoise(this, sound_event.m_NoiseParams);
262 }
263 }
264
265 private void ProcessSoundVoiceEvent(AnimSoundVoiceEvent sound_event)
266 {
267 if(!GetGame().IsDedicatedServer())
268 {
269 SoundObjectBuilder objectBuilder = sound_event.GetSoundBuilder();
270 if(NULL != objectBuilder)
271 {
272 objectBuilder.UpdateEnvSoundControllers(GetPosition());
273 SoundObject soundObject = objectBuilder.BuildSoundObject();
274 AttenuateSoundIfNecessary(soundObject);
275 PlaySound(soundObject, objectBuilder);
276 }
277 }
278
279 if(GetGame().IsServer())
280 {
281 if(sound_event.m_NoiseParams != NULL)
282 GetGame().GetNoiseSystem().AddNoise(this, sound_event.m_NoiseParams);
283 }
284 }
285
286 private void ProcessStepEvent(AnimStepEvent step_event)
287 {
288 SoundObjectBuilder soundBuilder = step_event.GetSoundBuilder(GetSurfaceType().Hash());
289 if(soundBuilder == NULL)
290 return;
291
293 SoundObject soundObject = soundBuilder.BuildSoundObject();
294 AttenuateSoundIfNecessary(soundObject);
295 PlaySound(soundObject, soundBuilder);
296
297 //TODO effects
298 }
299
300 private void ProcessDamageEvent(AnimDamageEvent damage_event)
301 {
302 AddDamageSphere(damage_event.m_DamageParams);
303 }
304
305 protected void AttenuateSoundIfNecessary(SoundObject soundObject)
306 {
307 if (GetGame().GetPlayer() != NULL && (IsSoundInsideBuilding() != GetGame().GetPlayer().IsSoundInsideBuilding() || GetGame().GetPlayer().IsCameraInsideVehicle()))
308 {
309 soundObject.SetKind(WaveKind.WAVEATTALWAYS);
310 }
311 else
312 {
313 soundObject.SetKind(WaveKind.WAVEEFFECTEX);
314 }
315 }
316
318 {
319 return false;
320 }
321
322 // ================
323 // EASTER EGG
324 // ================
325
326 //Used for easter egg sound selection
327 bool IsDanger()
328 {
329 return false;
330 }
331
333 {
334 return "";
335 }
336
338 {
339 return "";
340 }
341}
342
343enum DayZAnimalConstants
344{
351};
352
354{
355
356}
357
358class DayZAnimalCommandAttack extends AnimCommandBase
359{
360
361}
362
363class DayZAnimalCommandJump extends AnimCommandBase
364{
365
366}
367
368class DayZAnimalCommandLookAt extends AnimCommandBase
369{
370
371}
372
373class DayZAnimalCommandBehaviourModifier extends AnimCommandBase
374{
375
376}
377
378class DayZAnimalCommandHit extends AnimCommandBase
379{
380
381}
382
383class DayZAnimalCommandDeath extends AnimCommandBase
384{
385
386}
387
388class DayZAnimalCommandAnimCallback extends AnimCommandBase
389{
390
391}
392
400class DayZAnimalCommandScript extends AnimCommandBase
401{
403 //void DayZAnimalCommandScript(DayZAnimal pAnimal)
404
405 //---------------------------------------------------------------
406 // usable everywhere
407
409 proto native void SetFlagFinished(bool pFinished);
410
411 //---------------------------------------------------------------
412 // PrePhys Update
413
415 proto native bool PrePhys_GetTranslation(out vector pOutTransl); // vec3 in local space !
416 proto native bool PrePhys_GetRotation(out float pOutRot[4]); // quaternion in local space !
417 proto native void PrePhys_SetTranslation(vector pInTransl); // vec3 in local space !
418 proto native void PrePhys_SetRotation(float pInRot[4]); // quaternion in local space !
419
420 //---------------------------------------------------------------
421 // PostPhys Update
422
426 bool PostPhysUpdate(float pDt);
427
429 proto native void PostPhys_GetPosition(out vector pOutTransl);
430 proto native void PostPhys_GetRotation(out float pOutRot[4]);
431 proto native void PostPhys_SetPosition(vector pInTransl);
432 proto native void PostPhys_SetRotation(float pInRot[4]);
433 proto native void PostPhys_LockRotation();
434}
435
437{
438
441 protected string m_DefaultHitComponent;
444
446
447 proto native void StartCommand_Death(int pType, int pDirection);
448 proto native void StartCommand_Move();
449 proto native void StartCommand_Jump();
450 proto native void StartCommand_Attack();
451 proto native void StartCommand_Hit(int pType, int pDirection);
452
454 proto native DayZAnimalCommandScript StartCommand_Script(DayZAnimalCommandScript pInfectedCommand);
455 proto native DayZAnimalCommandScript StartCommand_ScriptInst(typename pCallbackClass);
456 proto native DayZAnimalCommandScript GetCommand_Script();
457
458 proto native void SignalAIAttackStarted();
459 proto native void SignalAIAttackEnded();
460
462 {
463 // testing: animals have no inventory by default
464 //GetInventory().LockInventory(LOCK_FROM_SCRIPT); // Hides animals from vicinity in inventory. Remove this if wanted otherwise.
465
467
469
471 m_DefaultHitPosition = SetDefaultHitPosition(GetDefaultHitPositionComponent());
472 }
473
474 override bool IsHealthVisible()
475 {
476 return false;
477 }
478
479 override bool IsAnimal()
480 {
481 return true;
482 }
483
484 override bool IsInventoryVisible()
485 {
486 return false;
487 }
488
489 override int GetHideIconMask()
490 {
491 return EInventoryIconVisibility.HIDE_VICINITY;
492 /*
493 if (IsAlive())
494 {
495 return EInventoryIconVisibility.HIDE_VICINITY;
496 }
497 return super.GetHideIconMask();
498 */
499 }
500
501 void CommandHandler(float dt, int currentCommandID, bool currentCommandFinished)
502 {
504
506 if( ModCommandHandlerBefore(dt, currentCommandID, currentCommandFinished) )
507 {
508 return;
509 }
510
511 if (HandleDeath(currentCommandID, inputController))
512 {
513 return;
514 }
515
516 if (currentCommandFinished)
517 {
518 if (currentCommandID == DayZAnimalConstants.COMMANDID_ATTACK)
519 {
520 SignalAIAttackEnded();
521 }
522
524
525 return;
526 }
527
529 if( ModCommandHandlerInside(dt, currentCommandID, currentCommandFinished) )
530 {
531 return;
532 }
533
534 if (HandleDamageHit(currentCommandID))
535 {
536 if (currentCommandID == DayZAnimalConstants.COMMANDID_ATTACK)
537 {
538 SignalAIAttackEnded();
539 }
540 return;
541 }
542
543 if (currentCommandID == DayZAnimalConstants.COMMANDID_MOVE)
544 {
545 if (inputController.IsJump())
546 {
547 StartCommand_Jump();
548 return;
549 }
550
551 if (inputController.IsAttack())
552 {
553 StartCommand_Attack();
554 SignalAIAttackStarted();
555 return;
556 }
557 }
558
560 if( ModCommandHandlerAfter(dt, currentCommandID, currentCommandFinished) )
561 {
562 return;
563 }
564 }
565
566 //-------------------------------------------------------------
570 // these functions are for modded overide in script command mods
571
572 bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
573 {
574 return false;
575 }
576
577 bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
578 {
579 return false;
580 }
581
582 bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
583 {
584 return false;
585 }
586
587 bool m_DamageHitToProcess = false;
588 int m_DamageHitType = 0;
589 int m_DamageHitDirection = 0;
590
591 bool HandleDeath(int currentCommandID, DayZAnimalInputController inputController)
592 {
593 if (inputController.IsDead())
594 {
595 if (currentCommandID == DayZAnimalConstants.COMMANDID_DEATH)
596 {
597 return true;
598 }
599
600 if (m_DamageHitToProcess)
601 {
602 m_DamageHitToProcess = false;
603
604 StartCommand_Death(m_DamageHitType, m_DamageHitDirection);
605 }
606 else
607 {
608 StartCommand_Death(0, 0);
609 }
610
611 return true;
612 }
613
614 return false;
615 }
616
617 bool HandleDamageHit(int currentCommandID)
618 {
619 if (m_DamageHitToProcess)
620 {
621 m_DamageHitToProcess = false;
622
623 if (currentCommandID != DayZAnimalConstants.COMMANDID_HIT)
624 {
625 StartCommand_Hit(m_DamageHitType, m_DamageHitDirection);
626 }
627 return true;
628 }
629 return false;
630 }
631
632 override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
633 {
634 super.EEHitBy(damageResult, damageType, source, component, dmgZone, ammo, modelPos, speedCoef);
635 m_TransportHitRegistered = false;
636
637 if( ammo.ToType().IsInherited(Nonlethal_Base) )
638 {
639 //Print("DayZAnimal | EEHitBy | nonlethal hit");
640 AddHealth("","Health",-ConvertNonlethalDamage(damageResult.GetDamage(dmgZone,"Shock")));
641 }
642 else
643 {
644 ComponentAnimalBleeding animal_bleeding = ComponentAnimalBleeding.Cast( GetComponent( COMP_TYPE_ANIMAL_BLEEDING ) );
645 animal_bleeding.CreateWound( damageResult, dmgZone, ammo );
646 }
647
648 int type = 0;
649 int direction = 0;
650 if (ComputeDamageHitParams(source, dmgZone, ammo, type, direction) == true)
651 {
652 QueueDamageHit(type, direction);
653 }
654
655 }
656
657 void QueueDamageHit(int type, int direction)
658 {
659 m_DamageHitToProcess = true;
660 m_DamageHitType = type;
661 m_DamageHitDirection = direction;
662 }
663
664 bool ComputeDamageHitParams(EntityAI source, string dmgZone, string ammo, out int type, out int direction)
665 {
666 type = 0; // not used right now
667
668 float angleDeg = ComputeHitDirectionAngleDeg(source);
669 direction = TranslateHitAngleDegToDirectionIndex(angleDeg);
670
671 direction += FindComponentDirectionOffset(dmgZone);
672
673 return true;
674 }
675
677 {
678 vector targetDirection = GetDirection();
679 vector toSourceDirection = (source.GetPosition() - GetPosition());
680
681 targetDirection[1] = 0;
682 toSourceDirection[1] = 0;
683
684 targetDirection.Normalize();
685 toSourceDirection.Normalize();
686
687 float cosFi = vector.Dot(targetDirection, toSourceDirection);
688 vector cross = targetDirection * toSourceDirection;
689
690 float dirAngleDeg = Math.Acos(cosFi) * Math.RAD2DEG;
691 if ( cross[1] < 0 )
692 dirAngleDeg = -dirAngleDeg;
693
694 return dirAngleDeg;
695 }
696
698 {
699 if (angleDeg >= -20 && angleDeg <= 20) // front
700 {
701 return 1;
702 }
703 else if (angleDeg < 0) // left
704 {
705 return 2;
706 }
707
708 return 3; // right
709 }
710
712 {
713 const int directionCount = 4;
714
715 int offset = 0;
716 if (component.Length() == 0)
717 {
718 offset = 0;
719 }
720 else if (component == "Zone_Head")
721 {
722 offset = directionCount;
723 }
724 else if (component == "Zone_Chest" || component == "Zone_Legs_Front" || component == "Zone_Spine_Front" || component == "Zone_Neck")
725 {
726 offset = 2 * directionCount;
727 }
728 else
729 {
730 offset = 3 * directionCount;
731 }
732
733 return offset;
734 }
735
736 //-------------------------------------------------------------
740
741 override protected void EOnContact(IEntity other, Contact extra)
742 {
743 if( !IsAlive() )
744 return;
745
746 Transport transport = Transport.Cast(other);
747 if( transport )
748 {
749 if ( GetGame().IsServer() )
750 {
751 RegisterTransportHit(transport);
752 }
753 }
754 }
755
758 {
760 m_DefaultHitComponent = "Zone_Chest";
763
766 }
767
768 override string GetHitComponentForAI()
769 {
770 string hitComp;
771
773 {
774 return hitComp;
775 }
776
777 return GetDefaultHitComponent();
778 }
779
780 override string GetDefaultHitComponent()
781 {
783 }
784
786 {
788 }
789
791 {
792 return m_DefaultHitPosition;
793 }
794
795 protected vector SetDefaultHitPosition(string pSelection)
796 {
797 return GetSelectionPositionMS(pSelection);
798 }
799
800 float ConvertNonlethalDamage(float damage)
801 {
802 float converted_dmg = damage * GameConstants.PROJECTILE_CONVERSION_ANIMALS;
803 return converted_dmg;
804 }
805}
class AnimalBase extends DayZAnimal RegisterHitComponentsForAI()
Definition AnimalBase.c:23
AnimBootsType
proto native DayZCreatureAnimInterface GetAnimInterface()
proto native void PrePhys_SetRotation(float pInRot[4])
bool PostPhysUpdate(float pDt)
class DayZCreatureAI extends DayZCreature COMMANDID_ATTACK
proto native void SetAnimationInstanceByName(string animation_instance_name, int instance_uuid, float duration)
proto native void PostPhys_SetPosition(vector pInTransl)
quaternion in world space
class DayZCreatureAI extends DayZCreature COMMANDID_HIT
class DayZCreatureAnimInterface RegisterAnimationEvent(string event_name, string function_name)
class DayZAnimalCommandMove extends AnimCommandBase SetFlagFinished(bool pFinished)
DayZAnimalCommandScript fully scriptable command.
proto native void UpdateSimulationPrecision(int simLOD)
proto native bool PrePhys_GetRotation(out float pOutRot[4])
proto native int GetCurrentAnimationInstanceUUID()
proto native bool IsDeathProcessed()
proto native void PostPhys_GetRotation(out float pOutRot[4])
vec3 in world space
class DayZCreatureAI extends DayZCreature COMMANDID_MOVE
override void AddArrow(Object arrow, int componentIndex, vector closeBonePosWS, vector closeBoneRotWS)
Definition DayZAnimal.c:75
proto native int GetBoneIndexByName(string pBoneName)
returns bone index for a name (-1 if pBoneName doesn't exist)
class DayZCreatureAI extends DayZCreature COMMANDID_SCRIPT
proto native bool PrePhys_GetTranslation(out vector pOutTransl)
script function usable in PrePhysUpdate
proto native void PostPhys_SetRotation(float pInRot[4])
vec3 in world space
override bool IsIgnoredByConstruction()
Definition DayZAnimal.c:65
proto native void PrePhys_SetTranslation(vector pInTransl)
proto native void ResetDeath()
proto native void StartDeath()
class DayZCreatureAI extends DayZCreature COMMANDID_JUMP
proto native void PostPhys_LockRotation()
quaternion in world space
override bool CanBeSkinned()
Definition DayZAnimal.c:60
proto native void ResetDeathCooldown()
class DayZCreatureAI extends DayZCreature COMMANDID_DEATH
override bool IsManagingArrows()
Definition DayZAnimal.c:70
override bool IsDayZCreature()
Definition DayZAnimal.c:55
proto native void PostPhys_GetPosition(out vector pOutTransl)
script function usable in PostPhysUpdate
proto native bool IsDeathConditionMet()
void PlaySound()
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
PlayerBase GetPlayer()
WaveKind
Definition Sound.c:2
class SoundObjectBuilder SoundObject(SoundParams soundParams)
class JsonUndergroundAreaTriggerData GetPosition
proto void SetPosition(vector position)
base class of all commands exposed to script to provide common functionality over animations
Definition AnimCommand.c:3
proto native AbstractSoundScene GetSoundScene()
proto native NoiseSystem GetNoiseSystem()
static ref TStringArray ARRAY_STRING
void CreateWound(TotalDamageResult damage_result, string zone_name, string ammo)
static void RegisterHitComponent(array< ref DayZAIHitComponent > pHitComponents, string pName, float pWeight)
Register Hit Component for AI targeting.
static bool SelectMostProbableHitComponent(array< ref DayZAIHitComponent > pHitComponents, out string pHitComponent)
proto native bool IsAttack()
proto native bool IsDead()
do not process rotations !
Definition DayZAnimal.c:437
override bool IsInventoryVisible()
Definition DayZAnimal.c:484
int FindComponentDirectionOffset(string component)
Definition DayZAnimal.c:711
proto native void SignalAIAttackEnded()
bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
Definition DayZAnimal.c:577
void QueueDamageHit(int type, int direction)
Definition DayZAnimal.c:657
void RegisterHitComponentsForAI()
register hit components for AI melee (used by attacking AI)
Definition DayZAnimal.c:757
float ComputeHitDirectionAngleDeg(EntityAI source)
Definition DayZAnimal.c:676
override string GetHitComponentForAI()
Definition DayZAnimal.c:768
proto native void StartCommand_Attack()
protected string m_DefaultHitPositionComponent
Definition DayZAnimal.c:442
proto native void StartCommand_Hit(int pType, int pDirection)
protected ref array< ref DayZAIHitComponent > m_HitComponentsForAI
Melee hit components (AI targeting)
Definition DayZAnimal.c:440
bool ComputeDamageHitParams(EntityAI source, string dmgZone, string ammo, out int type, out int direction)
Definition DayZAnimal.c:664
protected vector SetDefaultHitPosition(string pSelection)
Definition DayZAnimal.c:795
protected string m_DefaultHitComponent
Definition DayZAnimal.c:441
override string GetDefaultHitComponent()
Definition DayZAnimal.c:780
proto native DayZAnimalCommandScript GetCommand_Script()
override string GetDefaultHitPositionComponent()
Definition DayZAnimal.c:785
bool HandleDeath(int currentCommandID, DayZAnimalInputController inputController)
Definition DayZAnimal.c:591
override vector GetDefaultHitPosition()
Definition DayZAnimal.c:790
int TranslateHitAngleDegToDirectionIndex(float angleDeg)
Definition DayZAnimal.c:697
proto native DayZAnimalCommandScript StartCommand_Script(DayZAnimalCommandScript pInfectedCommand)
scripted commands
proto native DayZAnimalInputController GetInputController()
override bool IsHealthVisible()
Definition DayZAnimal.c:474
bool HandleDamageHit(int currentCommandID)
Definition DayZAnimal.c:617
override bool IsAnimal()
Definition DayZAnimal.c:479
void DayZAnimal()
Definition DayZAnimal.c:461
protected vector m_DefaultHitPosition
Definition DayZAnimal.c:443
override int GetHideIconMask()
Definition DayZAnimal.c:489
proto native void StartCommand_Move()
float ConvertNonlethalDamage(float damage)
Definition DayZAnimal.c:800
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
Definition DayZAnimal.c:632
proto native DayZAnimalCommandScript StartCommand_ScriptInst(typename pCallbackClass)
void CommandHandler(float dt, int currentCommandID, bool currentCommandFinished)
Definition DayZAnimal.c:501
proto native void SignalAIAttackStarted()
proto native void StartCommand_Jump()
bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
Definition DayZAnimal.c:572
proto native void StartCommand_Death(int pType, int pDirection)
override protected void EOnContact(IEntity other, Contact extra)
Definition DayZAnimal.c:741
bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
Definition DayZAnimal.c:582
proto native bool IsJump()
proto native TAnimGraphVariable BindVariableFloat(string pVariable)
proto native TAnimGraphEvent BindEvent(string pEventName)
private void DayZCreatureAnimInterface()
Definition DayZAnimal.c:3
proto native TAnimGraphVariable BindVariableBool(string pVariable)
proto native TAnimGraphCommand BindCommand(string pCommandName)
returns command index -
private void ~DayZCreatureAnimInterface()
Definition DayZAnimal.c:4
proto native TAnimGraphTag BindTag(string pTagName)
proto native TAnimGraphVariable BindVariableInt(string pVariable)
void OnSoundEvent(int event_id, string event_user_string)
Definition DayZAnimal.c:183
void DecreaseEffectTriggerCount()
Definition DayZAnimal.c:150
AbstractWave PlaySound(SoundObject so, SoundObjectBuilder sob)
Definition DayZAnimal.c:171
void OnSoundVoiceEvent(int event_id, string event_user_string)
Definition DayZAnimal.c:192
void OnStepEvent(int event_id, string event_user_string)
Definition DayZAnimal.c:201
int m_EffectTriggerCount
Definition DayZAnimal.c:135
override void EEKilled(Object killer)
Definition DayZAnimal.c:160
bool ResistContaminatedEffect()
Definition DayZAnimal.c:317
void DayZCreatureAI()
Definition DayZAnimal.c:138
private void ProcessStepEvent(AnimStepEvent step_event)
Definition DayZAnimal.c:286
void IncreaseEffectTriggerCount()
Definition DayZAnimal.c:145
proto native bool IsSoundInsideBuilding()
proto native void AddDamageSphere(string bone_name, string ammo_name, float radius, float duration, bool invertTeams)
protected void RegisterAnimEvents()
Definition DayZAnimal.c:219
void OnDamageEvent(int event_id, string event_user_string)
Definition DayZAnimal.c:210
proto native void InitAIAgent(AIGroup group)
private void ProcessDamageEvent(AnimDamageEvent damage_event)
Definition DayZAnimal.c:300
proto native void DestroyAIAgent()
private void ProcessSoundVoiceEvent(AnimSoundVoiceEvent sound_event)
Definition DayZAnimal.c:265
AnimBootsType GetBootsType()
Definition DayZAnimal.c:166
bool IsDanger()
Definition DayZAnimal.c:327
protected void AttenuateSoundIfNecessary(SoundObject soundObject)
Definition DayZAnimal.c:305
string ReleaseSound()
Definition DayZAnimal.c:337
proto native AIAgent GetAIAgent()
string CaptureSound()
Definition DayZAnimal.c:332
proto native DayZCreatureAIType GetCreatureAIType()
private void ProcessSoundEvent(AnimSoundEvent sound_event)
Definition DayZAnimal.c:245
void AddDamageSphere(AnimDamageParams damage_params)
Definition DayZAnimal.c:155
Definition EnMath.c:7
proto void AddNoise(EntityAI source_entity, NoiseParams noise_params, float external_strenght_multiplier=1.0)
base "helper" class for nonlethal ammo handling
Definition BulletTypes.c:3
proto native void UpdateEnvSoundControllers(vector position)
SoundObject BuildSoundObject()
Definition Sound.c:49
proto native float GetDamage(string zoneName, string healthType)
Base native class for all motorized wheeled vehicles.
Definition Car.c:80
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto float Normalize()
Normalizes vector. Returns length.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271
protected string m_DefaultHitPositionComponent
Definition dayzplayer.c:589
protected ref array< ref DayZAIHitComponent > m_HitComponentsForAI
Melee hit components (AI targeting)
Definition dayzplayer.c:587
string GetDefaultHitComponent()
Definition dayzplayer.c:497
protected string m_DefaultHitComponent
Definition dayzplayer.c:588
string GetDefaultHitPositionComponent()
Definition dayzplayer.c:502
proto native CGame GetGame()
const int COMP_TYPE_ANIMAL_BLEEDING
Definition Component.c:11
const int COMP_TYPE_BODY_STAGING
Definition Component.c:10
proto void Print(void var)
Prints content of variable to console/log.
proto native void SetFlags(ShapeFlags flags)
const float PROJECTILE_CONVERSION_ANIMALS
Non-lethal projectile damage QuantityConversions.
Definition constants.c:840
EntityFlags
Entity flags.
Definition EnEntity.c:115
static proto void MatrixOrthogonalize4(vector mat[4])
Orthogonalizes matrix.
static proto void MatrixInvMultiply4(vector mat0[4], vector mat1[4], out vector res[4])
Invert-transforms matrix.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto float Acos(float c)
Returns angle in radians from cosinus.
static const float RAD2DEG
Definition EnMath.c:16
proto native ToType()
Returns internal type representation. Can be used in runtime, or cached in variables and used for fas...
proto native void AddChild(Widget child, bool immedUpdate=true)
int TAnimGraphVariable
Definition human.c:268
proto native HumanCommandMove StartCommand_Move()
returns current command ID
int TAnimGraphTag
Definition human.c:269
proto native HumanCommandDeathCallback StartCommand_Death(int pType, float pDirection, typename pCallbackClass)
--— Death --—
class HumanInputController TAnimGraphCommand
proto native HumanInputController GetInputController()
returns human input controller
int TAnimGraphEvent
Definition human.c:270