Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
human.c
Go to the documentation of this file.
6
8{
12};
13
14// *************************************************************************************
15// ! HumanInputController - what we know about the input - human.GetInputController()
16// *************************************************************************************
19 //--------------------------------------------------------------
20
22 proto native void SetDisabled(bool pState);
23
25 proto void GetMovement(out float pSpeed, out vector pLocalDirection);
26
28 proto native float GetHeadingAngle();
29
31 proto native vector GetAimChange();
32
34 proto native vector GetAimDelta(float dt);
35
37 proto native vector GetTracking();
38
40 proto native bool CameraViewChanged();
41
43 proto native bool CameraIsFreeLook();
44
46 proto native void ResetFreeLookToggle();
47
49 proto native bool CameraIsTracking();
50
52 proto native bool Camera3rdIsRightShoulder();
53
54 //--------------------------------------------------------------
55
57 proto native bool IsStanceChange();
58
60 proto native bool IsJumpClimb();
61
62
63 //--------------------------------------------------------------
64
66 proto native bool IsMeleeEvade();
67
69 proto native bool IsMeleeFastAttackModifier();
70
72 proto native int IsMeleeLREvade();
73
75 proto native bool IsMeleeWeaponAttack();
76
77 //--------------------------------------------------------------
78
80 proto native bool WeaponWasRaiseClick();
81
83 proto native bool IsWeaponRaised();
84
86 proto native bool WeaponADS();
87
89 proto native void ResetADS();
90
92 proto native bool IsThrowingModeChange();
93
95 proto native void ResetThrowingMode();
96
98 proto native bool IsWalkToggled();
99
100 //--------------------------------------------------------------
101
106 proto native bool IsUseButton();
107
112 proto native bool IsUseButtonDown();
113
115 proto native bool IsUseItemButton();
117 proto native bool IsUseItemButtonDown();
118
120 proto native bool IsAttackButton();
122 proto native bool IsAttackButtonDown();
123
125 proto native bool IsSingleUse();
126
128 proto native bool IsContinuousUse();
129
131 proto native bool IsContinuousUseStart();
132
134 proto native bool IsContinuousUseEnd();
135
138 proto native bool IsImmediateAction(); //TODO: revise, may be obsolete
139
140 //--------------------------------------------------------------
142
144 proto native bool IsReloadOrMechanismSingleUse();
145
148
151
154
156 proto native bool IsZoom();
157
159 proto native bool IsZoomToggle();
160
162 proto native void ResetZoomToggle();
163
165 proto native bool IsSightChange();
166
168 proto native bool IsZoomIn();
169
171 proto native bool IsZoomOut();
172
174 proto native bool IsFireModeChange();
175
177 proto native bool IsZeroingUp();
178
180 proto native bool IsZeroingDown();
181
183 proto native bool IsHoldBreath();
184
186 proto native void ResetHoldBreath();
187
188 //--------------------------------------------------------------
189
192 proto native int IsGestureSlot();
193
195 proto native bool IsOtherController();
196
197 //--------------------------------------------------------------
198
200 proto native int IsQuickBarSlot();
201
204 proto native bool IsQuickBarSingleUse();
205
208 proto native bool IsQuickBarContinuousUse();
209
212 proto native bool IsQuickBarContinuousUseStart();
213
216 proto native bool IsQuickBarContinuousUseEnd();
217
218
219
220 //--------------------------------------------------------------
221 // LIMITS
222
224 proto native void LimitsDisableSprint(bool pDisable);
225
227 proto native bool LimitsIsSprintDisabled();
228
229
230 //--------------------------------------------------------------
231 // overrides
232
234 proto native void OverrideMovementSpeed(HumanInputControllerOverrideType overrideType, float value);
235
237 proto native void OverrideMovementAngle(HumanInputControllerOverrideType overrideType, float value);
238
240 proto native void OverrideAimChangeX(HumanInputControllerOverrideType overrideType, float value);
241
243 proto native void OverrideAimChangeY(HumanInputControllerOverrideType overrideType, float value);
244
246 proto native void OverrideMeleeEvade(HumanInputControllerOverrideType overrideType, bool value);
247
249 proto native void OverrideRaise(HumanInputControllerOverrideType overrideType, bool value);
250
252 proto native void Override3rdIsRightShoulder(HumanInputControllerOverrideType overrideType, bool value);
253
255 proto native void OverrideFreeLook(HumanInputControllerOverrideType overrideType, bool value);
256
257
258 //--------------------------------------------------------------
259
261 private void HumanInputController()
262 {
263 }
264
267 {
268 }
269}
270
271
272// *************************************************************************************
273// ! HumanInputController - what we know about the input - human.GetInputController()
274// *************************************************************************************
275
278typedef int TAnimGraphTag;
279typedef int TAnimGraphEvent;
280
283{
284 private void HumanAnimInterface();
285 private void ~HumanAnimInterface();
286
287 //-----------------------------------------------------
288 // Binds, returns -1 when error, otherwise if ok
289
291 proto native TAnimGraphCommand BindCommand(string pCommandName);
292
294 proto native TAnimGraphVariable BindVariableFloat(string pVariable);
295 proto native TAnimGraphVariable BindVariableInt(string pVariable);
296 proto native TAnimGraphVariable BindVariableBool(string pVariable);
297
299 proto native TAnimGraphTag BindTag(string pTagName);
300
302 proto native TAnimGraphEvent BindEvent(string pEventName);
303}
304
305
306// *************************************************************************************
307// ! HumanCommandActionCallback - called as action callback
308// *************************************************************************************
310{
311 private void HumanCommandActionCallback();
313
315 proto native Human GetHuman();
316
318 proto native void Cancel();
319
322 proto native void InternalCommand(int pInternalCommandId);
323
325 proto native void SetAligning(vector pPositionWS, vector pDirectionWS);
326
328 proto native void ResetAligning();
329
333 proto native void EnableCancelCondition(bool pEnable);
334
336 proto native bool DefaultCancelCondition();
337
339 proto native void RegisterAnimationEvent(string pAnimationEventStr, int pId);
340
342 proto native void EnableStateChangeCallback();
343
346 // bool CancelCondition() { return false; }
347
349 static const int STATE_NONE = 0;
350
352 static const int STATE_LOOP_IN = 1;
353 static const int STATE_LOOP_LOOP = 2;
354 static const int STATE_LOOP_END = 3;
355 static const int STATE_LOOP_END2 = 4;
356 static const int STATE_LOOP_LOOP2 = 5;
357 static const int STATE_LOOP_ACTION = 6;
358
360 static const int STATE_NORMAL = 7;
361
363 proto native int GetState();
364
365
366 //----------------------------------
367 // debug helper
368
370 static string GetStateString(int pState)
371 {
372 switch (pState)
373 {
374 case STATE_NONE: return "NONE";
375
376 case STATE_LOOP_IN: return "LOOP_IN";
377 case STATE_LOOP_LOOP: return "LOOP_LOOP";
378 case STATE_LOOP_END: return "LOOP_END";
379 case STATE_LOOP_END2: return "LOOP_END2";
380 case STATE_LOOP_LOOP2: return "LOOP_LOOP2";
381 case STATE_LOOP_ACTION: return "LOOP_ACTION";
382
384 case STATE_NORMAL: return "ONE TIME";
385 }
386
387 return "Undef";
388 }
389
390
393 {
394 return GetStateString(GetState());
395 }
396
397
398
399 //----------------------------------
400 // callbacks
401
403 void OnAnimationEvent(int pEventID) {};
404
406 void OnFinish(bool pCanceled) {};
407
409 void OnStateChange(int pOldState, int pCurrentState) {};
410
411
412 // helps identify type of callback
414 {
415 return false;
416 }
417
419 {
420 return false;
421 }
422
424 {
425 return false;
426 }
427}
428
429
430// *************************************************************************************
431// ! HumanCommandMove
432// *************************************************************************************
434{
435 private void HumanCommandMove() {}
436 private void ~HumanCommandMove() {}
437
440 proto native float GetCurrentMovementAngle();
441
445 proto bool GetCurrentInputAngle(out float pAngle);
446
448 proto native float GetCurrentMovementSpeed();
449
451 proto native bool IsChangingStance();
452
454 proto native bool IsOnBack();
455
457 proto native bool IsInRoll();
458
460 proto native bool IsLeavingUncon();
461
463 proto native bool IsStandingFromBack();
464
466 proto native void StartMeleeEvade();
467
469 proto native void StartMeleeEvadeA(float pDirAngle);
470
472 proto native bool IsMeleeEvade();
473
475 proto native void SetMeleeBlock(bool pBlock);
476
479 proto native void ForceStance(int pStanceIdx);
480
481
484 proto native void ForceStanceUp(int pStanceIdx);
485
486
488 proto native void SetRunSprintFilterModifier(float value);
489
491 proto native void SetDirectionFilterModifier(float value);
492
494 proto native void SetDirectionSprintFilterModifier(float value);
495
497 proto native void SetTurnSpanModifier(float value);
498
500 proto native void SetTurnSpanSprintModifier(float value);
501
503 proto native void SetCurrentWaterLevel(float value);
504}
505
506
507
508// *************************************************************************************
509// ! HumanCommandMelee - actual command melee running on
510// *************************************************************************************
512{
513 private void HumanCommandMelee() {}
514 private void ~HumanCommandMelee() {}
517 proto native void ContinueCombo();
518
520 proto native bool IsInComboRange();
521
523 proto native bool WasHit();
526 proto native void Cancel();
529 proto native bool IsOnBack();
531
532
533// *************************************************************************************
534// ! HumanCommandMelee2 - actual command melee running on - Heavy/Light version
535// *************************************************************************************
537{
538 private void HumanCommandMelee2() {}
539 private void ~HumanCommandMelee2() {}
540
541 static const int HIT_TYPE_LIGHT = 0;
542 static const int HIT_TYPE_HEAVY = 1;
543 static const int HIT_TYPE_FINISHER = 2; //liver stab
544 static const int HIT_TYPE_FINISHER_NECK = 3;
547 proto native void ContinueCombo(bool pHeavyHit, float pComboValue, EntityAI target = null, vector hitPos = vector.Zero);
550 proto native bool IsInComboRange();
553 proto native bool WasHit();
556 proto native void Cancel();
557
559 proto native bool IsOnBack();
560
561 proto native int GetComboCount();
562
563 proto native int GetCurrentHitType();
564
565 proto native bool IsFinisher();
566}
568
569// *************************************************************************************
570// ! HumanCommandFall - actually falling
571// *************************************************************************************
574 private void HumanCommandFall() {}
575 private void ~HumanCommandFall() {}
577 static const int LANDTYPE_NONE = 0;
578 static const int LANDTYPE_LIGHT = 1;
579 static const int LANDTYPE_MEDIUM = 2;
580 static const int LANDTYPE_HEAVY = 3;
583 proto native bool PhysicsLanded();
586 proto native void Land(int pLandType);
587
589 proto native bool IsLanding();
590}
591
592// *************************************************************************************
593// ! HumanCommandDeathCallback - called as action callback
594// *************************************************************************************
596{
597 //----------------------------------
598 // callbacks
599
600 void OnSimulationEnd() {};
601
603 bool ShouldSimulationBeDisabled() { return true; };
604}
605
606// *************************************************************************************
607// ! HumanCommandDeath - actually dying
608// *************************************************************************************
610{
611 private void HumanCommandDeath() {}
612 private void ~HumanCommandDeath() {}
613}
614
616// *************************************************************************************
617// ! HumanCommandUnconscious - actually not dying
618// *************************************************************************************
620{
621 private void HumanCommandUnconscious() {}
622 private void ~HumanCommandUnconscious() {}
623
624 proto native void WakeUp(int targetStance = -1);
625 proto native bool IsWakingUp();
626
627 proto native bool IsOnLand();
628 proto native bool IsInWater();
629}
630
631
632// *************************************************************************************
633// ! HumanCommandDamage - additional damage
634// *************************************************************************************
636{
637 private void HumanCommandDamage() {}
638 private void ~HumanCommandDamage() {}
640
641// *************************************************************************************
642// ! HumanCommandLadder ladder
643// *************************************************************************************
646 private void HumanCommandLadder() {}
647 private void ~HumanCommandLadder() {}
648
650 proto native bool CanExit();
651
653 proto native void Exit();
654
656 proto native static bool DebugDrawLadder(Building pBuilding, int pLadderIndex);
657
659 proto native static int DebugGetLadderIndex(string pComponentName);
660
663 proto native vector GetLogoutPosition();
664}
665
666
667
668// *************************************************************************************
669// ! HumanCommandLadder ladder
670// *************************************************************************************
672{
673 private void HumanCommandSwim() {}
674 private void ~HumanCommandSwim() {}
677 proto native void StopSwimming();
681 proto native static vector WaterLevelCheck(Human pHuman, vector pPosition);
682}
683
685
686// *************************************************************************************
687// ! HumanCommandVehicle vehicle
688// *************************************************************************************
690{
691 private void HumanCommandVehicle() {}
692 private void ~HumanCommandVehicle() {}
693
694 proto native Transport GetTransport();
695 proto native int GetVehicleClass();
696 proto native int GetVehicleSeat();
697 proto native void SetVehicleType(int pVehicleType);
698 proto native int GetVehicleType();
699
700 proto native void GetOutVehicle();
701 proto native void KnockedOutVehicle();
702 proto native bool ShouldBeKnockedOut();
703 proto native void JumpOutVehicle();
704 proto native void SwitchSeat(int pTransportPositionIndex, int pVehicleSeat);
705 proto native bool IsGettingIn();
706 proto native bool IsGettingOut();
707 proto native bool IsSwitchSeat();
708 proto native bool WasGearChange();
709 proto native void SetClutchState(bool pState);
710 proto native void KeepInVehicleSpaceAfterLeave(bool pState);
711 proto native void ProcessLeaveEvents();
712
714 {
715 Object object;
716 if (!Class.CastTo(object, entity))
717 {
718 return true;
719 }
720
721 Transport transport = GetTransport();
722 if (!transport)
723 {
724 return true;
725 }
726
727 if (object == transport || object.GetParent() == transport)
728 {
729 return true;
730 }
731
732 return transport.IsIgnoredObject(object);
733 }
734}
735
736// *************************************************************************************
737// ! HumanCommandClimb
738// *************************************************************************************
739
741class SHumanCommandClimbResult
742{
747
749
754
758};
759
760
770
773{
774 private void HumanCommandClimb() {}
775 private void ~HumanCommandClimb() {}
776
778 proto native int GetState();
779
781 proto native vector GetGrabPointWS();
782
785
789 proto native static bool DoClimbTest(Human pHuman, SHumanCommandClimbResult pResult, int pDebugDrawLevel);
790
794 proto native static bool DoPerformClimbTest(Human pHuman, SHumanCommandClimbResult pResult, int pDebugDrawLevel);
795
798 proto native static bool DebugDrawClimb(Human pHuman, int pLevel);
799}
800
801
802
803
804// *************************************************************************************
805// ! HumanCommandFullBodyDamage - full body damages
806// *************************************************************************************
808{
809 private void HumanCommandFullBodyDamage() {}
812
813
829
859
865
866enum WeaponActionMechanismTypes
867{
869 MECHANISM_OPENED = 0, // CMD_Reload_BoltAction
871 MECHANISM_SPECIAL = 2, // crossbow, magnum ... special mechanism action apropriate for custom weapons
873};
874
876{
879 CHAMBERING_ONEBULLET_OPENED = 0, // CMD_Reload_Chambering
884 CHAMBERING_TWOBULLETS_START = 6, // plays one bullet, then second, then ends, when CHAMBERING_TWOBULLETS_END arise, it's canceled
885 CHAMBERING_TWOBULLETS_END = 7, // - one bullet reload with closed mechanism
886
888 CHAMBERING_STARTLOOPABLE_CLOSED = 10, // start loop chambering
889 CHAMBERING_ENDLOOPABLE = 11, // end loop chambering
890 CHAMBERING_STARTLOOPABLE_CLOSED_KEEP = 12, // start loop chambering and keep last bullet
892
894
897
902
903
904 CHAMBERING_CROSSBOW_OPENED = 21, // chambering crossbow
905 CHAMBERING_CROSSBOW_CLOSED = 22, // chambering crossbow
906 CHAMBERING_CROSSBOW_FULL = 23, // chambering crossbow
907
908 CHAMBERING_DOUBLE_FIREOUT_EJECT = 24, // For manual ejecting during reload
909};
910
912{
913 CHAMBERINGLOADER_OPENED = 0, // CMD_Reload_ChamberingFast - one bullet reload with open mechanism
914 CHAMBERINGLOADER_CLOSED = 1, // - one bullet reload with closed mechanism
915};
916
918{
920 UNJAMMING_START = 1, // CMD_Weapon_Jam - 0
923};
924
934
948
949string WeaponActionTypeToString (int A, int AT)
950{
951 switch (A)
952 {
953 case WeaponActions.INTERRUPT: return "Weapon interrupt";
954 case WeaponActions.NONE: return "---";
955 case WeaponActions.RELOAD: return typename.EnumToString(WeaponActionReloadTypes, AT);
956 case WeaponActions.MECHANISM: return typename.EnumToString(WeaponActionMechanismTypes, AT);
957 case WeaponActions.CHAMBERING: return typename.EnumToString(WeaponActionChamberingTypes, AT);
958 case WeaponActions.CHAMBERING_LOADER: return typename.EnumToString(WeaponActionChamberingLoaderTypes, AT);
959 case WeaponActions.UNJAMMING: return typename.EnumToString(WeaponActionUnjammingTypes, AT);
960 case WeaponActions.FIRE: return typename.EnumToString(WeaponActionFireTypes, AT);
961 case WeaponActions.HIDE: return typename.EnumToString(WeaponHideShowTypes, AT);
962 case WeaponActions.SHOW: return typename.EnumToString(WeaponHideShowTypes, AT);
963 }
964 return "---";
965}
966
994
995
996// *************************************************************************************
997// ! HumanCommandWeapons - weapon handling
998// *************************************************************************************
1000{
1001 private void HumanCommandWeapons() {}
1002 private void ~HumanCommandWeapons() {}
1003
1005 proto native bool IsActionFinished();
1006
1008 proto native int GetRunningAction();
1009
1011 proto native int GetRunningActionType();
1012
1014 proto native void SetActionProgressParams(float pStart, float pEnd);
1015
1017 proto native bool StartAction(WeaponActions pAction, int pActionType);
1018
1020 proto native void RegisterEvent(string pName, int pId);
1021
1023 proto native int IsEvent();
1024
1027
1029 proto native void SetADS(bool pState);
1030
1032 proto native void LiftWeapon(bool pState);
1033
1035 proto native bool IsWeaponLifted();
1036
1038 proto native void ObstructWeapon(float pState01);
1039
1041 proto native float GetWeaponObstruction();
1042
1044 proto native float GetAimingHandsOffsetUD();
1045
1047 proto native float GetAimingHandsOffsetLR();
1048
1051 {
1052 RegisterEvent("Weapon_AttachmentHide", WeaponEvents.ATTACHMENT_HIDE);
1053 RegisterEvent("Weapon_AttachmentShow", WeaponEvents.ATTACHMENT_SHOW);
1054 RegisterEvent("Weapon_BulletEject", WeaponEvents.BULLET_EJECT);
1055 RegisterEvent("Weapon_BulletHide", WeaponEvents.BULLET_HIDE);
1056 RegisterEvent("Weapon_BulletHide2", WeaponEvents.BULLET_HIDE2);
1057 RegisterEvent("Weapon_BulletInChamber", WeaponEvents.BULLET_IN_CHAMBER);
1058 RegisterEvent("Weapon_BulletInMagazine", WeaponEvents.BULLET_IN_MAGAZINE);
1059 RegisterEvent("Weapon_BulletShow", WeaponEvents.BULLET_SHOW);
1060 RegisterEvent("Weapon_BulletShow2", WeaponEvents.BULLET_SHOW2);
1061 RegisterEvent("Weapon_CanUnjam_End", WeaponEvents.CANUNJAM_END);
1062 RegisterEvent("Weapon_CanUnjam_Start", WeaponEvents.CANUNJAM_START);
1063 RegisterEvent("Weapon_Cocked", WeaponEvents.COCKED);
1064 RegisterEvent("Weapon_MagazineAttached", WeaponEvents.MAGAZINE_ATTACHED);
1065 RegisterEvent("Weapon_MagazineDetached", WeaponEvents.MAGAZINE_DETACHED);
1066 RegisterEvent("Weapon_MagazineHide", WeaponEvents.MAGAZINE_HIDE);
1067 RegisterEvent("Weapon_MagazineShow", WeaponEvents.MAGAZINE_SHOW);
1068 RegisterEvent("Weapon_SliderOpen", WeaponEvents.SLIDER_OPEN);
1069 RegisterEvent("Weapon_Unjammed", WeaponEvents.UNJAMMED);
1070 RegisterEvent("Weapon_Hammer_Uncocked", WeaponEvents.HAMMER_UNCOCKED);
1071 RegisterEvent("Weapon_Hammer_Cocked", WeaponEvents.HAMMER_COCKED);
1072 RegisterEvent("Weapon_Change_Hide", WeaponEvents.CHANGE_HIDE);
1073 RegisterEvent("Weapon_Change_Show", WeaponEvents.CHANGE_SHOW);
1074 RegisterEvent("Weapon_CylinderRotate", WeaponEvents.CYLINDER_ROTATE);
1075 }
1076
1077 //----------------------------------------------------
1078 // weapon init states
1079
1080
1085 proto native void SetInitState(int pFrameIndex);
1086
1088 proto native static void StaticSetInitState(Human pHuman, int pFrameIdx);
1089
1090
1091 //----------------------------------------------------
1092 //
1093
1095 proto native float GetBaseAimingAngleUD();
1096
1098 proto native float GetBaseAimingAngleLR();
1099
1100
1101 //----------------------------------------------------
1102 // throwing
1103 proto native void SetThrowingMode(bool pState);
1104
1105 proto native bool IsThrowingMode();
1106
1107 proto native void ThrowItem(int throwType);
1108
1109 proto native bool WasItemLeaveHandsEvent();
1110
1111 //----------------------------------------------------
1112 // debug copy
1113
1115 proto native int DebugIsEvent();
1116
1118 proto native void DebugResetEvents();
1119}
1120
1121
1122// *************************************************************************************
1123// ! HumanCommandAdditives - additional damage
1124// *************************************************************************************
1126{
1127 private void HumanCommandAdditives() {}
1128 private void ~HumanCommandAdditives() {}
1131 proto native void SetInjured(float pValue, bool pInterpolate);
1134 proto native void SetExhaustion(float pValue, bool pInterpolate);
1135
1137 proto native void SetTalking(bool pValue);
1140 proto native void StartModifier(int pType);
1143 proto native void CancelModifier();
1146 proto native bool IsModifierActive();
1148
1149
1150// *************************************************************************************
1151// ! HumanMovementState - movement state, command, stance, movement, human.GetMovementState(movementState)
1152// *************************************************************************************
1154{
1161
1164 {
1165 return m_iStanceIdx >= DayZPlayerConstants.STANCEIDX_RAISEDERECT;
1166 }
1167
1170 {
1171 return m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDPRONE;
1172 }
1173
1176 {
1177 return m_iStanceIdx == DayZPlayerConstants.STANCEIDX_PRONE;
1178 }
1179
1182 {
1183 return m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDPRONE;
1184 }
1185
1188 {
1189 return m_fLeaning != 0;
1190 }
1191}
1192
1193enum HumanRelativeHeadingMode
1194{
1197
1200};
1201
1203
1210{
1212 // HumanCommandScript(Human pHuman);
1213
1216 void OnActivate() { };
1217
1219 void OnDeactivate() { };
1220
1221
1222 //---------------------------------------------------------------
1223 // usable everywhere
1224
1226 proto native void SetFlagFinished(bool pFinished);
1227
1228#ifdef FEATURE_NETWORK_RECONCILIATION
1230 proto native void OverrideCorrectionType(AnimPhysCorrectionType correctionType);
1231#endif
1234 proto native void SetHeading(float yawAngle, float filterDt = -1, float maxYawSpeed = FLT_MAX);
1235 proto native void AddHeadingRelativeTo(HumanRelativeHeadingMode mode, float yawAngle, float filterDt = -1, float maxYawSpeed = FLT_MAX);
1239 {
1240 return DayZPlayerConstants.STANCEIDX_ERECT;
1241 }
1246 return DayZPlayerConstants.MOVEMENT_IDLE;
1247 }
1248
1251 {
1252 return 0.0;
1253 }
1254
1255 //---------------------------------------------------------------
1256 // PreAnim Update
1257
1261 void PreAnimUpdate(float pDt);
1262
1264 proto native void PreAnim_CallCommand(int pCommand, int pParamInt, float pParamFloat);
1265 proto native void PreAnim_SetFloat(int pVar, float pFlt);
1266 proto native void PreAnim_SetInt(int pVar, int pInt);
1267 proto native void PreAnim_SetBool(int pVar, bool pBool);
1268
1269 void PreAnim_SetFilteredHeading(float pYawAngle, float pFilterDt, float pMaxYawSpeed)
1270 {
1271 SetHeading(pYawAngle, pFilterDt, pMaxYawSpeed);
1272 }
1273
1274 //---------------------------------------------------------------
1275 // PrePhys Update
1276
1279 void PrePhysUpdate(float pDt);
1280
1282 proto native bool PrePhys_IsEvent(int pEvent);
1283 proto native bool PrePhys_IsTag(int pTag);
1284 proto native bool PrePhys_GetTranslation(out vector pOutTransl); // vec3 in local space !
1285 proto native bool PrePhys_GetRotation(out float pOutRot[4]); // quaternion in local space !
1286 proto native void PrePhys_SetTranslation(vector pInTransl); // vec3 in local space !
1287 proto native void PrePhys_SetRotation(float pInRot[4]); // quaternion in local space !
1288
1289 //---------------------------------------------------------------
1290 // PostPhys Update
1291
1295 bool PostPhysUpdate(float pDt);
1296
1298 proto native void PostPhys_GetPosition(out vector pOutTransl);
1299 proto native void PostPhys_GetRotation(out float pOutRot[4]);
1300 proto native void PostPhys_SetPosition(vector pInTransl);
1301 proto native void PostPhys_SetRotation(float pInRot[4]);
1302 proto native void PostPhys_LockRotation();
1303}
1304
1306enum HumanMoveCommandID
1307{
1308 None = 0,
1323}
1324
1325class HumanType : ManType
1326{
1328
1329// *************************************************************************************
1330// ! Human - human script interface
1331// *************************************************************************************
1332class Human : Man
1333{
1335
1337 proto native void GetTransformWS(out vector pTm[4]);
1338
1341 proto native void PhysicsGetTransformWS(out vector pTm[4]);
1342
1344 proto native void PhysicsGetTransformLS(out vector pTm[4]);
1345
1349
1352
1354 proto native bool CheckFreeSpace(vector localDir, float distance, bool useHeading, vector posOffset = vector.Zero, float xzScale = 1.0);
1355
1357 proto float CollisionMoveTest(vector dir, vector offset, float xzScale, IEntity ignoreEntity, out IEntity hitEntity, out vector hitPosition, out vector hitNormal);
1358
1359 //---------------------------------------------------------
1360 // link/unlink to/from local space (enfusion hierachy)
1361 proto native void LinkToLocalSpaceOf(notnull IEntity child, vector pLocalSpaceMatrix[4]);
1362 proto native void UnlinkFromLocalSpace();
1363
1364 //---------------------------------------------------------
1365 // heading component
1366
1368 proto native void AlignPositionWS(vector position);
1369
1371 proto native void AlignTranslationWS(vector translation);
1372
1374 proto native void AlignTranslationLS(vector translation);
1375
1377 proto native void AlignDirectionWS(vector direction);
1378
1381 void OnPhysMove(float dt, vector transform[4]) {}
1382
1383 //---------------------------------------------------------
1384 // bone transforms
1385
1387 proto native int GetBoneIndexByName(string pBoneName);
1388
1389
1392
1393 //---------------------------------------------------------
1394 // physic props
1395
1397 proto native bool PhysicsIsFalling(bool pValidate);
1398
1401
1404
1408
1410 proto native void PhysicsGetVelocity(out vector pVelocity);
1411
1412 proto native void PhysicsEnableGravity(bool pEnable);
1413
1414 proto native bool PhysicsIsSolid();
1415 proto native void PhysicsSetSolid(bool pSolid);
1416
1418 proto native void PhysicsSetRagdoll(bool pEnable);
1419
1420 //---------------------------------------------------------
1421 // controller
1422
1425
1426 //---------------------------------------------------------
1427 // item accessor
1428
1430
1431
1432 //---------------------------------------------------------
1433 // commands
1434
1436 proto native void GetMovementState(HumanMovementState pState);
1437
1439 proto native int GetCurrentCommandID();
1440
1441
1443
1446
1448
1450
1453
1455
1457 proto native HumanCommandMelee2 StartCommand_Melee2(EntityAI pTarget, int pHitType, float pComboValue, vector hitPos = vector.Zero);
1458
1460
1461
1463
1467 proto native HumanCommandFall StartCommand_Fall(float pYVelocity);
1468
1471
1472
1474
1476 proto native HumanCommandLadder StartCommand_Ladder(Building pBuilding, int pLadderIndex);
1477
1479
1480
1482
1485
1487
1488
1490
1492 proto native HumanCommandVehicle StartCommand_Vehicle(Transport pTransport, int pTransportPositionIndex, int pVehicleSeat, bool fromUnconscious = false);
1493
1495
1496
1498
1500 proto native HumanCommandClimb StartCommand_Climb(SHumanCommandClimbResult pClimbResult, int pType);
1501
1503
1505
1507 proto native HumanCommandDeathCallback StartCommand_Death(int pType, float pDirection, typename pCallbackClass, bool pKeepInLocalSpaceAfterLeave = false);
1508
1510
1511
1514
1516
1517
1519
1521 // -> of type 0,...
1522 // -> from direction (lback -180,left -90,0,righ 90,rightback 180)
1523 proto native HumanCommandFullBodyDamage StartCommand_Damage(int pType, float pDirection);
1524
1526
1527
1528
1530
1533 proto native HumanCommandActionCallback StartCommand_Action(int pActionID, typename pCallbackClass, int pStanceMask);
1534
1537
1538
1539 //---------------------------------------------------------
1540 // command modifiers
1541
1543 proto native int GetCommandModifierCount();
1544
1546 proto native int GetCommandModifierID(int pIndex);
1547
1548
1550
1553
1556
1557
1558
1559
1560 // --- modifier/additive actions - played on COMMANDID_MOVE command
1561
1563 proto native HumanCommandActionCallback AddCommandModifier_Action(int pActionID, typename pCallbackClass);
1564
1567
1570
1571
1572
1574
1576 // -> of type 0,...
1577 // -> from direction (lback -180,left -90,0,righ 90,rightback 180)
1578 proto native HumanCommandDamage AddCommandModifier_Damage(int pType, float pDirection);
1579
1581
1583
1584
1586
1590 proto native HumanCommandScript StartCommand_ScriptInst(typename pCallbackClass);
1591
1594
1595
1596
1597 //---------------------------------------------------------
1598 // debug info for Item Accessor
1599
1600
1602 proto native owned string DebugGetItemClass();
1603
1605 proto native owned string DebugGetItemSuperClass();
1606
1608 proto native owned string DebugGetItemAnimInstance();
1609
1610
1611 //---------------------------------------------------------
1612 // helper functions for disabling simulation upon death
1613 proto native void StartDeath();
1614 proto native void ResetDeath();
1615
1616 proto native void ResetDeathCooldown();
1617 proto native bool IsDeathProcessed();
1618 proto native bool IsDeathConditionMet();
1619
1620
1621 //--------------------------------------------------------
1622 // commands start/finish events
1623
1626
1629
1632
1635
1638
1641
1644
1647
1650
1653
1656
1659
1662
1665
1667 void OnStanceChange(int previousStance, int newStance);
1668
1670 bool CanChangeStance(int previousStance, int newStance);
1671
1672 //--------------------------------------------------------
1673 // rolling API
1674
1675 bool CanRoll();
1676 void OnRollStart(bool isToTheRight);
1678
1679 //--------------------------------------------------------
1680 // vehicle API
1681
1684
1685 proto native bool IsControllingVehicle();
1686
1687}
Super root of all classes in Enforce script.
Definition enscript.c:11
proto native TAnimGraphVariable BindVariableFloat(string pVariable)
proto native TAnimGraphEvent BindEvent(string pEventName)
proto native TAnimGraphVariable BindVariableBool(string pVariable)
proto native TAnimGraphCommand BindCommand(string pCommandName)
returns command index -
void ~HumanAnimInterface()
proto native TAnimGraphTag BindTag(string pTagName)
proto native TAnimGraphVariable BindVariableInt(string pVariable)
override void OnAnimationEvent(int pEventID)
override void OnStateChange(int pOldState, int pCurrentState)
override void OnFinish(bool pCanceled)
Definition statecb.c:8
override bool IsSymptomCallback()
Definition statecb.c:35
command itself
Definition human.c:773
proto static native bool DoClimbTest(Human pHuman, SHumanCommandClimbResult pResult, int pDebugDrawLevel)
debug draws climb heauristics pDebugDrawLevel viz DebugDrawClimb use for performing arbitrary climb t...
proto static native bool DoPerformClimbTest(Human pHuman, SHumanCommandClimbResult pResult, int pDebugDrawLevel)
debug draws climb heauristics pDebugDrawLevel viz DebugDrawClimb use this test before performing the ...
proto native vector GetClimbOverStandPointWS()
returns world space position of landspot after climbing over
proto static native bool DebugDrawClimb(Human pHuman, int pLevel)
debug draws climb heauristics int pLevel = 1 result, 2 - capsules (3 - all)
void HumanCommandClimb()
Definition human.c:774
proto native vector GetGrabPointWS()
returns world space position of climbing grab point
void ~HumanCommandClimb()
Definition human.c:775
proto native int GetState()
returns the state of climb (enum value of ClimbStates);
bool ShouldSimulationBeDisabled()
'OnSimulationEnd' is called before this
Definition human.c:603
proto native bool CanExit()
returns true if on exiting point
proto static native int DebugGetLadderIndex(string pComponentName)
void HumanCommandLadder()
Definition human.c:646
proto native void Exit()
proto static native bool DebugDrawLadder(Building pBuilding, int pLadderIndex)
debug draws any ladder
proto native vector GetLogoutPosition()
returns the safe logout position in worldspace the position is closest to the last possible exit poin...
void ~HumanCommandLadder()
Definition human.c:647
void ~HumanCommandMelee2()
Definition human.c:539
static const int HIT_TYPE_HEAVY
Definition human.c:542
proto native bool WasHit()
is true only once after hit event
static const int HIT_TYPE_LIGHT
Definition human.c:541
static const int HIT_TYPE_FINISHER
Definition human.c:543
proto native void Cancel()
cancels command melee and goes to HumanCommandMove
proto native int GetComboCount()
proto native bool IsFinisher()
static const int HIT_TYPE_FINISHER_NECK
Definition human.c:544
proto native void ContinueCombo(bool pHeavyHit, float pComboValue, EntityAI target=null, vector hitPos=vector.Zero)
marks command to continue to combo
proto native int GetCurrentHitType()
proto native bool IsInComboRange()
returns true if hit is in range, where person can continue to combo
proto native bool IsOnBack()
is on back in prone stance?
void HumanCommandMelee2()
Definition human.c:538
void HumanCommandMove()
Definition human.c:435
proto native void SetCurrentWaterLevel(float value)
sets water level (depth)
proto bool GetCurrentInputAngle(out float pAngle)
direction held on keyboard/controller -180 -90 0 90 180 angles of input movement (no filtering,...
proto native void StartMeleeEvadeA(float pDirAngle)
marks command to continue to combo, pDirAngle specifies angle
proto native void SetDirectionSprintFilterModifier(float value)
sets the multiplier for SHumanCommandMoveSettings::m_fDirFilterSprintTimeout
proto native void SetRunSprintFilterModifier(float value)
sets the multiplier for SHumanCommandMoveSettings::m_fRunSpringTimeout
proto native bool IsStandingFromBack()
return true if prone on back is chaning to crounch/stand
proto native bool IsInRoll()
return true if character barrel rolling
proto native float GetCurrentMovementAngle()
marks command to continue to combo -180 -90 0 90 180 angles of current movement
proto native void StartMeleeEvade()
marks command to continue to combo
proto native void SetDirectionFilterModifier(float value)
sets the multiplier for SHumanCommandMoveSettings::m_fDirFilterTimeout
proto native float GetCurrentMovementSpeed()
0,1,2..3 idle, walk, run, sprint
proto native void ForceStance(int pStanceIdx)
pStanceIds is one of STANCEIDX_ERECT,STANCEIDX_CROUCH,STANCEIDX_PRONE,STANCEIDX_RAISEDERECT,...
proto native bool IsChangingStance()
returns true if character is changing stance
proto native void ForceStanceUp(int pStanceIdx)
pStanceIds is one of STANCEIDX_ERECT,STANCEIDX_CROUCH this forces to stand up to required stance
proto native void SetMeleeBlock(bool pBlock)
this enables/disables block
proto native void SetTurnSpanModifier(float value)
sets the multiplier for HumanItemBehaviorCfg::m_fMoveHeadingFilterSpan
proto native bool IsMeleeEvade()
this is true when in melee evade
proto native bool IsOnBack()
return true if prone is on back
proto native void SetTurnSpanSprintModifier(float value)
sets the multiplier for HumanItemBehaviorCfg::m_fMoveHeadingSprintFilterSpan
void ~HumanCommandMove()
Definition human.c:436
proto native bool IsLeavingUncon()
return true if character transitions out of uncon
HumanCommandScript fully scriptable command.
Definition human.c:1210
proto native void PrePhys_SetRotation(float pInRot[4])
void OnActivate()
constructor must have 1st parameter to be Human
Definition human.c:1216
bool PostPhysUpdate(float pDt)
override this ! final adjustment of physics state (after physics was applied) returns true if command...
proto native bool PrePhys_IsEvent(int pEvent)
script function usable in PrePhysUpdate
proto native void PostPhys_SetPosition(vector pInTransl)
quaternion in world space
proto native bool PrePhys_IsTag(int pTag)
void OnDeactivate()
called when command ends
Definition human.c:1219
proto native void SetHeading(float yawAngle, float filterDt=-1, float maxYawSpeed=FLT_MAX)
sets character rotation (heading) (PreAnim/PrePhys only!)
proto native void PreAnim_SetBool(int pVar, bool pBool)
proto native void PreAnim_SetInt(int pVar, int pInt)
proto native bool PrePhys_GetRotation(out float pOutRot[4])
proto native void PreAnim_SetFloat(int pVar, float pFlt)
void PreAnimUpdate(float pDt)
override this ! called before any animation is processed here change animation values,...
proto native void SetFlagFinished(bool pFinished)
this terminates human command script and shows CommandHandler( ... pCurrentCommandFinished == true );
proto native void PreAnim_CallCommand(int pCommand, int pParamInt, float pParamFloat)
function usable in PreAnimUpdate or in !!! OnActivate !!!
proto native void PostPhys_GetRotation(out float pOutRot[4])
vec3 in world space
proto native bool PrePhys_GetTranslation(out vector pOutTransl)
void PrePhysUpdate(float pDt)
override this ! after animation is processed, before physics is processed
proto native void PostPhys_SetRotation(float pInRot[4])
vec3 in world space
proto native void PrePhys_SetTranslation(vector pInTransl)
void PreAnim_SetFilteredHeading(float pYawAngle, float pFilterDt, float pMaxYawSpeed)
Definition human.c:1269
float GetCurrentLeaning()
Override this to return the current leaning state of the human. <-1, 1>.
Definition human.c:1250
proto native void AddHeadingRelativeTo(HumanRelativeHeadingMode mode, float yawAngle, float filterDt=-1, float maxYawSpeed=FLT_MAX)
int GetCurrentMovement()
Override this to return the current movement state of the human.
Definition human.c:1244
proto native void PostPhys_LockRotation()
quaternion in world space
int GetCurrentStance()
Override this to return the current stance of the human.
Definition human.c:1238
proto native void PostPhys_GetPosition(out vector pOutTransl)
script function usable in PostPhysUpdate
void HumanCommandUnconscious()
Definition human.c:621
proto native void WakeUp(int targetStance=-1)
proto native bool IsInWater()
void ~HumanCommandUnconscious()
Definition human.c:622
proto native bool IsOnLand()
proto native bool IsWakingUp()
proto native void KnockedOutVehicle()
proto native void KeepInVehicleSpaceAfterLeave(bool pState)
proto native Transport GetTransport()
proto native void GetOutVehicle()
void HumanCommandVehicle()
Definition human.c:691
proto native bool IsGettingIn()
proto native bool IsSwitchSeat()
proto native void SwitchSeat(int pTransportPositionIndex, int pVehicleSeat)
proto native void ProcessLeaveEvents()
proto native void SetClutchState(bool pState)
proto native int GetVehicleSeat()
proto native bool WasGearChange()
void ~HumanCommandVehicle()
Definition human.c:692
proto native int GetVehicleType()
proto native int GetVehicleClass()
proto native bool IsGettingOut()
proto native void JumpOutVehicle()
bool IsObjectIgnoredOnGettingOut(IEntity entity)
Definition human.c:713
proto native bool ShouldBeKnockedOut()
proto native void SetVehicleType(int pVehicleType)
proto native void LiftWeapon(bool pState)
command for lifting weapon near obstacles (works only when weapon is raised)
proto native bool WasItemLeaveHandsEvent()
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
proto native void ThrowItem(int throwType)
proto native bool IsActionFinished()
proto native void DebugResetEvents()
proto native bool IsWeaponLifted()
return if lifting weapon is active
proto native void SetActionProgressParams(float pStart, float pEnd)
sets start and end animation position - f.e. for reload clip action
proto native void SetThrowingMode(bool pState)
proto native bool IsThrowingMode()
proto native void SetInitState(int pFrameIndex)
this sets to a weapon init state each weapon has a different weapon state those states are defined by...
proto native float GetWeaponObstruction()
return obstruction value
proto native int IsEvent()
return -1 when there is no event, otherwise it returns pId of event from animation
void RegisterDefaultEvents()
Definition human.c:1050
proto native float GetAimingHandsOffsetLR()
returns aiming hands left/right (x) offset angle
proto native int DebugIsEvent()
return -1 when there is no event, otherwise it returns pId of event from animation
proto native void RegisterEvent(string pName, int pId)
register events
void HumanCommandWeapons()
Definition human.c:1001
proto native float GetBaseAimingAngleUD()
returns base aiming angle UD - without sway/offsets/...
proto native float GetAimingHandsOffsetUD()
returns aiming hands up/down (y) offset angle
proto native float GetBaseAimingAngleLR()
returns base aiming angle LR - without sway/offsets/...
proto native bool IsInWeaponReloadBulletSwitchState()
returns true when clip visual change is needed for reload clip action
void ~HumanCommandWeapons()
Definition human.c:1002
proto native void SetADS(bool pState)
sets head tilt to optics
proto native bool StartAction(WeaponActions pAction, int pActionType)
start reload,mechanism,chambering,unjam ...
proto native void ObstructWeapon(float pState01)
command for obstruction weapon near obstacles
proto native int GetRunningActionType()
returns -1 when no action is running or appropriate action type
proto static native void StaticSetInitState(Human pHuman, int pFrameIdx)
just static version of SetInitState
proto native void AlignTranslationWS(vector translation)
adds the translation to the current position and then calls AlignPositionWS - do not handle replay,...
proto native void GetMovementState(HumanMovementState pState)
returns movement state (current command id, )
void OnCommandMoveStart()
proto native void AlignTranslationLS(vector translation)
adds the translation to the current position in heading space and then calls AlignPositionWS - do not...
bool CanChangeStance(int previousStance, int newStance)
Called by code to see if it can.
proto native void GetTransformWS(out vector pTm[4])
world space - local space - heading space
proto native int GetCurrentCommandID()
returns current command ID (see DayZPlayerConstants.COMMANDID_...)
proto native HumanCommandDamage GetCommandModifier_Damage()
void OnCommandMeleeFinish()
void OnCommandActionAdditiveFinish()
proto native HumanCommandDamage AddCommandModifier_Damage(int pType, float pDirection)
— modifier for light Damages
proto native HumanCommandMelee2 GetCommand_Melee2()
void OnVehicleSeatDriverEnter()
proto native owned string DebugGetItemAnimInstance()
returns current item's animation instance
proto native void PhysicsGetTransformWS(out vector pTm[4])
gets human transform in world space Note: Value is not cached and it is recomputed every call if ther...
proto native HumanCommandVehicle StartCommand_Vehicle(Transport pTransport, int pTransportPositionIndex, int pVehicleSeat, bool fromUnconscious=false)
--— VEHICLE --—
void OnCommandDeathStart()
proto native void PhysicsGetTransformLS(out vector pTm[4])
gets human transform in local space to parent/linked
proto native HumanCommandScript StartCommand_ScriptInst(typename pCallbackClass)
proto native vector PhysicsGetPositionLS()
gets human position in local space to parent/linked
void OnCommandDamageAdditiveFinish()
proto native bool IsControllingVehicle()
proto native HumanCommandClimb GetCommand_Climb()
proto native HumanCommandMelee2 StartCommand_Melee2(EntityAI pTarget, int pHitType, float pComboValue, vector hitPos=vector.Zero)
starts command - melee2
void OnCommandVehicleFinish()
proto native void PhysicsGetVelocity(out vector pVelocity)
outs pVelocity - linear velocity of PHYSICS CONTROLLER
proto float CollisionMoveTest(vector dir, vector offset, float xzScale, IEntity ignoreEntity, out IEntity hitEntity, out vector hitPosition, out vector hitNormal)
makes test if character can physically move in given world space direction - length of dir means dist...
void OnCommandSwimFinish()
proto native HumanCommandMove GetCommand_Move()
proto native HumanCommandDeathCallback GetCommand_Death()
proto native HumanCommandActionCallback GetCommand_Action()
is human is in command action - returns its callback, if current command is action
void OnCommandClimbStart()
proto native HumanCommandMelee StartCommand_Melee(EntityAI pTarget)
--— MELEE --—
proto native vector PhysicsGetPositionWS()
gets human position in world space Note: Value is not cached and it is recomputed every call if there...
proto native HumanCommandMelee GetCommand_Melee()
proto native HumanCommandFall StartCommand_Fall(float pYVelocity)
--— FALL --—
proto native HumanCommandMove StartCommand_Move()
--— MOVE --—
void OnRollFinish()
void OnVehicleSeatDriverLeft()
void OnCommandActionAdditiveStart()
void OnCommandFallFinish()
proto native void PhysicsSetSolid(bool pSolid)
proto native bool PhysicsIsFalling(bool pValidate)
returns true if physics controller is falling
proto native int GetCommandModifierID(int pIndex)
returns COMMANDID_ .. type id of command modifier on index pIndex
void OnCommandMelee2Start()
void OnCommandDamageAdditiveStart()
proto native HumanCommandFullBodyDamage StartCommand_Damage(int pType, float pDirection)
--— FullBody Damages --—
proto native void DeleteCommandModifier_Action(HumanCommandActionCallback pCallback)
force remove - normally if action is ended or interrupted - this is not needed to call
proto native HumanCommandActionCallback GetCommandModifier_Action()
returns callback for action if any is active, null if nothing runs
proto native HumanCommandWeapons GetCommandModifier_Weapons()
returns interface for handling weapons
proto native HumanCommandVehicle GetCommand_Vehicle()
proto native HumanCommandActionCallback StartCommand_Action(int pActionID, typename pCallbackClass, int pStanceMask)
--— ACTIONS --—
proto native HumanCommandSwim GetCommand_Swim()
proto native owned string DebugGetItemClass()
returns current item's class name
proto native owned string DebugGetItemSuperClass()
returns current item's class that is found in config
proto native void DeleteCommandModifier_Damage(HumanCommandDamage pDamage)
proto native HumanCommandFall GetCommand_Fall()
proto native bool IsDeathProcessed()
void OnCommandMeleeStart()
proto native HumanCommandActionCallback AddCommandModifier_Action(int pActionID, typename pCallbackClass)
adds action command modifier, creates callback instance for you
void OnCommandLadderFinish()
proto native IEntity PhysicsGetLinkedEntity()
entity we are linked to (not valid when IEntity.GetParent() returns some entity)
void OnCommandFallStart()
void OnCommandUnconsciousStart()
proto native HumanCommandUnconscious GetCommand_Unconscious()
void OnPhysMove(float dt, vector transform[4])
callback before the transform is finalized, after PrePhys, called before alignment is applied
Definition human.c:1381
proto native int GetBoneIndexByName(string pBoneName)
returns bone index for a name (-1 if pBoneName doesn't exist)
proto native void LinkToLocalSpaceOf(notnull IEntity child, vector pLocalSpaceMatrix[4])
bool CanRoll()
proto native HumanCommandDeathCallback StartCommand_Death(int pType, float pDirection, typename pCallbackClass, bool pKeepInLocalSpaceAfterLeave=false)
--— Death --—
proto native void PhysicsEnableGravity(bool pEnable)
proto native void ResetDeath()
proto native HumanCommandLadder GetCommand_Ladder()
proto native void StartDeath()
proto native bool PhysicsWasSlidingOffLinkedEntity()
if the entity we are on was moving faster than it's defined config 'animPhysDetachSpeed' value It is ...
proto native void UnlinkFromLocalSpace()
proto native int GetCommandModifierCount()
void OnCommandDamageFullbodyFinish()
proto native HumanCommandFullBodyDamage GetCommand_Damage()
proto native HumanAnimInterface GetAnimInterface()
returns animation interface - usable in HumanCommandScript implementations
proto native void ResetDeathCooldown()
void OnCommandLadderStart()
proto native HumanCommandUnconscious StartCommand_Unconscious(float pType)
starts command - unconscious
proto native void PhysicsSetRagdoll(bool pEnable)
Sets and synchronize interaction layers 'RAGDOLL' and 'RAGDOLL_NO_CHARACTER' to prevent body stacking...
void OnCommandMelee2Finish()
void OnCommandVehicleStart()
proto native void AlignPositionWS(vector position)
smoothly move the player to the target position - do not handle replay, performed internally
proto native HumanCommandClimb StartCommand_Climb(SHumanCommandClimbResult pClimbResult, int pType)
--— CLIMB --—
void OnCommandMoveFinish()
void OnCommandDeathFinish()
proto native HumanInputController GetInputController()
returns human input controller
void OnRollStart(bool isToTheRight)
proto native HumanCommandSwim StartCommand_Swim()
--— LADDER --—
void OnStanceChange(int previousStance, int newStance)
gets called on stance change
proto native HumanItemAccessor GetItemAccessor()
void OnCommandDamageFullbodyStart()
proto native HumanCommandLadder StartCommand_Ladder(Building pBuilding, int pLadderIndex)
--— LADDER --—
void OnCommandSwimStart()
proto native HumanCommandAdditives GetCommandModifier_Additives()
default (always-on modifiers)
void OnCommandUnconsciousFinish()
proto native IEntity PhysicsGetFloorEntity()
entity below us
proto native bool CheckFreeSpace(vector localDir, float distance, bool useHeading, vector posOffset=vector.Zero, float xzScale=1.0)
makes test if there's enough space for character's collider assuming that character can be pushed awa...
proto native bool PhysicsIsSolid()
proto native HumanCommandScript GetCommand_Script()
is human is in command action - returns its callback, if current command is action
void OnCommandClimbFinish()
proto native HumanCommandScript StartCommand_Script(HumanCommandScript pHumanCommand)
— SCRIPTED COMMANDS
void OnCommandActionFullbodyFinish()
void OnCommandActionFullbodyStart()
proto native bool IsDeathConditionMet()
proto native void AlignDirectionWS(vector direction)
smoothly move the player to face the target direction - do not handle replay, performed internally
proto native void OverrideRaise(HumanInputControllerOverrideType overrideType, bool value)
proto native bool IsContinuousUseStart()
is start of cont. 'UADefaultAction' (== true for 1 tick only) + not raised
proto native bool IsUseButton()
Deprecated; returns true if Use/Attack button is pressed (== true for multiple ticks).
proto native vector GetAimDelta(float dt)
returns aim change (in radians)
proto native int IsMeleeLREvade()
returns 0,1,2 = none,left,right
proto native void ResetHoldBreath()
reset hold breath toggle
proto native float GetHeadingAngle()
returns main heading angle (in radians) -PI .. PI (this is world Y angle player is actualy pointing t...
proto native bool IsUseButtonDown()
Deprecated; returns true if Use/Attack button has just been pressed (== true for 1 tick only).
proto native vector GetAimChange()
returns per tick aim change (in radians)
proto native void OverrideMovementSpeed(HumanInputControllerOverrideType overrideType, float value)
proto native bool IsQuickBarContinuousUseEnd()
is end of cont use (== true for 1 tick only) long quickbar + not raised !
proto native void OverrideMeleeEvade(HumanInputControllerOverrideType overrideType, bool value)
proto native void OverrideMovementAngle(HumanInputControllerOverrideType overrideType, float value)
proto native bool IsWalkToggled()
returns true if Walk set to toggle
proto native bool Camera3rdIsRightShoulder()
returns true if camera is on right/ false-left shoulder
proto native bool CameraIsTracking()
returns if camera is tracking (using IR device)
proto native bool IsStanceChange()
stance change button was pressed
proto native bool IsZoomOut()
proto native bool IsUseItemButtonDown()
returns true if 'UADefaultAction' button has just been pressed (== true for 1 tick only)....
proto native int IsGestureSlot()
returns 1..12 if F1 - F12 us pressed, 0 otherwise Deprecated; slots no longer used,...
proto native bool IsAttackButton()
returns true if 'UAFire' button is pressed (== true for multiple ticks). Synced.
proto native void OverrideFreeLook(HumanInputControllerOverrideType overrideType, bool value)
proto native bool IsMeleeWeaponAttack()
return weapon melee attack modifier
proto native bool IsOtherController()
returns true, if player controls other entity (vehicle for example)
proto native void OverrideAimChangeY(HumanInputControllerOverrideType overrideType, float value)
proto native bool IsAttackButtonDown()
returns true if 'UAFire' button has just been pressed (== true for 1 tick only). Synced.
proto void GetMovement(out float pSpeed, out vector pLocalDirection)
returns pSpeed 0,1..2..3 (idle, walk, run, sprint), local normalized direction vector
proto native void LimitsDisableSprint(bool pDisable)
this disables sprint
proto native bool IsReloadOrMechanismContinuousUseStart()
R - reloading / bolting (== true for 1 tick only).
proto native bool IsZeroingUp()
zeroing up
proto native bool IsUseItemButton()
returns true if 'UADefaultAction' button is pressed (== true for multiple ticks). Synced.
proto native void ResetADS()
resets ADS mode to default
proto native bool WeaponADS()
returns true if weapon ADS mode
proto native bool IsQuickBarSingleUse()
single use (== true for 1 tick only) quickbar + not raised !
proto native bool IsQuickBarContinuousUseStart()
is start of cont use (== true for 1 tick only) long quickbar + not raised !
void HumanInputController()
never created by script
Definition human.c:261
proto native bool WeaponWasRaiseClick()
returns true if weapon click perfomed recently (before raise specifically)
proto native bool LimitsIsSprintDisabled()
is sprint disabled
proto native int IsQuickBarSlot()
returns 1..10 if some quickbar slot is used, 0 otherwise
proto native void Override3rdIsRightShoulder(HumanInputControllerOverrideType overrideType, bool value)
proto native void ResetZoomToggle()
reset zoom toggle
proto native void ResetFreeLookToggle()
reset freelook toggle
proto native bool IsZoomIn()
proto native bool CameraViewChanged()
1st/3rd person camera view
proto native bool IsContinuousUseEnd()
is end of cont. 'UADefaultAction' (== true for 1 tick only) + not raised
proto native bool IsFireModeChange()
fire mode has changed
proto native void ResetThrowingMode()
resets Throwing mode
proto native bool IsJumpClimb()
jump/climb action was pressed
proto native bool IsQuickBarContinuousUse()
Long click use (== true for multiple ticks) long quickbar + not raised !
proto native void SetDisabled(bool pState)
disables input controller
proto native bool IsSingleUse()
single 'UADefaultAction' (== true for 1 tick only) + not raised
proto native bool IsMeleeFastAttackModifier()
returns SHIFT down (melee fast/heavy) attack modifier
proto native void OverrideAimChangeX(HumanInputControllerOverrideType overrideType, float value)
proto native bool IsSightChange()
sight has been changed (in/out ironsights)
proto native bool IsReloadOrMechanismContinuousUseEnd()
R - reloading / bolting - long press (== true for multiple ticks).
proto native bool IsImmediateAction()
is immediate action triggered - 1 tick only Middle Button + not raised !
proto native bool IsContinuousUse()
Long click 'UADefaultAction' (== true for multiple ticks) + not raised.
proto native bool IsReloadOrMechanismContinuousUse()
R - reloading / bolting - long press (== true for multiple ticks).
proto native vector GetTracking()
returns absolute tracking change (in radians)
proto native bool IsReloadOrMechanismSingleUse()
weapon handling
void ~HumanInputController()
never created by script
Definition human.c:266
proto native bool IsHoldBreath()
holding breath
proto native bool IsZoomToggle()
zooming toggle
proto native bool IsMeleeEvade()
returns pressed SHIFT (melee evade)
proto native bool IsThrowingModeChange()
returns true if change of throwing mode has been requested
proto native bool CameraIsFreeLook()
returns true if freelook is active
proto native bool IsWeaponRaised()
returns true if weapon is raised
proto native bool IsZoom()
zooming
proto native bool IsZeroingDown()
zeroing down
int m_iStanceIdx
current command's id
Definition human.c:1156
int m_LocalMovement
leaning state (not all commands need to have all movements)
Definition human.c:1160
int m_iMovement
current stance (DayZPlayerConstants.STANCEIDX_ERECT, ...), only if the command has a stance
Definition human.c:1157
float m_fLeaning
current movement (0 idle, 1 walk, 2-run, 3-sprint), only if the command has a movement
Definition human.c:1158
bool IsRaisedInProne()
Definition human.c:1169
bool IsInRaisedProne()
Definition human.c:1181
Internal ancestor of all Entity implementations.
Definition enentity.c:165
Definition man.c:9
Native class for boats - handles physics simulation.
Definition boat.c:32
static const vector Zero
Definition enconvert.c:123
class DayZCreatureAnimInterface RegisterAnimationEvent(string event_name, string function_name)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
@ None
Definition enworld.c:73
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
@ A
Definition ensystem.c:345
@ NONE
body is not in simulation, nor in collision world
proto native Widget GetParent()
Get parent of the Effect.
Definition effect.c:422
@ DISABLED
Definition enwidgets.c:79
enum WeaponActions HumanCommandFullBodyDamage
Definition human.c:809
class HumanCommandScript CommandSwim
class HumanCommandScript CommandVehicle
int TAnimGraphVariable
Definition human.c:277
proto static native vector WaterLevelCheck(Human pHuman, vector pPosition)
returns water level from entity position returns in format (totalWaterDepth, characterDepht,...
static const int STATE_NONE
example of implement of CancelCondition returns true it it should CANCEL the action
Definition human.c:349
class HumanCommandScript CommandLadder
static const int STATE_LOOP_END2
Definition human.c:355
proto native void CancelModifier()
cancels modifier
proto native bool IsModifierActive()
is modifier active
enum WeaponActionReloadClipTypes MECHANISM_CLOSED_UNCOCKED
IEntity m_ClimbOverStandPointParent
Definition human.c:757
class HumanCommandMove HumanCommandMelee()
Definition human.c:513
static const int STATE_NORMAL
one time state
Definition human.c:360
proto native bool WasHit()
is true only once after hit event
void ~HumanCommandMelee()
Definition human.c:514
class HumanCommandScript CommandActionAdditive
static const int STATE_LOOP_IN
looped state
Definition human.c:352
class HumanCommandVehicle m_bIsClimb
result from static test
float m_fClimbHeight
Definition human.c:748
class HumanCommandLadder HumanCommandSwim()
Definition human.c:673
proto native void SetTalking(bool pValue)
sets talking
vector m_ClimbGrabPointNormal
grab point for climb && climb over (in local space of it's parent)
Definition human.c:751
proto native void StopSwimming()
static const int LANDTYPE_NONE
Definition human.c:577
static const int LANDTYPE_LIGHT
Definition human.c:578
WeaponActionReloadClipTypes
Definition human.c:861
@ RELOADRIFLE_CLIP_NOBULLET
Definition human.c:862
@ RELOADRIFLE_CLIP_BULLET
Definition human.c:863
static const int STATE_LOOP_END
Definition human.c:354
proto native void SetInjured(float pValue, bool pInterpolate)
sets injury level 0..1, interpolate == false -> resets the value, otherwise it's interpolating toward...
class HumanCommandUnconscious HumanCommandDamage()
Definition human.c:637
class HumanCommandScript CommandDamageFullbody
bool IsGestureCallback()
Definition human.c:418
proto native void SetExhaustion(float pValue, bool pInterpolate)
sets exhaustion level 0..1, interpolate == false -> resets the value, otherwise it's interpolating to...
void ~HumanCommandDamage()
Definition human.c:638
static const int LANDTYPE_MEDIUM
Definition human.c:579
proto native void SetAligning(vector pPositionWS, vector pDirectionWS)
enables character aligning to desired position and direction in world space
WeaponActionChamberingTypes
Definition human.c:876
@ CHAMBERING_DOUBLE_4
Definition human.c:901
@ CHAMBERING_ONEBULLET_CLOSED
Definition human.c:880
@ CHAMBERING_STARTLOOPABLE_CLOSED_EXTRA
Definition human.c:887
@ CHAMBERING_TWOBULLETS_END
Definition human.c:885
@ CHAMBERING_CROSSBOW_CLOSED
Definition human.c:905
@ CHAMBERING_STARTLOOPABLE_SHOTGUN_UNCOCKED
Definition human.c:895
@ CHAMBERING_END
Definition human.c:877
@ CHAMBERING_DOUBLE_2
Definition human.c:899
@ CHAMBERING_ENDLOOPABLE
Definition human.c:889
@ CHAMBERING_ONEBULLET_UNIQUE_OPENED
Definition human.c:882
@ CHAMBERING_CROSSBOW_OPENED
Definition human.c:904
@ CHAMBERING_ONEBULLET_OPENED
chambering action types
Definition human.c:879
@ CHAMBERING_STARTLOOPABLE_CLOSED_KEEP
Definition human.c:890
@ CHAMBERING_CROSSBOW_FULL
Definition human.c:906
@ CHAMBERING_STARTLOOPABLE_OPENED
Definition human.c:891
@ CHAMBERING_STARTLOOPABLE_CLOSED
Definition human.c:888
@ CHAMBERING_ONEBULLET_UNIQUE_CLOSED
Definition human.c:883
@ CHAMBERING_DOUBLE_FIREOUT_EJECT
Definition human.c:908
@ CHAMBERING_STARTLOOPABLE_SHOTGUN_COCKED
Definition human.c:896
@ CHAMBERING_DOUBLE_1
Definition human.c:898
@ CHAMBERING_DOUBLE_3
Definition human.c:900
@ CHAMBERING_STARTLOOPABLE_CLOSED_WITHCHAMBER
Definition human.c:893
@ CHAMBERING_ONEBULLET_CLOSED_UNCOCKED
Definition human.c:881
@ CHAMBERING_TWOBULLETS_START
Definition human.c:884
WeaponHideShowTypes
Definition human.c:936
@ HIDESHOW_SLOT_RFLRIGHTBACK
Definition human.c:941
@ HIDESHOW_SLOT_INVENTORY
Definition human.c:946
@ HIDESHOW_SLOT_2HDRIGHTBACK
Definition human.c:940
@ HIDESHOW_SLOT_RFLLEFTBACK
Definition human.c:938
@ HIDESHOW_SLOT_PISTOLCHEST
Definition human.c:944
@ HIDESHOW_SLOT_1HDRIGHTBACK
Definition human.c:942
@ HIDESHOW_SLOT_KNIFEBACK
Definition human.c:945
@ HIDESHOW_SLOT_PISTOLBELT
Definition human.c:943
@ HIDESHOW_SLOT_2HDLEFTBACK
Definition human.c:937
@ HIDESHOW_SLOT_1HDLEFTBACK
Definition human.c:939
class HumanCommandScript CommandUnconscious
bool m_bFinishWithFall
Definition human.c:745
bool m_bHasParent
Definition human.c:746
WeaponActions
actions
Definition human.c:816
@ UNJAMMING
Definition human.c:823
@ RELOAD_CLIP
Definition human.c:827
@ MECHANISM
Definition human.c:820
@ FIRE
Definition human.c:824
@ CHAMBERING
Definition human.c:821
@ HIDE
Definition human.c:825
@ CHAMBERING_LOADER
Definition human.c:822
@ INTERRUPT
Definition human.c:817
@ SHOW
Definition human.c:826
@ RELOAD
Definition human.c:819
class HumanCommandScript CommandDeath
proto native bool PhysicsLanded()
this is true when fall has physically landed - need to call Land after this is true
proto native void EnableCancelCondition(bool pEnable)
enables calling cancel condition default is disabled when enabled - there must be a function "bool Ca...
class HumanCommandDeathCallback HumanCommandDeath()
Definition human.c:611
WeaponEvents
events
Definition human.c:969
@ CHANGE_SHOW
Definition human.c:991
@ BULLET_SHOW
Definition human.c:977
@ ATTACHMENT_SHOW
Definition human.c:971
@ ATTACHMENT_HIDE
Definition human.c:970
@ MAGAZINE_SHOW
Definition human.c:985
@ CHANGE_HIDE
Definition human.c:990
@ BULLET_EJECT
Definition human.c:972
@ CYLINDER_ROTATE
Definition human.c:992
@ MAGAZINE_ATTACHED
Definition human.c:982
@ HAMMER_COCKED
Definition human.c:989
@ BULLET_IN_MAGAZINE
Definition human.c:976
@ UNJAMMED
Definition human.c:987
@ BULLET_SHOW2
Definition human.c:978
@ CANUNJAM_END
Definition human.c:979
@ CANUNJAM_START
Definition human.c:980
@ BULLET_HIDE
Definition human.c:973
@ HAMMER_UNCOCKED
Definition human.c:988
@ MAGAZINE_HIDE
Definition human.c:984
@ COCKED
Definition human.c:981
@ SLIDER_OPEN
Definition human.c:986
@ BULLET_IN_CHAMBER
Definition human.c:975
@ MAGAZINE_DETACHED
Definition human.c:983
@ BULLET_HIDE2
Definition human.c:974
bool IsUserActionCallback()
Definition human.c:413
vector m_ClimbGrabPoint
Definition human.c:750
string WeaponActionTypeToString(int A, int AT)
Definition human.c:949
void ~HumanCommandActionCallback()
class HumanMovementState INPUT
Actual input value.
int TAnimGraphTag
Definition human.c:278
class HumanCommandScript CommandClimb
static const int STATE_LOOP_ACTION
Definition human.c:357
enum WeaponActionReloadClipTypes MECHANISM_OPENED
mechanism action types
proto native void InternalCommand(int pInternalCommandId)
calls internal command pInternalCommandId is one of CMD_ACTIONINT_ ...
class HumanCommandScript CommandMove
WeaponActionChamberingLoaderTypes
Definition human.c:912
@ CHAMBERINGLOADER_CLOSED
Definition human.c:914
@ CHAMBERINGLOADER_OPENED
Definition human.c:913
proto native void EnableStateChangeCallback()
enables state change callback OnStateChange
enum WeaponActionReloadClipTypes MECHANISM_CLOSED
class HumanAnimInterface HumanCommandActionCallback()
proto native void ContinueCombo()
marks command to continue to combo
class HumanCommandScript CommandActionFullbody
class HumanCommandScript CommandFall
string GetStateString()
returns debug string of current state
Definition human.c:392
void ~HumanCommandDeath()
Definition human.c:612
proto native void ResetAligning()
disables character aligning
proto native void Cancel()
cancels action
class HumanCommandScript CommandMelee2
proto native bool IsLanding()
returns true if fall is in landing state
void ~HumanCommandFullBodyDamage()
Definition human.c:810
static const int LANDTYPE_HEAVY
Definition human.c:580
enum WeaponActionReloadClipTypes MECHANISM_SPECIAL
static const int STATE_LOOP_LOOP
Definition human.c:353
void ~HumanCommandAdditives()
Definition human.c:1128
proto native void Land(int pLandType)
end fall with land
class HumanInputController TAnimGraphCommand
WeaponActionReloadTypes
action types reload action types
Definition human.c:832
@ RELOAD_MAGAZINE_DETACH
Definition human.c:851
@ RELOADRIFLE_NOMAGAZINE_NOBULLET_OPEN
Definition human.c:839
@ RELOADPISTOL_NOMAGAZINE_NOBULLET_CLOSED_COCKED
Definition human.c:847
@ RELOADRIFLE_MAGAZINE_DETACH
Definition human.c:852
@ RELOADPISTOL_NOMAGAZINE_NOBULLET_CLOSED_UNCOCKED
Definition human.c:842
@ RELOADRIFLE_MAGAZINE_NOBULLET
Definition human.c:836
@ RELOADSRIFLE_MAGAZINE_NOBULLET
Definition human.c:856
@ RELOADPISTOL_NOMAGAZINE_NOBULLET_OPENED
Definition human.c:848
@ RELOADPISTOL_MAGAZINE_NOBULLET_CLOSED_COCKED
Definition human.c:846
@ RELOADSRIFLE_NOMAGAZINE_NOBULLET
Definition human.c:857
@ RELOADPISTOL_MAGAZINE_NOBULLET_OPENED
Definition human.c:849
@ RELOADPISTOL_NOMAGAZINE_BULLET_CLOSED
Definition human.c:845
@ RELOADRIFLE_NOMAGAZINE_NOBULLET
Definition human.c:837
@ RELOADSRIFLE_MAGAZINE_BULLET
Definition human.c:854
@ RELOADRIFLE_NOMAGAZINE_BULLET
Definition human.c:835
@ RELOADPISTOL_MAGAZINE_BULLET_CLOSED
Definition human.c:844
@ RELOADRIFLE_MAGAZINE_NOBULLET_OPEN
Definition human.c:838
@ RELOADPISTOL_MAGAZINE_NOBULLET_CLOSED_UNCOCKED
Definition human.c:843
@ RELOADRIFLE_MAGAZINE_BULLET
reload action types - rifles
Definition human.c:834
@ RELOADSRIFLE_NOMAGAZINE_BULLET
Definition human.c:855
proto native int GetState()
returns one of STATE_...
proto native void StartModifier(int pType)
starts modifier
static const int STATE_LOOP_LOOP2
Definition human.c:356
HumanInputControllerOverrideType
Definition human.c:8
@ ONE_FRAME
Permenantly active until DISABLED is passed.
Definition human.c:11
proto native Human GetHuman()
get the human this cb belongs to
class HumanCommandScript CommandDamageAdditive
IEntity m_ClimbStandPointParent
parent of grabpoint
Definition human.c:756
class HumanCommandMelee2 HumanCommandFall()
Definition human.c:574
vector m_ClimbStandPoint
normal to grabpoint position (used for character orientation)
Definition human.c:752
ClimbStates
state of climb command
Definition human.c:763
@ STATE_FINISH
Definition human.c:768
@ STATE_MOVE
Definition human.c:764
@ STATE_TAKEOFF
Definition human.c:765
@ STATE_ONTOP
Definition human.c:766
@ STATE_FALLING
Definition human.c:767
void ~HumanCommandFall()
Definition human.c:575
proto native bool IsInComboRange()
returns true if hit is in range, where person can continue to combo
bool m_bIsClimbOver
Definition human.c:744
WeaponActionUnjammingTypes
Definition human.c:918
@ UNJAMMING_INTERRUPT
Definition human.c:922
@ UNJAMMING_END
Definition human.c:921
@ UNJAMMING_START
unjam action types
Definition human.c:920
void ~HumanCommandSwim()
Definition human.c:674
int TAnimGraphEvent
Definition human.c:279
proto native bool IsOnBack()
return true if prone is on back
vector m_ClimbOverStandPoint
where climb ends (in local space of it's parent)
Definition human.c:753
IEntity m_GrabPointParent
where climb over ends (in local space of it's parent)
Definition human.c:755
proto native bool DefaultCancelCondition()
system implemented cancel condition (now raise or sprint cancels action)
class HumanCommandScript CommandMelee
WeaponActionFireTypes
Definition human.c:926
@ FIRE_NORMAL
Definition human.c:927
@ FIRE_JAM
Definition human.c:932
@ FIRE_LAST
Definition human.c:928
@ FIRE_COCKED
Definition human.c:929
@ FIRE_UNCOCKED
Definition human.c:930
@ FIRE_DRY
Definition human.c:931
class HumanMovementState CURRENT
From the last value that was set.
class HumanCommandWeapons HumanCommandAdditives()
Definition human.c:1127
void HumanItemAccessor()
Definition humanitems.c:141