DayZ Scripts
v1.21.156300 · Jun 20, 2023
 
Loading...
Searching...
No Matches
human.c
Go to the documentation of this file.
11// *************************************************************************************
12// ! HumanInputController - what we know about the input - human.GetInputController()
13// *************************************************************************************
16 //--------------------------------------------------------------
17
19 proto native void SetDisabled(bool pState);
20
22 proto void GetMovement(out float pSpeed, out vector pLocalDirection);
23
25 proto native float GetHeadingAngle();
26
28 proto native vector GetAimChange();
29
31 proto native vector GetAimDelta(float dt);
32
34 proto native vector GetTracking();
35
37 proto native bool CameraViewChanged();
38
40 proto native bool CameraIsFreeLook();
41
43 proto native void ResetFreeLookToggle();
44
46 proto native bool CameraIsTracking();
47
49 proto native bool Camera3rdIsRightShoulder();
50
51 //--------------------------------------------------------------
52
54 proto native bool IsJumpClimb();
55
56
57 //--------------------------------------------------------------
58
60 proto native bool IsMeleeEvade();
61
63 proto native bool IsMeleeFastAttackModifier();
64
66 proto native int IsMeleeLREvade();
67
69 proto native bool IsMeleeWeaponAttack();
70
71 //--------------------------------------------------------------
72
74 proto native bool WeaponWasRaiseClick();
75
77 proto native bool IsWeaponRaised();
78
80 proto native bool WeaponADS();
81
83 proto native void ResetADS();
84
86 proto native bool IsThrowingModeChange();
87
89 proto native void ResetThrowingMode();
90
92 proto native bool IsWalkToggled();
93
94 //--------------------------------------------------------------
95
100 proto native bool IsUseButton();
101
106 proto native bool IsUseButtonDown();
107
109 proto native bool IsUseItemButton();
111 proto native bool IsUseItemButtonDown();
112
114 proto native bool IsAttackButton();
116 proto native bool IsAttackButtonDown();
117
119 proto native bool IsSingleUse();
120
122 proto native bool IsContinuousUse();
123
125 proto native bool IsContinuousUseStart();
126
128 proto native bool IsContinuousUseEnd();
129
132 proto native bool IsImmediateAction(); //TODO: revise, may be obsolete
133
134 //--------------------------------------------------------------
136
138 proto native bool IsReloadOrMechanismSingleUse();
139
142
145
148
150 proto native bool IsZoom();
151
153 proto native bool IsZoomToggle();
154
156 proto native void ResetZoomToggle();
157
159 proto native bool IsSightChange();
160
162 proto native bool IsZoomIn();
163
165 proto native bool IsZoomOut();
166
168 proto native bool IsFireModeChange();
169
171 proto native bool IsZeroingUp();
172
174 proto native bool IsZeroingDown();
175
177 proto native bool IsHoldBreath();
178
180 proto native void ResetHoldBreath();
181
182 //--------------------------------------------------------------
183
186 proto native int IsGestureSlot();
187
189 proto native bool IsOtherController();
190
191 //--------------------------------------------------------------
192
194 proto native int IsQuickBarSlot();
195
198 proto native bool IsQuickBarSingleUse();
199
202 proto native bool IsQuickBarContinuousUse();
203
206 proto native bool IsQuickBarContinuousUseStart();
207
210 proto native bool IsQuickBarContinuousUseEnd();
211
212
213
214 //--------------------------------------------------------------
215 // LIMITS
216
218 proto native void LimitsDisableSprint(bool pDisable);
219
221 proto native bool LimitsIsSprintDisabled();
222
223
224 //--------------------------------------------------------------
225 // overrides
226
228 proto native void OverrideMovementSpeed(bool pOverride, float pVal);
229
231 proto native void OverrideMovementAngle(bool pOverride, float pVal);
232
234 proto native void OverrideAimChangeX(bool pOverride, float pVal);
235
237 proto native void OverrideAimChangeY(bool pOverride, float pVal);
238
240 proto native void OverrideMeleeEvade(bool pOverride, bool pValue);
241
243 proto native void OverrideRaise(bool pOverride, bool pValue);
244
246 proto native void Override3rdIsRightShoulder(bool pOverride, bool pValue);
247
248
249 //--------------------------------------------------------------
250
252 private void HumanInputController()
253 {
254 }
255
258 {
259 }
260}
261
262
263// *************************************************************************************
264// ! HumanInputController - what we know about the input - human.GetInputController()
265// *************************************************************************************
266
269typedef int TAnimGraphTag;
270typedef int TAnimGraphEvent;
271
274{
275 private void HumanAnimInterface();
276 private void ~HumanAnimInterface();
277
278 //-----------------------------------------------------
279 // Binds, returns -1 when error, otherwise if ok
280
282 proto native TAnimGraphCommand BindCommand(string pCommandName);
283
285 proto native TAnimGraphVariable BindVariableFloat(string pVariable);
286 proto native TAnimGraphVariable BindVariableInt(string pVariable);
287 proto native TAnimGraphVariable BindVariableBool(string pVariable);
288
290 proto native TAnimGraphTag BindTag(string pTagName);
291
293 proto native TAnimGraphEvent BindEvent(string pEventName);
294}
295
296
297// *************************************************************************************
298// ! HumanCommandActionCallback - called as action callback
299// *************************************************************************************
301{
302 private void HumanCommandActionCallback();
304
306 proto native Human GetHuman();
307
309 proto native void Cancel();
310
313 proto native void InternalCommand(int pInternalCommandId);
314
316 proto native void SetAligning(vector pPositionWS, vector pDirectionWS);
317
319 proto native void ResetAligning();
320
324 proto native void EnableCancelCondition(bool pEnable);
325
327 proto native bool DefaultCancelCondition();
328
330 proto native void RegisterAnimationEvent(string pAnimationEventStr, int pId);
331
333 proto native void EnableStateChangeCallback();
334
337 // bool CancelCondition() { return false; }
338
340 static const int STATE_NONE = 0;
341
343 static const int STATE_LOOP_IN = 1;
344 static const int STATE_LOOP_LOOP = 2;
345 static const int STATE_LOOP_END = 3;
346 static const int STATE_LOOP_END2 = 4;
347 static const int STATE_LOOP_LOOP2 = 5;
348 static const int STATE_LOOP_ACTION = 6;
349
351 static const int STATE_NORMAL = 7;
352
354 proto native int GetState();
355
356
357 //----------------------------------
358 // debug helper
359
361 static string GetStateString(int pState)
362 {
363 switch (pState)
364 {
365 case STATE_NONE: return "NONE";
366
367 case STATE_LOOP_IN: return "LOOP_IN";
368 case STATE_LOOP_LOOP: return "LOOP_LOOP";
369 case STATE_LOOP_END: return "LOOP_END";
370 case STATE_LOOP_END2: return "LOOP_END2";
371 case STATE_LOOP_LOOP2: return "LOOP_LOOP2";
372 case STATE_LOOP_ACTION: return "LOOP_ACTION";
373
375 case STATE_NORMAL: return "ONE TIME";
376 }
377
378 return "Undef";
379 }
380
381
384 {
385 return GetStateString(GetState());
386 }
387
388
389
390 //----------------------------------
391 // callbacks
392
394 void OnAnimationEvent(int pEventID) {};
395
397 void OnFinish(bool pCanceled) {};
398
400 void OnStateChange(int pOldState, int pCurrentState) {};
401
402
403 // helps identify type of callback
405 {
406 return false;
407 }
408
410 {
411 return false;
412 }
413
415 {
416 return false;
417 }
418}
419
420
421// *************************************************************************************
422// ! HumanCommandMove
423// *************************************************************************************
425{
426 private void HumanCommandMove() {}
427 private void ~HumanCommandMove() {}
428
431 proto native float GetCurrentMovementAngle();
432
436 proto bool GetCurrentInputAngle(out float pAngle);
437
439 proto native float GetCurrentMovementSpeed();
440
442 proto native bool IsChangingStance();
443
445 proto native bool IsOnBack();
446
448 proto native bool IsInRoll();
449
451 proto native bool IsLeavingUncon();
452
454 proto native bool IsStandingFromBack();
455
457 proto native void StartMeleeEvade();
458
460 proto native void StartMeleeEvadeA(float pDirAngle);
461
463 proto native bool IsMeleeEvade();
464
466 proto native void SetMeleeBlock(bool pBlock);
467
470 proto native void ForceStance(int pStanceIdx);
471
472
475 proto native void ForceStanceUp(int pStanceIdx);
476
477
479 proto native void SetRunSprintFilterModifier(float value);
480
482 proto native void SetDirectionFilterModifier(float value);
483
485 proto native void SetDirectionSprintFilterModifier(float value);
486
488 proto native void SetTurnSpanModifier(float value);
489
491 proto native void SetTurnSpanSprintModifier(float value);
492
494 proto native void SetCurrentWaterLevel(float value);
495}
496
497
498
499// *************************************************************************************
500// ! HumanCommandMelee - actual command melee running on
501// *************************************************************************************
503{
504 private void HumanCommandMelee() {}
505 private void ~HumanCommandMelee() {}
508 proto native void ContinueCombo();
509
511 proto native bool IsInComboRange();
512
514 proto native bool WasHit();
517 proto native void Cancel();
520 proto native bool IsOnBack();
522
523
524// *************************************************************************************
525// ! HumanCommandMelee2 - actual command melee running on - Heavy/Light version
526// *************************************************************************************
528{
529 private void HumanCommandMelee2() {}
530 private void ~HumanCommandMelee2() {}
531
532 static const int HIT_TYPE_LIGHT = 0;
533 static const int HIT_TYPE_HEAVY = 1;
534 static const int HIT_TYPE_FINISHER = 2; //liver stab
535 static const int HIT_TYPE_FINISHER_NECK = 3;
538 proto native void ContinueCombo(bool pHeavyHit, float pComboValue, EntityAI target = null, vector hitPos = vector.Zero);
541 proto native bool IsInComboRange();
544 proto native bool WasHit();
547 proto native void Cancel();
548
550 proto native bool IsOnBack();
551
552 proto native int GetComboCount();
553
554 proto native int GetCurrentHitType();
555
556 proto native bool IsFinisher();
557}
559
560// *************************************************************************************
561// ! HumanCommandFall - actually falling
562// *************************************************************************************
565 private void HumanCommandFall() {}
566 private void ~HumanCommandFall() {}
568 static const int LANDTYPE_NONE = 0;
569 static const int LANDTYPE_LIGHT = 1;
570 static const int LANDTYPE_MEDIUM = 2;
571 static const int LANDTYPE_HEAVY = 3;
574 proto native bool PhysicsLanded();
577 proto native void Land(int pLandType);
578
580 proto native bool IsLanding();
581}
582
583// *************************************************************************************
584// ! HumanCommandDeathCallback - called as action callback
585// *************************************************************************************
587{
588 //----------------------------------
589 // callbacks
590
591 void OnSimulationEnd() {};
592
594 bool ShouldSimulationBeDisabled() { return true; };
595}
596
597// *************************************************************************************
598// ! HumanCommandDeath - actually dying
599// *************************************************************************************
601{
602 private void HumanCommandDeath() {}
603 private void ~HumanCommandDeath() {}
604}
605
607// *************************************************************************************
608// ! HumanCommandUnconscious - actually not dying
609// *************************************************************************************
611{
612 private void HumanCommandUnconscious() {}
613 private void ~HumanCommandUnconscious() {}
614
615 proto native void WakeUp(int targetStance = -1);
616 proto native bool IsOnLand();
617 proto native bool IsInWater();
618}
619
620
621// *************************************************************************************
622// ! HumanCommandDamage - additional damage
623// *************************************************************************************
625{
626 private void HumanCommandDamage() {}
627 private void ~HumanCommandDamage() {}
629
630// *************************************************************************************
631// ! HumanCommandLadder ladder
632// *************************************************************************************
634{
635 private void HumanCommandLadder() {}
636 private void ~HumanCommandLadder() {}
637
639 proto native bool CanExit();
640
642 proto native void Exit();
643
645 proto native static bool DebugDrawLadder(Building pBuilding, int pLadderIndex);
646
648 proto native static int DebugGetLadderIndex(string pComponentName);
649
652 proto native vector GetLogoutPosition();
653}
654
655
656
657// *************************************************************************************
658// ! HumanCommandLadder ladder
659// *************************************************************************************
661{
662 private void HumanCommandSwim() {}
663 private void ~HumanCommandSwim() {}
666 proto native void StopSwimming();
670 proto native static vector WaterLevelCheck(Human pHuman, vector pPosition);
671}
672
674
675// *************************************************************************************
676// ! HumanCommandVehicle vehicle
677// *************************************************************************************
679{
680 private void HumanCommandVehicle() {}
681 private void ~HumanCommandVehicle() {}
682
683 proto native Transport GetTransport();
684 proto native int GetVehicleClass();
685 proto native int GetVehicleSeat();
686 proto native void SetVehicleType(int pVehicleType);
687 proto native int GetVehicleType();
688
689 proto native void GetOutVehicle();
690 proto native void KnockedOutVehicle();
691 proto native bool ShouldBeKnockedOut();
692 proto native void JumpOutVehicle();
693 proto native void SwitchSeat(int pTransportPositionIndex, int pVehicleSeat);
694 proto native bool IsGettingIn();
695 proto native bool IsGettingOut();
696 proto native bool IsSwitchSeat();
697 proto native bool WasGearChange();
698 proto native void SetClutchState(bool pState);
699 proto native void KeepInVehicleSpaceAfterLeave(bool pState);
700
702 {
703 Object object;
704 if (!Class.CastTo(object, entity))
705 {
706 return true;
707 }
708
709 Transport transport = GetTransport();
710 if (!transport)
711 {
712 return true;
713 }
714
715 if (object == transport || object.GetParent() == transport)
716 {
717 return true;
718 }
719
720 return transport.IsIgnoredObject(object);
721 }
722}
723
724// *************************************************************************************
725// ! HumanCommandClimb
726// *************************************************************************************
727
729class SHumanCommandClimbResult
730{
735
737
742
746};
747
748
751{
758
761{
762 private void HumanCommandClimb() {}
763 private void ~HumanCommandClimb() {}
764
766 proto native int GetState();
767
769 proto native vector GetGrabPointWS();
770
773
776 proto native static bool DoClimbTest(Human pHuman, SHumanCommandClimbResult pResult, int pDebugDrawLevel);
777
780 proto native static bool DebugDrawClimb(Human pHuman, int pLevel);
781}
782
783
784
785
786// *************************************************************************************
787// ! HumanCommandFullBodyDamage - full body damages
788// *************************************************************************************
790{
791 private void HumanCommandFullBodyDamage() {}
794
795
798{
800 NONE = -1,
806 FIRE = 5,
807 HIDE = 6,
808 SHOW = 7,
814{
816 RELOADRIFLE_MAGAZINE_BULLET = 0, // CMD_Reload_Magazine
822
823 // reload action types - pistols
832
834 RELOADRIFLE_MAGAZINE_DETACH = 17, // CMD_Reload_Magazine
835
836 RELOADSRIFLE_MAGAZINE_BULLET = 20, // CMD_Reload_Magazine
840};
841
843{
846}
847
848enum WeaponActionMechanismTypes
849{
851 MECHANISM_OPENED = 0, // CMD_Reload_BoltAction
853 MECHANISM_SPECIAL = 2, // crossbow, magnum ... special mechanism action apropriate for custom weapons
855};
856
858{
861 CHAMBERING_ONEBULLET_OPENED = 0, // CMD_Reload_Chambering
866 CHAMBERING_TWOBULLETS_START = 6, // plays one bullet, then second, then ends, when CHAMBERING_TWOBULLETS_END arise, it's canceled
867 CHAMBERING_TWOBULLETS_END = 7, // - one bullet reload with closed mechanism
868 CHAMBERING_STARTLOOPABLE_CLOSED = 10, // start loop chambering
869 CHAMBERING_ENDLOOPABLE = 11, // end loop chambering
870 CHAMBERING_STARTLOOPABLE_CLOSED_KEEP = 12, // start loop chambering and keep last bullet
872
875
880
881
882 CHAMBERING_CROSSBOW_OPENED = 21, // chambering crossbow
883 CHAMBERING_CROSSBOW_CLOSED = 22, // chambering crossbow
884 CHAMBERING_CROSSBOW_FULL = 23, // chambering crossbow
885};
886
888{
889 CHAMBERINGLOADER_OPENED = 0, // CMD_Reload_ChamberingFast - one bullet reload with open mechanism
890 CHAMBERINGLOADER_CLOSED = 1, // - one bullet reload with closed mechanism
891};
892
894{
896 UNJAMMING_START = 1, // CMD_Weapon_Jam - 0
899};
900
902{
908 FIRE_JAM = 5
910
912{
923};
924
925string WeaponActionTypeToString (int A, int AT)
926{
927 switch (A)
928 {
929 case WeaponActions.INTERRUPT: return "Weapon interrupt";
930 case WeaponActions.NONE: return "---";
931 case WeaponActions.RELOAD: return typename.EnumToString(WeaponActionReloadTypes, AT);
932 case WeaponActions.MECHANISM: return typename.EnumToString(WeaponActionMechanismTypes, AT);
933 case WeaponActions.CHAMBERING: return typename.EnumToString(WeaponActionChamberingTypes, AT);
934 case WeaponActions.CHAMBERING_LOADER: return typename.EnumToString(WeaponActionChamberingLoaderTypes, AT);
935 case WeaponActions.UNJAMMING: return typename.EnumToString(WeaponActionUnjammingTypes, AT);
936 case WeaponActions.FIRE: return typename.EnumToString(WeaponActionFireTypes, AT);
937 case WeaponActions.HIDE: return typename.EnumToString(WeaponHideShowTypes, AT);
938 case WeaponActions.SHOW: return typename.EnumToString(WeaponHideShowTypes, AT);
939 }
940 return "---";
941}
942
945{
965 HAMMER_COCKED
969};
970
971
972// *************************************************************************************
973// ! HumanCommandWeapons - weapon handling
974// *************************************************************************************
976{
977 private void HumanCommandWeapons() {}
978 private void ~HumanCommandWeapons() {}
979
981 proto native bool IsActionFinished();
982
984 proto native int GetRunningAction();
985
987 proto native int GetRunningActionType();
988
990 proto native void SetActionProgressParams(float pStart, float pEnd);
991
993 proto native bool StartAction(WeaponActions pAction, int pActionType);
994
996 proto native void RegisterEvent(string pName, int pId);
997
999 proto native int IsEvent();
1000
1003
1005 proto native void SetADS(bool pState);
1006
1008 proto native void LiftWeapon(bool pState);
1009
1012 {
1013 RegisterEvent("Weapon_AttachmentHide", WeaponEvents.ATTACHMENT_HIDE);
1014 RegisterEvent("Weapon_AttachmentShow", WeaponEvents.ATTACHMENT_SHOW);
1015 RegisterEvent("Weapon_BulletEject", WeaponEvents.BULLET_EJECT);
1016 RegisterEvent("Weapon_BulletHide", WeaponEvents.BULLET_HIDE);
1017 RegisterEvent("Weapon_BulletHide2", WeaponEvents.BULLET_HIDE2);
1018 RegisterEvent("Weapon_BulletInChamber", WeaponEvents.BULLET_IN_CHAMBER);
1019 RegisterEvent("Weapon_BulletInMagazine", WeaponEvents.BULLET_IN_MAGAZINE);
1020 RegisterEvent("Weapon_BulletShow", WeaponEvents.BULLET_SHOW);
1021 RegisterEvent("Weapon_BulletShow2", WeaponEvents.BULLET_SHOW2);
1022 RegisterEvent("Weapon_CanUnjam_End", WeaponEvents.CANUNJAM_END);
1023 RegisterEvent("Weapon_CanUnjam_Start", WeaponEvents.CANUNJAM_START);
1024 RegisterEvent("Weapon_Cocked", WeaponEvents.COCKED);
1025 RegisterEvent("Weapon_MagazineAttached", WeaponEvents.MAGAZINE_ATTACHED);
1026 RegisterEvent("Weapon_MagazineDetached", WeaponEvents.MAGAZINE_DETACHED);
1027 RegisterEvent("Weapon_MagazineHide", WeaponEvents.MAGAZINE_HIDE);
1028 RegisterEvent("Weapon_MagazineShow", WeaponEvents.MAGAZINE_SHOW);
1029 RegisterEvent("Weapon_SliderOpen", WeaponEvents.SLIDER_OPEN);
1030 RegisterEvent("Weapon_Unjammed", WeaponEvents.UNJAMMED);
1031 RegisterEvent("Weapon_Hammer_Uncocked", WeaponEvents.HAMMER_UNCOCKED);
1032 RegisterEvent("Weapon_Hammer_Cocked", WeaponEvents.HAMMER_COCKED);
1033 RegisterEvent("Weapon_Change_Hide", WeaponEvents.CHANGE_HIDE);
1034 RegisterEvent("Weapon_Change_Show", WeaponEvents.CHANGE_SHOW);
1035 RegisterEvent("Weapon_CylinderRotate", WeaponEvents.CYLINDER_ROTATE);
1036 }
1037
1038 //----------------------------------------------------
1039 // weapon init states
1040
1041
1046 proto native void SetInitState(int pFrameIndex);
1047
1049 proto native static void StaticSetInitState(Human pHuman, int pFrameIdx);
1050
1051
1052 //----------------------------------------------------
1053 //
1054
1056 proto native float GetBaseAimingAngleUD();
1057
1059 proto native float GetBaseAimingAngleLR();
1060
1061
1062 //----------------------------------------------------
1063 // throwing
1064 proto native void SetThrowingMode(bool pState);
1065
1066 proto native bool IsThrowingMode();
1067
1068 proto native void ThrowItem(int throwType);
1069
1070 proto native bool WasItemLeaveHandsEvent();
1071
1072 //----------------------------------------------------
1073 // debug copy
1074
1076 proto native int DebugIsEvent();
1077
1079 proto native void DebugResetEvents();
1080}
1081
1082
1083// *************************************************************************************
1084// ! HumanCommandAdditives - additional damage
1085// *************************************************************************************
1087{
1088 private void HumanCommandAdditives() {}
1089 private void ~HumanCommandAdditives() {}
1092 proto native void SetInjured(float pValue, bool pInterpolate);
1095 proto native void SetExhaustion(float pValue, bool pInterpolate);
1096
1098 proto native void SetTalking(bool pValue);
1101 proto native void StartModifier(int pType);
1104 proto native void CancelModifier();
1107 proto native bool IsModifierActive();
1109
1110
1111// *************************************************************************************
1112// ! HumanMovementState - movement state, command, stance, movement, human.GetMovementState(movementState)
1113// *************************************************************************************
1115{
1122
1125 {
1126 return m_iStanceIdx >= DayZPlayerConstants.STANCEIDX_RAISEDERECT;
1127 }
1128
1131 {
1132 return m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDPRONE;
1133 }
1134
1137 {
1138 return m_iStanceIdx == DayZPlayerConstants.STANCEIDX_PRONE;
1139 }
1140
1143 {
1144 return m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDPRONE;
1145 }
1146
1149 {
1150 return m_fLeaning != 0;
1151 }
1152}
1153
1154
1162class HumanCommandScript
1163{
1165 // HumanCommandScript(Human pHuman);
1166
1169 void OnActivate() { };
1172 void OnDeactivate() { };
1174
1175 //---------------------------------------------------------------
1176 // usable everywhere
1177
1179 proto native void SetFlagFinished(bool pFinished);
1181
1182 //---------------------------------------------------------------
1183 // PreAnim Update
1188 void PreAnimUpdate(float pDt);
1189
1191 proto native void PreAnim_CallCommand(int pCommand, int pParamInt, float pParamFloat);
1192 proto native void PreAnim_SetFloat(int pVar, float pFlt);
1193 proto native void PreAnim_SetInt(int pVar, int pInt);
1194 proto native void PreAnim_SetBool(int pVar, bool pBool);
1195
1197 proto native void PreAnim_SetFilteredHeading(float pYawAngle, float pFilterDt, float pMaxYawSpeed);
1198
1199 //---------------------------------------------------------------
1200 // PrePhys Update
1201
1204 void PrePhysUpdate(float pDt);
1205
1207 proto native bool PrePhys_IsEvent(int pEvent);
1208 proto native bool PrePhys_IsTag(int pTag);
1209 proto native bool PrePhys_GetTranslation(out vector pOutTransl); // vec3 in local space !
1210 proto native bool PrePhys_GetRotation(out float pOutRot[4]); // quaternion in local space !
1211 proto native void PrePhys_SetTranslation(vector pInTransl); // vec3 in local space !
1212 proto native void PrePhys_SetRotation(float pInRot[4]); // quaternion in local space !
1213
1214 //---------------------------------------------------------------
1215 // PostPhys Update
1216
1220 bool PostPhysUpdate(float pDt);
1221
1223 proto native void PostPhys_GetPosition(out vector pOutTransl);
1224 proto native void PostPhys_GetRotation(out float pOutRot[4]);
1225 proto native void PostPhys_SetPosition(vector pInTransl);
1226 proto native void PostPhys_SetRotation(float pInRot[4]);
1227 proto native void PostPhys_LockRotation();
1228}
1229
1232{
1233 None = 0,
1234 CommandMove = 1,
1235 CommandMelee = 2,
1236 CommandMelee2 = 4,
1237 CommandFall = 8,
1238 CommandClimb = 16,
1239 CommandDeath = 32,
1240 CommandUnconscious = 64,
1243 CommandLadder = 512,
1244 CommandSwim = 1024,
1245 CommandVehicle = 2048,
1246 CommandActionFullbody = 4096,
1248}
1249
1250// *************************************************************************************
1251// ! Human - human script interface
1252// *************************************************************************************
1253class Human extends Man
1254{
1255
1257 proto native void GetTransformWS(out vector pTm[4]);
1258
1260 proto float CollisionMoveTest(vector dir, vector offset, float xzScale, IEntity ignoreEntity, out IEntity hitEntity, out vector hitPosition, out vector hitNormal);
1261
1262 //---------------------------------------------------------
1263 // link/unlink to/from local space
1264 proto native void LinkToLocalSpaceOf(notnull IEntity child, vector pLocalSpaceMatrix[4]);
1265 proto native void UnlinkFromLocalSpace();
1266
1267 //---------------------------------------------------------
1268 // bone transforms
1269
1271 proto native int GetBoneIndexByName(string pBoneName);
1272
1273
1276
1277 //---------------------------------------------------------
1278 // physic props
1279
1281 proto native bool PhysicsIsFalling(bool pValidate);
1282
1284 proto native void PhysicsGetVelocity(out vector pVelocity);
1285
1286 proto native void PhysicsEnableGravity(bool pEnable);
1287
1288 proto native bool PhysicsIsSolid();
1289 proto native void PhysicsSetSolid(bool pSolid);
1290
1291 //---------------------------------------------------------
1292 // controller
1293
1296
1297 //---------------------------------------------------------
1298 // item accessor
1299
1301
1302
1303 //---------------------------------------------------------
1304 // commands
1305
1307 proto native void GetMovementState(HumanMovementState pState);
1308
1310 // proto native int GetCurrentCommandID();
1311
1312
1314
1317
1319
1321
1324
1326
1328 proto native HumanCommandMelee2 StartCommand_Melee2(EntityAI pTarget, int pHitType, float pComboValue, vector hitPos = vector.Zero);
1329
1331
1332
1334
1338 proto native HumanCommandFall StartCommand_Fall(float pYVelocity);
1339
1342
1343
1345
1347 proto native HumanCommandLadder StartCommand_Ladder(Building pBuilding, int pLadderIndex);
1348
1350
1351
1353
1356
1358
1359
1361
1363 proto native HumanCommandVehicle StartCommand_Vehicle(Transport pTransport, int pTransportPositionIndex, int pVehicleSeat, bool fromUnconscious = false);
1364
1366
1367
1369
1371 proto native HumanCommandClimb StartCommand_Climb(SHumanCommandClimbResult pClimbResult, int pType);
1372
1374
1376
1378 proto native HumanCommandDeathCallback StartCommand_Death(int pType, float pDirection, typename pCallbackClass);
1379
1381
1382
1385
1387
1388
1390
1392 // -> of type 0,...
1393 // -> from direction (lback -180,left -90,0,righ 90,rightback 180)
1394 proto native HumanCommandFullBodyDamage StartCommand_Damage(int pType, float pDirection);
1395
1397
1398
1399
1401
1404 proto native HumanCommandActionCallback StartCommand_Action(int pActionID, typename pCallbackClass, int pStanceMask);
1405
1408
1409
1410 //---------------------------------------------------------
1411 // command modifiers
1412
1414 proto native int GetCommandModifierCount();
1415
1417 proto native int GetCommandModifierID(int pIndex);
1418
1419
1421
1424
1427
1428
1429
1430
1431 // --- modifier/additive actions - played on COMMANDID_MOVE command
1432
1434 proto native HumanCommandActionCallback AddCommandModifier_Action(int pActionID, typename pCallbackClass);
1435
1438
1441
1442
1443
1445
1447 // -> of type 0,...
1448 // -> from direction (lback -180,left -90,0,righ 90,rightback 180)
1449 proto native HumanCommandDamage AddCommandModifier_Damage(int pType, float pDirection);
1450
1452
1454
1455
1457
1460 proto native HumanCommandScript StartCommand_Script(HumanCommandScript pHumanCommand);
1461 proto native HumanCommandScript StartCommand_ScriptInst(typename pCallbackClass);
1462
1464 proto native HumanCommandScript GetCommand_Script();
1465
1466
1467
1468 //---------------------------------------------------------
1469 // debug info for Item Accessor
1470
1471
1473 proto native owned string DebugGetItemClass();
1474
1476 proto native owned string DebugGetItemSuperClass();
1477
1479 proto native owned string DebugGetItemAnimInstance();
1480
1481
1482 //---------------------------------------------------------
1483 // helper functions for disabling simulation upon death
1484 proto native void StartDeath();
1485 proto native void ResetDeath();
1486
1487 proto native void ResetDeathCooldown();
1488 proto native bool IsDeathProcessed();
1489 proto native bool IsDeathConditionMet();
1490
1491
1492 //--------------------------------------------------------
1493 // commands start/finish events
1494
1497
1500
1503
1506
1509
1512
1515
1518
1521
1524
1527
1530
1533
1536
1538 void OnStanceChange(int previousStance, int newStance);
1539
1541 bool CanChangeStance(int previousStance, int newStance);
1542
1543 //--------------------------------------------------------
1544 // rolling API
1545
1546 bool CanRoll();
1547 void OnRollStart(bool isToTheRight);
1549}
proto native DayZCreatureAnimInterface GetAnimInterface()
proto native void PrePhys_SetRotation(float pInRot[4])
bool PostPhysUpdate(float pDt)
proto native void PostPhys_SetPosition(vector pInTransl)
quaternion in world space
class DayZCreatureAnimInterface RegisterAnimationEvent(string event_name, string function_name)
class DayZAnimalCommandMove extends AnimCommandBase SetFlagFinished(bool pFinished)
DayZAnimalCommandScript fully scriptable command.
proto native bool PrePhys_GetRotation(out float pOutRot[4])
proto native bool IsDeathProcessed()
proto native void PostPhys_GetRotation(out float pOutRot[4])
vec3 in world space
proto native int GetBoneIndexByName(string pBoneName)
returns bone index for a name (-1 if pBoneName doesn't exist)
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
proto native void PrePhys_SetTranslation(vector pInTransl)
proto native void ResetDeath()
proto native void StartDeath()
proto native void PostPhys_LockRotation()
quaternion in world space
proto native void ResetDeathCooldown()
proto native void PostPhys_GetPosition(out vector pOutTransl)
script function usable in PostPhysUpdate
proto native bool IsDeathConditionMet()
Super root of all classes in Enforce script.
Definition EnScript.c:11
proto native TAnimGraphVariable BindVariableFloat(string pVariable)
proto native TAnimGraphEvent BindEvent(string pEventName)
private void ~HumanAnimInterface()
proto native TAnimGraphVariable BindVariableBool(string pVariable)
proto native TAnimGraphCommand BindCommand(string pCommandName)
returns command index -
private 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:42
command itself
Definition human.c:761
proto static native bool DoClimbTest(Human pHuman, SHumanCommandClimbResult pResult, int pDebugDrawLevel)
proto native vector GetClimbOverStandPointWS()
returns world space position of landspot after climbing over
proto static native bool DebugDrawClimb(Human pHuman, int pLevel)
proto native vector GetGrabPointWS()
returns world space position of climbing grab point
proto native int GetState()
returns the state of climb (enum value of ClimbStates);
private void HumanCommandClimb()
Definition human.c:762
private void ~HumanCommandClimb()
Definition human.c:763
bool ShouldSimulationBeDisabled()
'OnSimulationEnd' is called before this
Definition human.c:594
proto native bool CanExit()
returns true if on exiting point
proto static native int DebugGetLadderIndex(string pComponentName)
private void HumanCommandLadder()
Definition human.c:635
proto native void Exit()
proto static native bool DebugDrawLadder(Building pBuilding, int pLadderIndex)
debug draws any ladder
proto native vector GetLogoutPosition()
private void ~HumanCommandLadder()
Definition human.c:636
private void ~HumanCommandMelee2()
Definition human.c:530
static const int HIT_TYPE_HEAVY
Definition human.c:533
proto native bool WasHit()
is true only once after hit event
static const int HIT_TYPE_LIGHT
Definition human.c:532
private void HumanCommandMelee2()
Definition human.c:529
static const int HIT_TYPE_FINISHER
Definition human.c:534
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:535
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?
proto native void SetCurrentWaterLevel(float value)
sets water level (depth)
proto bool GetCurrentInputAngle(out float pAngle)
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()
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)
private void HumanCommandMove()
Definition human.c:426
proto native bool IsChangingStance()
returns true if character is changing stance
proto native void ForceStanceUp(int pStanceIdx)
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
private void ~HumanCommandMove()
Definition human.c:427
proto native void SetTurnSpanSprintModifier(float value)
sets the multiplier for HumanItemBehaviorCfg::m_fMoveHeadingSprintFilterSpan
proto native bool IsLeavingUncon()
return true if character transitions out of uncon
proto native void WakeUp(int targetStance=-1)
proto native bool IsInWater()
proto native bool IsOnLand()
private void ~HumanCommandUnconscious()
Definition human.c:613
private void HumanCommandUnconscious()
Definition human.c:612
proto native void KnockedOutVehicle()
proto native void KeepInVehicleSpaceAfterLeave(bool pState)
proto native Transport GetTransport()
proto native void GetOutVehicle()
proto native bool IsGettingIn()
proto native bool IsSwitchSeat()
proto native void SwitchSeat(int pTransportPositionIndex, int pVehicleSeat)
proto native void SetClutchState(bool pState)
proto native int GetVehicleSeat()
proto native bool WasGearChange()
proto native int GetVehicleType()
proto native int GetVehicleClass()
proto native bool IsGettingOut()
proto native void JumpOutVehicle()
bool IsObjectIgnoredOnGettingOut(IEntity entity)
Definition human.c:701
proto native bool ShouldBeKnockedOut()
proto native void SetVehicleType(int pVehicleType)
private void HumanCommandVehicle()
Definition human.c:680
private void ~HumanCommandVehicle()
Definition human.c:681
proto native void LiftWeapon(bool pState)
command for lifting weapon near obstacled (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 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)
proto native int IsEvent()
return -1 when there is no event, otherwise it returns pId of event from animation
void RegisterDefaultEvents()
Definition human.c:1011
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
proto native float GetBaseAimingAngleUD()
returns base aiming angle UD - without sway/offsets/...
private void ~HumanCommandWeapons()
Definition human.c:978
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
private void HumanCommandWeapons()
Definition human.c:977
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 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 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 bool IsQuickBarContinuousUseEnd()
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 IsZoomOut()
proto native bool IsUseItemButtonDown()
returns true if 'UADefaultAction' button has just been pressed (== true for 1 tick only)....
proto native int IsGestureSlot()
proto native bool IsAttackButton()
returns true if 'UAFire' button is pressed (== true for multiple ticks). Synced.
proto native void OverrideAimChangeY(bool pOverride, float pVal)
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 bool IsAttackButtonDown()
returns true if 'UAFire' button has just been pressed (== true for 1 tick only). Synced.
proto native void OverrideMovementSpeed(bool pOverride, float pVal)
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()
proto native bool IsQuickBarContinuousUseStart()
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 ResetZoomToggle()
reset zoom toggle
proto native void Override3rdIsRightShoulder(bool pOverride, bool pValue)
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 void OverrideMovementAngle(bool pOverride, float pVal)
proto native void OverrideRaise(bool pOverride, bool pValue)
proto native bool IsQuickBarContinuousUse()
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 bool IsSightChange()
sight has been changed (in/out ironsights)
proto native void OverrideAimChangeX(bool pOverride, float pVal)
proto native bool IsReloadOrMechanismContinuousUseEnd()
R - reloading / bolting - long press (== true for multiple ticks)
proto native bool IsImmediateAction()
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)
private void ~HumanInputController()
never created by script
Definition human.c:257
proto native vector GetTracking()
returns absolute tracking change (in radians)
proto native bool IsReloadOrMechanismSingleUse()
weapon handling
proto native bool IsHoldBreath()
holding breath
proto native bool IsZoomToggle()
zooming toggle
proto native bool IsMeleeEvade()
returns pressed SHIFT (melee evade)
proto native void OverrideMeleeEvade(bool pOverride, bool pValue)
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
private void HumanInputController()
never created by script
Definition human.c:252
int m_iStanceIdx
current command's id
Definition human.c:1117
int m_LocalMovement
leaning state (not all commands need to have all movements)
Definition human.c:1121
int m_iMovement
current stance (DayZPlayerConstants.STANCEIDX_ERECT, ...), only if the command has a stance
Definition human.c:1118
float m_fLeaning
current movement (0 idle, 1 walk, 2-run, 3-sprint), only if the command has a movement
Definition human.c:1119
bool IsRaisedInProne()
Definition human.c:1130
bool IsInRaisedProne()
Definition human.c:1142
Base native class for all motorized wheeled vehicles.
Definition Car.c:80
static const vector Zero
Definition EnConvert.c:110
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
@ A
Definition EnSystem.c:345
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:396
enum WeaponActions HumanCommandFullBodyDamage
Definition human.c:791
int TAnimGraphVariable
Definition human.c:268
proto native void GetMovementState(HumanMovementState pState)
returns movement state (current command id, )
void OnCommandMoveStart()
proto static native vector WaterLevelCheck(Human pHuman, vector pPosition)
bool CanChangeStance(int previousStance, int newStance)
Called by code to see if it can.
static const int STATE_NONE
undef state - not running anymore
Definition human.c:340
proto native HumanCommandDamage GetCommandModifier_Damage()
CommandClimb
Definition human.c:5
void OnCommandMeleeFinish()
void OnCommandActionAdditiveFinish()
proto native HumanCommandDamage AddCommandModifier_Damage(int pType, float pDirection)
— modifier for light Damages
static const int STATE_LOOP_END2
Definition human.c:346
proto native void CancelModifier()
cancels modifier
proto native bool IsModifierActive()
is modifier active
private void ~HumanCommandMelee()
Definition human.c:505
proto native HumanCommandMelee2 GetCommand_Melee2()
enum WeaponActionReloadClipTypes MECHANISM_CLOSED_UNCOCKED
private void ~HumanCommandFullBodyDamage()
Definition human.c:792
proto native owned string DebugGetItemAnimInstance()
returns current item's animation instance
CommandActionFullbody
Definition human.c:13
proto native bool PrePhys_IsEvent(int pEvent)
script function usable in PrePhysUpdate
proto native HumanCommandVehicle StartCommand_Vehicle(Transport pTransport, int pTransportPositionIndex, int pVehicleSeat, bool fromUnconscious=false)
--— VEHICLE --—
IEntity m_ClimbOverStandPointParent
Definition human.c:745
void OnCommandDeathStart()
proto native HumanCommandScript StartCommand_ScriptInst(typename pCallbackClass)
CommandMelee2
Definition human.c:3
class HumanCommandMove HumanCommandMelee()
Definition human.c:504
void OnCommandDamageAdditiveFinish()
CommandMove
Definition human.c:1
CommandMelee
Definition human.c:2
static const int STATE_NORMAL
one time state
Definition human.c:351
proto native bool WasHit()
is true only once after hit event
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()
static const int STATE_LOOP_IN
looped state
Definition human.c:343
proto native void PhysicsGetVelocity(out vector pVelocity)
outs pVelocity - linear velocity of PHYSICS CONTROLLER
class HumanCommandVehicle m_bIsClimb
result from static test
float m_fClimbHeight
Definition human.c:736
class HumanCommandLadder HumanCommandSwim()
Definition human.c:662
proto native void SetTalking(bool pValue)
sets talking
proto native bool PrePhys_IsTag(int pTag)
HumanMoveCommandID
do not process rotations !
Definition human.c:1232
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 direction - length of dir means distance,...
void OnDeactivate()
called when command ends
Definition human.c:1172
void OnCommandSwimFinish()
vector m_ClimbGrabPointNormal
grab point for climb && climb over (in local space of it's parent)
Definition human.c:739
proto native HumanCommandMove GetCommand_Move()
CommandDeath
Definition human.c:6
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()
CommandVehicle
Definition human.c:12
proto native void StopSwimming()
proto native HumanCommandMelee StartCommand_Melee(EntityAI pTarget)
--— MELEE --—
static const int LANDTYPE_NONE
Definition human.c:568
static const int LANDTYPE_LIGHT
Definition human.c:569
proto native HumanCommandMelee GetCommand_Melee()
proto native HumanCommandFall StartCommand_Fall(float pYVelocity)
--— FALL --—
proto native HumanCommandMove StartCommand_Move()
returns current command ID
WeaponActionReloadClipTypes
Definition human.c:843
@ RELOADRIFLE_CLIP_NOBULLET
Definition human.c:844
@ RELOADRIFLE_CLIP_BULLET
Definition human.c:845
private void ~HumanCommandActionCallback()
static const int STATE_LOOP_END
Definition human.c:345
void OnRollFinish()
proto native void SetInjured(float pValue, bool pInterpolate)
sets injury level 0..1, interpolate == false -> resets the value, otherwise it's interpolating toward...
private void ~HumanCommandSwim()
Definition human.c:663
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
class HumanCommandUnconscious HumanCommandDamage()
Definition human.c:626
proto native void PreAnim_SetFilteredHeading(float pYawAngle, float pFilterDt, float pMaxYawSpeed)
sets character rotation (heading)
void OnCommandMelee2Start()
void OnCommandDamageAdditiveStart()
proto native HumanCommandFullBodyDamage StartCommand_Damage(int pType, float pDirection)
--— FullBody Damages --—
bool IsGestureCallback()
Definition human.c:409
proto native void SetExhaustion(float pValue, bool pInterpolate)
sets exhaustion level 0..1, interpolate == false -> resets the value, otherwise it's interpolating to...
static const int LANDTYPE_MEDIUM
Definition human.c:570
proto native void DeleteCommandModifier_Action(HumanCommandActionCallback pCallback)
force remove - normally if action is ended or interrupted - this is not needed to call
proto native void PreAnim_SetBool(int pVar, bool pBool)
proto native void PreAnim_SetInt(int pVar, int pInt)
proto native HumanCommandActionCallback GetCommandModifier_Action()
returns callback for action if any is active, null if nothing runs
proto native void SetAligning(vector pPositionWS, vector pDirectionWS)
enables character aligning to desired position and direction in world space
WeaponActionChamberingTypes
Definition human.c:858
@ CHAMBERING_DOUBLE_4
Definition human.c:879
@ CHAMBERING_ONEBULLET_CLOSED
Definition human.c:862
@ CHAMBERING_TWOBULLETS_END
Definition human.c:867
@ CHAMBERING_CROSSBOW_CLOSED
Definition human.c:883
@ CHAMBERING_STARTLOOPABLE_SHOTGUN_UNCOCKED
Definition human.c:873
@ CHAMBERING_END
Definition human.c:859
@ CHAMBERING_DOUBLE_2
Definition human.c:877
@ CHAMBERING_ENDLOOPABLE
Definition human.c:869
@ CHAMBERING_ONEBULLET_UNIQUE_OPENED
Definition human.c:864
@ CHAMBERING_CROSSBOW_OPENED
Definition human.c:882
@ CHAMBERING_ONEBULLET_OPENED
chambering action types
Definition human.c:861
@ CHAMBERING_STARTLOOPABLE_CLOSED_KEEP
Definition human.c:870
@ CHAMBERING_CROSSBOW_FULL
Definition human.c:884
@ CHAMBERING_STARTLOOPABLE_OPENED
Definition human.c:871
@ CHAMBERING_STARTLOOPABLE_CLOSED
Definition human.c:868
@ CHAMBERING_ONEBULLET_UNIQUE_CLOSED
Definition human.c:865
@ CHAMBERING_STARTLOOPABLE_SHOTGUN_COCKED
Definition human.c:874
@ CHAMBERING_DOUBLE_1
Definition human.c:876
@ CHAMBERING_DOUBLE_3
Definition human.c:878
@ CHAMBERING_ONEBULLET_CLOSED_UNCOCKED
Definition human.c:863
@ CHAMBERING_TWOBULLETS_START
Definition human.c:866
WeaponHideShowTypes
Definition human.c:912
@ HIDESHOW_SLOT_RFLRIGHTBACK
Definition human.c:917
@ HIDESHOW_SLOT_INVENTORY
Definition human.c:922
@ HIDESHOW_SLOT_2HDRIGHTBACK
Definition human.c:916
@ HIDESHOW_SLOT_RFLLEFTBACK
Definition human.c:914
@ HIDESHOW_SLOT_PISTOLCHEST
Definition human.c:920
@ HIDESHOW_SLOT_1HDRIGHTBACK
Definition human.c:918
@ HIDESHOW_SLOT_KNIFEBACK
Definition human.c:921
@ HIDESHOW_SLOT_PISTOLBELT
Definition human.c:919
@ HIDESHOW_SLOT_2HDLEFTBACK
Definition human.c:913
@ HIDESHOW_SLOT_1HDLEFTBACK
Definition human.c:915
proto native HumanCommandWeapons GetCommandModifier_Weapons()
returns interface for handling weapons
proto native HumanCommandVehicle GetCommand_Vehicle()
proto native void PreAnim_SetFloat(int pVar, float pFlt)
void PreAnimUpdate(float pDt)
bool m_bFinishWithFall
Definition human.c:733
proto native HumanCommandActionCallback StartCommand_Action(int pActionID, typename pCallbackClass, int pStanceMask)
--— ACTIONS --—
bool m_bHasParent
Definition human.c:734
proto native HumanCommandSwim GetCommand_Swim()
WeaponActions
actions
Definition human.c:798
@ UNJAMMING
Definition human.c:805
@ RELOAD_CLIP
Definition human.c:809
@ MECHANISM
Definition human.c:802
@ FIRE
Definition human.c:806
@ CHAMBERING
Definition human.c:803
@ HIDE
Definition human.c:807
@ CHAMBERING_LOADER
Definition human.c:804
@ NONE
Definition human.c:800
@ INTERRUPT
Definition human.c:799
@ SHOW
Definition human.c:808
@ RELOAD
Definition human.c:801
proto native owned string DebugGetItemClass()
returns current item's class name
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)
class HumanCommandDeathCallback HumanCommandDeath()
Definition human.c:602
WeaponEvents
events
Definition human.c:945
@ CHANGE_SHOW
Definition human.c:967
@ BULLET_SHOW
Definition human.c:953
@ ATTACHMENT_SHOW
Definition human.c:947
@ ATTACHMENT_HIDE
Definition human.c:946
@ MAGAZINE_SHOW
Definition human.c:961
@ CHANGE_HIDE
Definition human.c:966
@ BULLET_EJECT
Definition human.c:948
@ CYLINDER_ROTATE
Definition human.c:968
@ MAGAZINE_ATTACHED
Definition human.c:958
@ BULLET_IN_MAGAZINE
Definition human.c:952
@ UNJAMMED
Definition human.c:963
@ BULLET_SHOW2
Definition human.c:954
@ CANUNJAM_END
Definition human.c:955
@ CANUNJAM_START
Definition human.c:956
@ BULLET_HIDE
Definition human.c:949
@ HAMMER_UNCOCKED
Definition human.c:964
@ MAGAZINE_HIDE
Definition human.c:960
@ COCKED
Definition human.c:957
@ SLIDER_OPEN
Definition human.c:962
@ BULLET_IN_CHAMBER
Definition human.c:951
@ MAGAZINE_DETACHED
Definition human.c:959
@ BULLET_HIDE2
Definition human.c:950
bool IsUserActionCallback()
Definition human.c:404
CommandLadder
Definition human.c:10
proto native owned string DebugGetItemSuperClass()
returns current item's class that is found in config
vector m_ClimbGrabPoint
Definition human.c:738
string WeaponActionTypeToString(int A, int AT)
Definition human.c:925
proto native void DeleteCommandModifier_Damage(HumanCommandDamage pDamage)
proto native HumanCommandFall GetCommand_Fall()
int TAnimGraphTag
Definition human.c:269
static const int STATE_LOOP_ACTION
Definition human.c:348
enum WeaponActionReloadClipTypes MECHANISM_OPENED
mechanism action types
void OnCommandMeleeStart()
proto native void InternalCommand(int pInternalCommandId)
proto native HumanCommandActionCallback AddCommandModifier_Action(int pActionID, typename pCallbackClass)
adds action command modifier, creates callback instance for you
proto native void PreAnim_CallCommand(int pCommand, int pParamInt, float pParamFloat)
function usable in PreAnimUpdate or in !!! OnActivate !!!
void OnCommandLadderFinish()
WeaponActionChamberingLoaderTypes
Definition human.c:888
@ CHAMBERINGLOADER_CLOSED
Definition human.c:890
@ CHAMBERINGLOADER_OPENED
Definition human.c:889
proto native void EnableStateChangeCallback()
enables state change callback OnStateChange
enum WeaponActionReloadClipTypes MECHANISM_CLOSED
void OnCommandFallStart()
void OnCommandUnconsciousStart()
proto native HumanCommandDeathCallback StartCommand_Death(int pType, float pDirection, typename pCallbackClass)
--— Death --—
proto native HumanCommandUnconscious GetCommand_Unconscious()
proto native void ContinueCombo()
marks command to continue to combo
private void ~HumanCommandAdditives()
Definition human.c:1089
proto native void LinkToLocalSpaceOf(notnull IEntity child, vector pLocalSpaceMatrix[4])
string GetStateString()
returns debug string of current state
Definition human.c:383
bool CanRoll()
void PrePhysUpdate(float pDt)
proto native void ResetAligning()
disables character aligning
proto native void PhysicsEnableGravity(bool pEnable)
proto native void Cancel()
cancels action
CommandActionAdditive
Definition human.c:14
proto native HumanCommandLadder GetCommand_Ladder()
CommandSwim
Definition human.c:11
proto native bool IsLanding()
returns true if fall is in landing state
proto native void UnlinkFromLocalSpace()
proto native int GetCommandModifierCount()
private void ~HumanCommandDeath()
Definition human.c:603
static const int LANDTYPE_HEAVY
Definition human.c:571
void OnCommandDamageFullbodyFinish()
enum WeaponActionReloadClipTypes MECHANISM_SPECIAL
static const int STATE_LOOP_LOOP
Definition human.c:344
proto native HumanCommandFullBodyDamage GetCommand_Damage()
proto native void Land(int pLandType)
end fall with land
enum HumanMoveCommandID GetTransformWS(out vector pTm[4])
gets human transform in World Space
void OnCommandLadderStart()
proto native HumanCommandUnconscious StartCommand_Unconscious(float pType)
starts command - unconscious
class HumanInputController TAnimGraphCommand
WeaponActionReloadTypes
Definition human.c:814
@ RELOAD_MAGAZINE_DETACH
Definition human.c:833
@ RELOADRIFLE_NOMAGAZINE_NOBULLET_OPEN
Definition human.c:821
@ RELOADPISTOL_NOMAGAZINE_NOBULLET_CLOSED_COCKED
Definition human.c:829
@ RELOADRIFLE_MAGAZINE_DETACH
Definition human.c:834
@ RELOADPISTOL_NOMAGAZINE_NOBULLET_CLOSED_UNCOCKED
Definition human.c:824
@ RELOADRIFLE_MAGAZINE_NOBULLET
Definition human.c:818
@ RELOADSRIFLE_MAGAZINE_NOBULLET
Definition human.c:838
@ RELOADPISTOL_NOMAGAZINE_NOBULLET_OPENED
Definition human.c:830
@ RELOADPISTOL_MAGAZINE_NOBULLET_CLOSED_COCKED
Definition human.c:828
@ RELOADSRIFLE_NOMAGAZINE_NOBULLET
Definition human.c:839
@ RELOADPISTOL_MAGAZINE_NOBULLET_OPENED
Definition human.c:831
@ RELOADPISTOL_NOMAGAZINE_BULLET_CLOSED
Definition human.c:827
@ RELOADRIFLE_NOMAGAZINE_NOBULLET
Definition human.c:819
@ RELOADSRIFLE_MAGAZINE_BULLET
Definition human.c:836
@ RELOADRIFLE_NOMAGAZINE_BULLET
Definition human.c:817
@ RELOADPISTOL_MAGAZINE_BULLET_CLOSED
Definition human.c:826
@ RELOADRIFLE_MAGAZINE_NOBULLET_OPEN
Definition human.c:820
@ RELOADPISTOL_MAGAZINE_NOBULLET_CLOSED_UNCOCKED
Definition human.c:825
@ RELOADRIFLE_MAGAZINE_BULLET
reload action types - rifles
Definition human.c:816
@ RELOADSRIFLE_NOMAGAZINE_BULLET
Definition human.c:837
None
Definition human.c:0
void OnCommandMelee2Finish()
proto native int GetState()
returns one of STATE_...
void OnCommandVehicleStart()
proto native void StartModifier(int pType)
starts modifier
static const int STATE_LOOP_LOOP2
Definition human.c:347
proto native HumanCommandClimb StartCommand_Climb(SHumanCommandClimbResult pClimbResult, int pType)
--— CLIMB --—
CommandUnconscious
Definition human.c:7
proto native Human GetHuman()
get the human this cb belongs to
void OnCommandMoveFinish()
void OnCommandDeathFinish()
IEntity m_ClimbStandPointParent
parent of grabpoint
Definition human.c:744
class HumanMovementState OnActivate()
HumanCommandScript fully scriptable command.
Definition human.c:1169
class HumanCommandMelee2 HumanCommandFall()
Definition human.c:565
proto native HumanInputController GetInputController()
returns human input controller
void OnRollStart(bool isToTheRight)
proto native HumanCommandSwim StartCommand_Swim()
--— LADDER --—
vector m_ClimbStandPoint
normal to grabpoint position (used for character orientation)
Definition human.c:740
void OnStanceChange(int previousStance, int newStance)
gets called on stance change
ClimbStates
state of climb command
Definition human.c:751
@ STATE_FINISH
Definition human.c:756
@ STATE_MOVE
Definition human.c:752
@ STATE_TAKEOFF
Definition human.c:753
@ STATE_ONTOP
Definition human.c:754
@ STATE_FALLING
Definition human.c:755
proto native bool IsInComboRange()
returns true if hit is in range, where person can continue to combo
proto native HumanItemAccessor GetItemAccessor()
void OnCommandDamageFullbodyStart()
CommandDamageAdditive
Definition human.c:9
bool m_bIsClimbOver
Definition human.c:732
proto native HumanCommandLadder StartCommand_Ladder(Building pBuilding, int pLadderIndex)
--— LADDER --—
void OnCommandSwimStart()
CommandDamageFullbody
Definition human.c:8
proto native HumanCommandAdditives GetCommandModifier_Additives()
default (always-on modifiers)
WeaponActionUnjammingTypes
Definition human.c:894
@ UNJAMMING_INTERRUPT
Definition human.c:898
@ UNJAMMING_END
Definition human.c:897
@ UNJAMMING_START
unjam action types
Definition human.c:896
void OnCommandUnconsciousFinish()
private void ~HumanCommandDamage()
Definition human.c:627
CommandFall
Definition human.c:4
int TAnimGraphEvent
Definition human.c:270
proto native bool IsOnBack()
return true if prone is on back
proto native bool PhysicsIsSolid()
vector m_ClimbOverStandPoint
where climb ends (in local space of it's parent)
Definition human.c:741
proto native HumanCommandScript GetCommand_Script()
is human is in command action - returns its callback, if current command is action
void OnCommandClimbFinish()
private void ~HumanCommandFall()
Definition human.c:566
IEntity m_GrabPointParent
where climb over ends (in local space of it's parent)
Definition human.c:743
proto native bool DefaultCancelCondition()
system implemented cancel condition (now raise or sprint cancels action)
proto native HumanCommandScript StartCommand_Script(HumanCommandScript pHumanCommand)
— SCRIPTED COMMANDS
WeaponActionFireTypes
Definition human.c:902
@ FIRE_NORMAL
Definition human.c:903
@ FIRE_JAM
Definition human.c:908
@ FIRE_LAST
Definition human.c:904
@ FIRE_COCKED
Definition human.c:905
@ FIRE_UNCOCKED
Definition human.c:906
@ FIRE_DRY
Definition human.c:907
void OnCommandActionFullbodyFinish()
void OnCommandActionFullbodyStart()
class HumanCommandWeapons HumanCommandAdditives()
Definition human.c:1088
private void HumanItemAccessor()
Definition humanitems.c:141