38class DeathEffectTimer
extends Timer
44 PPERequesterBank.GetRequester(PPERequester_DeathDarkening).Stop();
48#ifdef FEATURE_NETWORK_RECONCILIATION
50class DayZPlayerImplementOwnerState : DayZPlayerOwnerState
52 float m_fLastHeadingDiff;
54 protected override event void Write(PawnStateWriter ctx)
58 ctx.Write(m_fLastHeadingDiff);
61 protected override event void Read(PawnStateReader ctx)
65 ctx.Read(m_fLastHeadingDiff);
69class DayZPlayerImplementMove : DayZPlayerMove
71 protected override event void Write(PawnMoveWriter ctx, PawnMove prev)
73 super.Write(ctx, prev);
77 protected override event void Read(PawnMoveReader ctx, PawnMove prev)
79 super.Read(ctx, prev);
147 protected int m_StepCounterVegetation
193 #ifdef PLATFORM_CONSOLE
206 RegisterNetSyncVariableBoolSignal(
"m_TriggerPullPlayerOutOfVehicleSynch");
209#ifdef FEATURE_NETWORK_RECONCILIATION
212 return DayZPlayerImplementOwnerState;
217 return DayZPlayerImplementMove;
220 protected override event void ObtainState( PawnOwnerState pState)
222 super.ObtainState(pState);
224 DayZPlayerImplementOwnerState state = DayZPlayerImplementOwnerState.Cast(pState);
226 state.m_fLastHeadingDiff = m_fLastHeadingDiff;
229 protected override event void RewindState(PawnOwnerState pState, PawnMove pMove, inout NetworkRewindType pRewindType)
231 super.RewindState(pState, pMove, pRewindType);
233 DayZPlayerImplementOwnerState state = DayZPlayerImplementOwnerState.Cast(pState);
235 if (pRewindType != NetworkRewindType.ADDITIVE)
237 m_fLastHeadingDiff = state.m_fLastHeadingDiff;
402 EntityAI entityInHands = GetEntityInHands();
406 optics = weapon.GetAttachedOptics();
434 if (optic.HasEnergyManager())
435 optic.GetCompEM().SwitchOn();
444 if (optic.HasEnergyManager())
445 optic.GetCompEM().SwitchOff();
516 string text = super.GetDebugText();
518 text +=
"IsSimulationDisabled: " + GetIsSimulationDisabled() +
"\n";
543 for (
int i = 0; i < transport.CrewSize(); ++i)
545 if (transport.CrewMember(i) ==
this)
557 transport.CrewGetOut(crewIdx);
564#ifdef FEATURE_NETWORK_RECONCILIATION
570 identity.Possess(
this);
584 DisableSimulation(
false);
605 super.OnVariablesSynchronized();
622 EntityAI itemInHands = GetEntityInHands();
631 GetBoneTransformWS(boneIndex, m4);
635 GetInventory().DropEntityWithTransform(
InventoryMode.SERVER,
this, itemInHands, m4);
640 int deadBodyLifetime = ceApi.GetCEGlobalInt(
"CleanupLifetimeDeadPlayer");
641 if (deadBodyLifetime <= 0)
643 deadBodyLifetime = 3600;
646 itemInHands.SetLifetime(deadBodyLifetime);
661 PhysicsSetSolid(
true);
664 DayZPlayerVehicleCommandDeathCallback callbackVeh;
703 keepInLocalSpace =
true;
717#ifdef FEATURE_NETWORK_RECONCILIATION
723 identity.Possess(
this);
731 motorbike.FallOver();
735 DisableSimulation(
false);
736 GetItemAccessor().HideItemInHands(
false);
745 PhysicsSetSimpleDeath(
true);
749 g_Game.GetWorld().SetVoiceOn(
false,
false);
764 switch (pCurrentCommandID)
799 super.EEKilled(killer);
812 if (!
g_Game.GetMission().IsPlayerRespawning())
814 message =
"#dayz_implement_dead";
817 #ifdef PLATFORM_CONSOLE
818 g_Game.GetUIManager().ScreenFadeIn(duration, message, FadeColors.DARK_RED, FadeColors.WHITE);
820 g_Game.GetUIManager().ScreenFadeIn(duration, message, FadeColors.BLACK, FadeColors.WHITE);
825 g_Game.GetUIManager().ScreenFadeOut(duration);
846 if (
g_Game.GetMissionState() != DayZGame.MISSION_STATE_GAME)
854 if (m_KilledByHeadshot)
870 g_Game.GetSoundScene().SetSoundVolume(0,0);
871 g_Game.GetSoundScene().SetSpeechExVolume(0,0);
872 g_Game.GetSoundScene().SetMusicVolume(0,0);
873 g_Game.GetSoundScene().SetVOIPVolume(0,0);
874 g_Game.GetSoundScene().SetRadioVolume(0,0);
891 if (
g_Game.GetUIManager())
893 g_Game.GetUIManager().ShowUICursor(
true);
894 if (
g_Game.GetUIManager().IsDialogVisible())
895 g_Game.GetUIManager().CloseDialog();
904 if (
g_Game.GetUIManager())
906 if (
g_Game.GetUIManager().GetMenu())
908 g_Game.GetUIManager().ShowUICursor(
true);
912 g_Game.GetUIManager().ShowUICursor(
false);
948 int userDataType = 0;
949 if (!ctx.
Read(userDataType))
951 Error(
"DayZPlayer: OnInputForRemote - cannot read input type");
955 switch (userDataType)
967 Error(
"OnInputForRemote - unknown userDataType=" + userDataType);
974 int userDataType = 0;
975 if (!ctx.
Read(userDataType))
977 Error(
"DayZPlayer: OnInputFromServer - cannot read input type");
981 switch (userDataType)
987 Error(
"OnInputFromServer - unknown userDataType=" + userDataType);
1006 GetItemAccessor().OnItemInHandsChanged(pInstant, pChangeAnimationInstance);
1011 GetItemAccessor().ResetWeaponInHands();
1030 ItemOptics optic = weapon.GetAttachedOptics();
1040 if (wantedLift != currentLift)
1050 if (wantedObstruction != currentObstruction)
1054 const float outTime = 0.150;
1055 const float inTime = 0.010;
1056 const float inTimeLift = 0.100;
1061 wantedObstruction = 0.0;
1062 smoothTime = inTimeLift;
1067 smoothTime =
Math.
Lerp(outTime, inTime, t);
1077 #ifdef DIAG_DEVELOPER
1085 #ifdef DIAG_DEVELOPER
1114 weapon.StepZeroingUpAllMuzzles();
1125 weapon.StepZeroingDownAllMuzzles();
1132 HandleOptic(optic,
false, pInputs, pExitIronSights);
1138 if (weapon && weapon.IsInOptics())
1140 weapon.ExitOptics();
1164 bool autofire = weapon.GetCurrentModeAutoFire(weapon.GetCurrentMuzzle()) && weapon.IsChamberEjectable(weapon.GetCurrentMuzzle());
1165 int burst = weapon.GetCurrentModeBurstSize(weapon.GetCurrentMuzzle());
1166 int burst_count = weapon.GetBurstCount();
1167 if (!autofire && (burst < 2 || burst_count < 1))
1174 else if (autofire || burst > 1)
1176#ifdef DIAG_DEVELOPER
1178 if (burst_option == 0)
1183 if (autofire || burst_count < burst)
1190 weapon.ResetBurstCount();
1192#ifdef DIAG_DEVELOPER
1194 else if (burst_option == 1)
1196 if (burst > 1 && burst_count == burst)
1198 weapon.ResetBurstCount();
1200 else if (burst > 1 && burst_count < burst)
1217 #ifdef PLATFORM_CONSOLE
1220 if (!weapon.IsWaitingForActionFinish() && !
IsFighting())
1222 int muzzle_index = weapon.GetCurrentMuzzle();
1224 if (weapon.IsChamberFiredOut(muzzle_index))
1226 if (weapon.CanProcessWeaponEvents())
1231 pExitIronSights =
true;
1255 bool controllerPressIn;
1256 bool controllerPressOut;
1260 weapon =
Weapon_Base.Cast(optic.GetHierarchyParent());
1261 FOVcount = optic.GetStepFOVCount();
1262 controllerPressIn = input.
SyncedPress_ID(UAZoomInOpticsControllerHelper);
1268 optic.SetStepFOVIndex(0);
1272 if (controllerPressIn)
1274 if (!optic.StepFOVUp())
1278 optic.SetStepFOVIndex(0);
1281 if (weapon && weapon.CanEnterIronsights())
1297 weapon =
Weapon_Base.Cast(optic.GetHierarchyParent());
1298 FOVcount = optic.GetStepFOVCount();
1299 controllerPressOut = input.
SyncedPress_ID(UAZoomOutOpticsControllerHelper);
1302 if (!optic.StepFOVDown())
1304 if (controllerPressOut)
1306 if (FOVcount > 0 && (!weapon || !weapon.CanEnterIronsights()))
1308 optic.SetStepFOVIndex(FOVcount - 1);
1312 if (weapon && weapon.CanEnterIronsights())
1324 optic.SetStepFOVIndex(FOVcount - 1);
1361 SyncHitInfo greatest_hit;
1363 for (
int i = 0; i < nSyncedHitDataArray; ++i)
1370 if (IsAlive() && !IsUnconscious() && data.m_HasSource &&
g_Game.GetMission().GetHud() &&
g_Game.GetPlayer() ==
this)
1385 greatest_hit = data;
1388 else if (data.m_Fullbody)
1390 greatest_hit = data;
1458 bool doPhxImpulse =
g_Game.ConfigGetInt(
"cfgAmmo " + pAmmoType +
" doPhxImpulse") > 0;
1465 vector targetDirection = GetDirection();
1468 targetDirection[1] = 0;
1469 toSourceDirection[1] = 0;
1474 float cosFi =
vector.
Dot(targetDirection, toSourceDirection);
1475 vector cross = targetDirection * toSourceDirection;
1479 pAnimHitDir = -pAnimHitDir;
1487 int invertHitDir = 0;
1490 pAnimHitFullbody =
false;
1493 switch (pDamageType)
1500 pAnimType =
g_Game.ConfigGetInt(
"cfgAmmo " + pAmmoType +
" hitAnimation");
1501 invertHitDir =
g_Game.ConfigGetInt(
"cfgAmmo " + pAmmoType +
" invertHitDir");
1503 pAnimHitFullbody =
true;
1507 int impactBehaviour = 0;
1509 if (!IsUnconscious() && GetHealth(
"",
"Shock") > 25)
1512 if (pComponent ==
"Torso" || pComponent ==
"Head")
1514 impactBehaviour =
g_Game.ConfigGetInt(
"cfgAmmo " + pAmmoType +
" impactBehaviour");
1517 if ((fireDamage > 80.0 || shockDamage > 40.0) && impactBehaviour == 1)
1518 pAnimHitFullbody =
true;
1528 pAnimType =
g_Game.ConfigGetInt(
"cfgAmmo " + pAmmoType +
" hitAnimation");
1530 pAnimHitFullbody =
true;
1538 vector targetDirection = GetDirection();
1541 targetDirection[1] = 0;
1542 toSourceDirection[1] = 0;
1547 float cosFi =
vector.
Dot(targetDirection, toSourceDirection);
1548 vector cross = targetDirection * toSourceDirection;
1553 if (invertHitDir > 0)
1557 pAnimHitDir = -pAnimHitDir;
1565 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
1567 m_TransportHitRegistered =
false;
1572 float animHitDirDeath;
1578 if (!m_DeathSyncSent)
1580 Man killer = source.GetHierarchyRootPlayer();
1585 m_KillerData.m_Killer = killer;
1586 m_KillerData.m_MurderWeapon = source;
1589 if (killer && killer.IsPlayer())
1592 if (dmgZone ==
"Brain")
1594 m_KilledByHeadshot =
true;
1595 if (m_KillerData.m_Killer == killer)
1596 m_KillerData.m_KillerHiTheBrain =
true;
1605 bool animHitFullbody;
1606 if (
EvaluateDamageHitAnimation(damageResult, damageType, source, dmgZone, ammo, modelPos, animType, animHitDir, animHitFullbody))
1610 bool skipSoundRequest =
false;
1611 if (damageType ==
DamageType.CUSTOM && GetCommand_Fall())
1614 if (!skipSoundRequest)
1620 if (animHitFullbody)
1680 if (actMenuValue != 0)
1710 if (IsUnconscious() || (GetCommand_Move() && GetCommand_Move().
IsLeavingUncon()))
1793 if (
IsRaised() && GetInputInterface().SyncedPress(
"UAGetOverControllerHelper"))
1821 bool CanClimb(
int climbType, SHumanCommandClimbResult climbRes)
1829 if (
IsRaised() && GetInputInterface().SyncedPress(
"UAGetOverControllerHelper"))
1841 if (
Class.
CastTo(entity,climbRes.m_GrabPointParent) && entity.IsHologram())
1843 if (
Class.
CastTo(entity,climbRes.m_ClimbStandPointParent) && entity.IsHologram())
1845 if (
Class.
CastTo(entity,climbRes.m_ClimbOverStandPointParent) && entity.IsHologram())
1897 bool bADSToggle =
false;
1898 bool exitSights =
false;
1905 if (playerPB.IsRolling())
1910 bool isItemInHandsWeapon = hia.IsItemInHandsWeapon();
1925 if (
m_bADS != isWeaponADS)
1946 if (bADSToggle && !GetCommand_Melee2() && !
GetThrowing().IsThrowingModeEnabled())
1948 if (hia.IsItemInHandsWeapon() && playerPB.GetWeaponManager() && !playerPB.GetWeaponManager().IsRunning())
1951 ItemOptics optic = weapon.GetAttachedOptics();
1952 bool switchToADS =
false;
1953 bool canUseIronsights = weapon.CanEnterIronsights();
1954 bool canUseOptics = optic != NULL;
1956 if (canUseIronsights || canUseOptics)
1964 switchToADS =
false;
1972 else if (switchToADS)
1975 if (weapon.GetWasIronSight() && !canUseIronsights)
1977 weapon.SetWasIronSight(
false);
1979 else if (!weapon.GetWasIronSight() && !canUseOptics)
1981 weapon.SetWasIronSight(
true);
1984 if (weapon.GetWasIronSight())
1989 else if (!weapon.GetWasIronSight() || (!canUseIronsights && canUseOptics))
2032 int thirdPersonViewMode =
g_Game.GetWorld().GetThirdPersonViewMode();
2093 float headingAngle = MiscGameplayFunctions.GetHeadingAngle(
this);
2096 float headingAngleDiff = 0.0;
2107 if (headingAngleDiff > 0.2)
2109 int time =
g_Game.GetTime();
2111 float timefilterconstant = 400 - (headingAngleDiff * 100);
2115 float volume = headingAngleDiff / 0.5;
2131 string soundSetName =
"Cloth_Body_longmove_TShirt_Soundset";
2133 string bodyClothName =
"";
2137 bodyClothName = attachment.GetAttachmentSoundType();
2140 if (bodyClothName !=
"")
2142 string path =
"CfgSoundTables CfgAttachmentSoundTables Cloth_Body_Longmove_LookupTable";
2143 int soundCount =
g_Game.ConfigGetChildrenCount(
path);
2145 for (
int i = 0; i < soundCount; i++)
2150 if (
name == bodyClothName)
2153 g_Game.ConfigGetTextArray(
path +
" " +
name +
" soundSets", stringArray);
2154 soundSetName = stringArray.
Get(0);
2164 if (soundObjectBuilder != NULL)
2166 SoundObject soundObject = soundObjectBuilder.BuildSoundObject();
2168 if (soundObject != NULL)
2174 wave.SetVolumeRelative(volume);
2184 float volume2 = headingAngleDiff * 2;
2200 string soundSetName2 =
"walkProne_noHS_asphalt_ext_Char_SoundSet";
2203 if (surfaceType !=
"")
2205 string movementSurfaceType =
"walkProne_" + surfaceType;
2207 string path2 =
"CfgSoundTables CfgStepSoundTables walkProne_noHS_Char_LookupTable";
2208 int soundCount2 =
g_Game.ConfigGetChildrenCount(path2);
2210 for (
int i2 = 0; i2 < soundCount2; i2++)
2213 g_Game.ConfigGetChildName(path2, i2, name2);
2215 if (name2 == movementSurfaceType)
2218 g_Game.ConfigGetTextArray(path2 +
" " + name2 +
" soundSets", stringArray2);
2219 soundSetName2 = stringArray2.
Get(0);
2221 delete stringArray2;
2229 if (soundObjectBuilder2 != NULL)
2231 SoundObject soundObject2 = soundObjectBuilder2.BuildSoundObject();
2233 if (soundObject2 != NULL)
2237 AbstractWave wave2 =
g_Game.GetSoundScene().Play3D(soundObject2, soundObjectBuilder2);
2239 wave2.SetVolumeRelative(volume2);
2288 override void CommandHandler(
float pDt,
int pCurrentCommandID,
bool pCurrentCommandFinished)
2292 vector playerPosition = PhysicsGetPositionWS();
2295 GetHumanInventory().Update(pDt);
2305 EntityAI entityInHands = GetEntityInHands();
2309 bool isWeapon = entityInHands && entityInHands.IsInherited(
Weapon);
2311 bool updateAimingMdfr =
false;
2315 updateAimingMdfr =
true;
2320 updateAimingMdfr =
true;
2324 if (updateAimingMdfr)
2326 if (isRaisedNow && isWeapon)
2342 bool exitIronSights =
false;
2347 bool exitOptic =
false;
2375 if (
m_Swimming.CheckSwimmingStart( waterLevel ) )
2380 StartCommand_Swim();
2387 if (pCurrentCommandFinished)
2404 if (PhysicsIsFalling(
true))
2406 StartCommand_Fall(0);
2414 StartCommand_Swim();
2418 StartCommand_Move();
2440 hcv = GetCommand_Vehicle();
2452 if (IsAlive() && IsAuthority() && transport && transport.CrewShouldEject(seatPos))
2457 GetGame().GetMission().MissionScript.CallFunction(
this,
"GetModifiersManager", mdfMan, null);
2458 mdfMan.ActivateModifier(
eModifiers.MDF_UNCONSCIOUSNESS);
2529 OnLand(pCurrentCommandID, fallDamageData);
2530 npar = type.GetNoiseParamsLandLight();
2533 else if (fallDamageData.
m_Height < 3.0)
2540 OnLand(pCurrentCommandID, fallDamageData);
2541 npar = type.GetNoiseParamsLandLight();
2544 else if (fallDamageData.
m_Height < 5.0)
2547 OnLand(pCurrentCommandID, fallDamageData);
2548 npar = type.GetNoiseParamsLandHeavy();
2554 OnLand(pCurrentCommandID, fallDamageData);
2555 npar = type.GetNoiseParamsLandHeavy();
2561 OnPlayerRecievedHit();
2574 else if (PhysicsIsFalling(
false))
2577 StartCommand_Fall(0);
2594 hcls.m_fFwMaxDistance = 3;
2596 hcls.m_fFwMaxDistance = 1.2;
2598 SHumanCommandClimbResult ret;
2624 if (amplitude > 0.1 || force)
2627 ad.SetTalking(
true);
2632 int now =
g_Game.GetTime();
2637 int voiceLevel =
g_Game.GetVoiceLevel(
this);
2644 case VoiceLevelWhisper:
2645 vonpar = pt.GetNoiseParamsWhisper();
2647 case VoiceLevelTalk:
2648 vonpar = pt.GetNoiseParamsTalk();
2650 case VoiceLevelShout:
2651 vonpar = pt.GetNoiseParamsShout();
2661 ad.SetTalking(
false);
2673 m_Throwing.HandleThrowing(hic, hcw, entityInHands, pDt);
2717 playerDebug.CommandHandler();
2749 EntityAI item_in_hands = player.GetEntityInHands();
2750 if (item_in_hands != NULL && player.CanDropEntity(item_in_hands) &&
g_Game.GetPlayer().GetHumanInventory().CanRemoveEntityInHands())
2752 player.PredictiveDropEntity(item_in_hands);
2824 ad.SetInjured(v,
true);
2831 ad.SetExhaustion(v,
true);
2851 EntityAI entityInHands = GetEntityInHands();
2854 optics = weapon.GetAttachedOptics();
2855 else if (entityInHands)
2893 int thirdPersonViewMode =
g_Game.GetWorld().GetThirdPersonViewMode();
2907 return transport.Get3rdPersonCameraType();
3026 #ifdef PLATFORM_CONSOLE
3027 if (
GetUApi().GetInputByID(UAVoiceModifierHelper).LocalValue() == 0)
3042 int userDataTypeParam = 0;
3043 if (!ctx.
Read(userDataTypeParam))
3045 Error(
"DayZPlayerImplement: cannot read input type");
3062 if (ctx.
Read(target))
3068 if (ctx.
Read(hitPos))
3073 int hitZoneIdx = -1;
3074 if (ctx.
Read(hitZoneIdx))
3079 int finisherType = -1;
3080 if (ctx.
Read(finisherType))
3082 if (finisherType != -1 && target)
3085 if (!target.IsAlive() || !target.CanBeBackstabbed() || !isWithinRange)
3105 switch (pJunctureID)
3113 SyncHitInfo data =
new SyncHitInfo;
3127 switch (boots.GetAttachmentSoundType())
3145 switch (attachment.GetAttachmentSoundType())
3148 return AnimUpperBodyType.NylonJacket;
3150 return AnimUpperBodyType.TShirt;
3152 return AnimUpperBodyType.WoolShirt;
3154 return AnimUpperBodyType.HeavyJacket;
3155 case "LeatherJacket":
3156 return AnimUpperBodyType.LeatherJacket;
3158 return AnimUpperBodyType.Coat;
3159 case "ChemlonDress":
3160 return AnimUpperBodyType.ChemlonDress;
3162 return AnimUpperBodyType.Ghillie;
3164 return AnimUpperBodyType.Chainmail;
3168 return AnimUpperBodyType.None;
3176 switch (back.GetAttachmentSoundType())
3179 return AnimBackType.Small;
3181 return AnimBackType.Military;
3183 return AnimBackType.Outdoor;
3185 return AnimBackType.Ghillie;
3189 return AnimBackType.None;
3198 AnimRangedWeaponType shoulderAttType = AnimRangedWeaponType.None;
3199 AnimRangedWeaponType meleeAttType = AnimRangedWeaponType.None;
3201 if (shoulderAttachment)
3203 switch (shoulderAttachment.GetAttachmentSoundType())
3207 shoulderAttType = AnimRangedWeaponType.Shotgun;
3212 shoulderAttType = AnimRangedWeaponType.Rifle;
3217 if (meleeAttachment)
3219 switch (meleeAttachment.GetAttachmentSoundType())
3223 meleeAttType = AnimRangedWeaponType.Shotgun;
3228 meleeAttType = AnimRangedWeaponType.Rifle;
3234 if (shoulderAttType == AnimRangedWeaponType.Shotgun || meleeAttType == AnimRangedWeaponType.Shotgun)
3235 return AnimRangedWeaponType.Shotgun;
3237 if (shoulderAttType == AnimRangedWeaponType.Rifle || meleeAttType == AnimRangedWeaponType.Rifle)
3238 return AnimRangedWeaponType.Rifle;
3240 return AnimRangedWeaponType.None;
3260 if (noisePar != null)
3261 g_Game.GetNoiseSystem().AddNoise(
this, noisePar, noiseMultiplier);
3275 GetMovementState(state);
3280 string boneName =
"";
3281 if (pUserInt % 2 == 1)
3283 boneName =
"leftfoot";
3284 surfaceInfo =
g_Game.GetSurfaceInfoUnderObjectByBone(
this, SurfaceAnimationBone.LeftBackLimb);
3287 surfaceInfo =
g_Game.GetSurfaceInfoUnderObjectByBone(
this, SurfaceAnimationBone.RightBackLimb);
3288 boneName =
"rightfoot";
3293 boneName =
"rightfoot";
3294 surfaceInfo =
g_Game.GetSurfaceInfoUnderObjectByBone(
this, SurfaceAnimationBone.RightBackLimb);
3297 surfaceInfo =
g_Game.GetSurfaceInfoUnderObjectByBone(
this, SurfaceAnimationBone.LeftBackLimb);
3298 boneName =
"leftfoot";
3311 #ifdef DIAG_DEVELOPER
3316 string surfaceType =
"NULL";
3320 CharacterStepsDebug.SetStepData(boneName, surfaceType);
3356 if (stepParticleID > 0)
3369 surfaceInfo =
g_Game.GetSurfaceInfoUnderObject(
this);
3376 if (soundBuilder != null &&
g_Game.GetPlayer())
3378 m_StepCounterVegetation++;
3380 if (m_StepCounterVegetation >= 3)
3382 m_StepCounterVegetation = 0;
3383 g_Game.ProfilerStart(
"Player_Vegetation_Sounds");
3388 excludedObjects.Insert(
this);
3391 if (
g_Game.IsBoxCollidingGeometry(
position,
orientation, edgeLength, ObjIntersectView, ObjIntersectNone, excludedObjects, collidedObjects))
3393 foreach (
Object obj : collidedObjects)
3401 if (colPlant.HasPlayerCollisionSound())
3409 if (vegSoundObjectBuilder)
3411 vegSoundObject = vegSoundObjectBuilder.BuildSoundObject();
3418 if (vegetationSound.GetAnimEventIds().Find(pUserInt) >= 0)
3420 vegSoundObjectBuilder = vegetationSound.GetSoundObjectBuilder();
3421 vegSoundObject = vegSoundObjectBuilder.BuildSoundObject();
3427 if (vegSoundObject != null)
3430 PlaySound(vegSoundObject, vegSoundObjectBuilder);
3439 g_Game.ProfilerStop(
"Player_Vegetation_Sounds");
3442 SoundObject soundObject = soundBuilder.BuildSoundObject();
3443 if (soundObject != null)
3457 float noiseMultiplier = 0;
3461 noiseParams = playerType.GetNoiseParamsStand();
3463 noiseParams = playerType.GetNoiseParamsCrouch();
3465 noiseParams = playerType.GetNoiseParamsProne();
3468 Debug.
Log(
string.Format(
"Wrong stance, id: %1 using backup with stand stance (id: 0)", state.
m_iStanceIdx));
3469 noiseParams = playerType.GetNoiseParamsStand();
3474 AddNoise(noiseParams, noiseMultiplier);
3486 int eventReplaceID = 0;
3488 if (pEventType ==
"Sound")
3499 else if (pEventType ==
"SoundWeapon")
3510 else if (pEventType ==
"SoundAttachment")
3514 else if (pEventType ==
"SoundVoice")
3541 Debug.
Log(
"OnSoundEvent: Unknown sound event \"" + pEventType +
"\"");
3554 AnimSoundEvent soundEvent = null;
3558 EntityAI entityInHands = GetEntityInHands();
3559 if (entityInHands && entityInHands.IsInherited(
ItemBase))
3563 if (item.HasQuantity())
3564 quantity = (
float)item.GetQuantity() / (item.GetQuantityMax() - item.GetQuantityMin());
3566 soundEvent = invItemType.GetSoundEvent(pUserInt);
3569 if (soundEvent == null)
3572 soundEvent = type.GetSoundWeaponEvent(pUserInt);
3575 if (soundEvent != null)
3577 if (!
g_Game.IsHeadlessOrDedicatedServer())
3582 builder.AddVariable(
"quantity", quantity);
3583 builder.AddVariable(
"interior", IsSoundInsideBuilding());
3585 SoundObject soundObject = builder.BuildSoundObject();
3586 if (soundObject != NULL)
3591 if (pUserString ==
"StopOnAnimEnd")
3603 AddNoise(soundEvent.m_NoiseParams);
3615 pUserString.
Split(
",", attachments);
3616 for (
int i = 0; i < attachments.Count(); i++)
3618 int attachmentHash = -1;
3619 if (attachments[i] ==
"shoulder")
3621 else if (attachments[i] ==
"body")
3623 else if (attachments[i] ==
"back")
3628 if (soundBuilder != NULL)
3630 SoundObject soundObject = soundBuilder.BuildSoundObject();
3631 if (soundObject != NULL)
3645 soundObjectBuilder.AddVariable(
"laddertype", 1);
3649 soundObjectBuilder.AddVariable(
"laddertype", 0);
3656 soundObjectBuilder.AddVariable(
"bare", 1);
3657 soundObjectBuilder.AddVariable(
"sneakers", 0);
3658 soundObjectBuilder.AddVariable(
"boots", 0);
3662 soundObjectBuilder.AddVariable(
"bare", 0);
3663 soundObjectBuilder.AddVariable(
"sneakers", 1);
3664 soundObjectBuilder.AddVariable(
"boots", 0);
3668 soundObjectBuilder.AddVariable(
"bare", 0);
3669 soundObjectBuilder.AddVariable(
"sneakers", 0);
3670 soundObjectBuilder.AddVariable(
"boots", 1);
3677 DayZPlayerTypeAnimTable table = type.GetSoundTable();
3678 AnimSoundEvent soundEvent;
3681 soundEvent = table.GetSoundEvent(pUserInt);
3684 if (soundEvent != NULL)
3686 if (!
g_Game.IsHeadlessOrDedicatedServer())
3689 if (GetCommand_Ladder())
3693 objectBuilder.AddEnvSoundVariables(
GetPosition());
3695 SoundObject soundObject = objectBuilder.BuildSoundObject();
3696 if (soundObject != NULL)
3701 if (pUserString ==
"StopOnAnimEnd")
3708 if (soundEvent.m_NoiseParams != NULL)
3709 g_Game.GetNoiseSystem().AddNoise(
this, soundEvent.m_NoiseParams);
3731 if (mask || head_gear)
3733 string category_mask;
3734 string category_headgear;
3737 int priority_headgear;
3741 category_mask = mask.ConfigGetString(
"soundVoiceType");
3742 priority_mask = mask.ConfigGetInt(
"soundVoicePriority");
3746 category_headgear = head_gear.ConfigGetString(
"soundVoiceType");
3747 priority_headgear = head_gear.ConfigGetInt(
"soundVoicePriority");
3750 if (priority_headgear >= priority_mask && category_headgear !=
"")
3752 category = category_headgear;
3756 category = category_mask;
3771 int maleVoiceType = 0;
3772 int femaleVoiceType = 0;
3773 if (player.IsMale())
3775 maleVoiceType = player.GetVoiceType();
3779 femaleVoiceType = player.GetVoiceType();
3782 soundBuilder.AddVariable(
"male", maleVoiceType);
3783 soundBuilder.AddVariable(
"female", femaleVoiceType);
3786 SoundObject soundObject = soundBuilder.BuildSoundObject();
3787 if (soundObject != NULL)
3790 wave =
PlaySound(soundObject, soundBuilder);
3814 bool unconscious = IsUnconscious();
3817 if (ib && (
PlayerBase.DEBUG_INVENTORY_ACCESS || !IsAlive() || restrained || unconscious || ib.CanBeMovedOverride()))
3846 if (!IsAlive() || player.IsUnconscious())
3856 super.OnRPC(sender, rpc_type, ctx);
3858 if (rpc_type ==
ERPCs.RPC_DAYZPLAYER_DEBUGSERVERWALK)
3860 Print(
"ERPCs.RPC_DAYZPLAYER_DEBUGSERVERWALK");
3862 Param1<bool> rp =
new Param1<bool>(
false);
3865 GetInputController().OverrideMovementSpeed(rp.param1, 1);
3866 GetInputController().OverrideAimChangeX(rp.param1, 0.01);
3881 return fall.PhysicsLanded();
3917 StartCommand_Move();
3971 RegisterTransportHit(transport);
3978 if (
g_Game.GetPlayer() != NULL && (IsSoundInsideBuilding() !=
g_Game.GetPlayer().IsSoundInsideBuilding() || IsCameraInsideVehicle() !=
g_Game.GetPlayer().IsCameraInsideVehicle()))
4043 preferredOptics = opticsInHands;
4050 preferredOptics = weaponInHands.GetAttachedOptics();
4059 optics.Insert(preferredOptics);
4072 foreach (
Entity nvg : nvgs)
4083 NVGoggles goggles = NVGoggles.Cast(nvAttachment);
4089 optics.Insert(goggles);
4097#ifdef DIAG_DEVELOPER
4100 return Weapon_Base.Cast(GetHumanInventory().CreateInHands(type));
4121 [
Obsolete(
"1.30: uses CGame GetSurfaceInfo* methods instead")]
4127 g_Game.SurfaceUnderObjectByBoneCorrectedLiquid(
this, limbType, surfaceType, liquidType);
void syncDebugPrint(string s)
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
void HandleCeilingDustStepEffect(SurfaceInfo surfaceInfo)
void OnRPC(PlayerIdentity sender, int rpcType, ParamsReadContext ctx)
class CEItemProfile CEApi
API to interact with Central Economy.
proto native CEApi GetCEApi()
Get the CE API.
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DamageType
exposed from C++ (do not change)
bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
proto native int GetBoneIndexByName(string pBoneName)
returns bone index for a name (-1 if pBoneName doesn't exist)
proto native void ResetDeathCooldown()
bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void DayZPlayerImplementFallDamage(DayZPlayer pPlayer)
void DayZPlayerImplementMeleeCombat(DayZPlayerImplement player)
void DayZPlayerMeleeFightLogic_LightHeavy(DayZPlayerImplement player)
void DayZPlayerUtils()
cannot be instantiated
ECachedEquipmentItemCategory
ECachedEquipmentPlacement
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
bool IsProcessing()
returns true when FP is heating or cooling
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
void ModifiersManager(PlayerBase player)
MotorbikeOwnerState TransportOwnerState GetOwnerStateType()
Native class for motorbikes - handles physics simulation.
override event GetMoveType()
proto void AddNoise(EntityAI source_entity, NoiseParams noise_params, float external_strenght_multiplier=1.0)
class NoiseSystem NoiseParams()
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void PlayerSoundEventHandler(PlayerBase player)
void PluginDayzPlayerDebug()
PluginManager GetPluginManager()
Returns registred plugin by class type, better is to use global funtion GetPlugin(typename plugin_typ...
void ReplaceSoundEventHandler(PlayerBase player)
int GetCurrentCommandID()
ECachedEquipmentItemCategory m_Category
ref TIntArray m_ParentPlacement
ECachedEquipmentPlacement m_Placement
Super root of all classes in Enforce script.
void ProcessSoundEvent(string pEventType, string pUserString, int pUserInt)
void DepleteStamina(EStaminaModifiers modifier, float dT=-1)
bool IsWeaponDebugEnabled()
void ResetWeaponRaiseProgress()
void SendSoundEventEx(EPlayerSoundEventID id, int param=0)
DayZPlayerImplementThrowing GetThrowing()
void LockControls(bool state)
override void StopDeathDarkeningEffect()
override bool IsShootingFromCamera()
bool m_IsUnconsciousFalling
bool m_HandheldOpticsInUse
ref PlayerSoundEventHandler m_PlayerSoundEventHandler
void OverrideShootFromCamera(bool pState)
WeaponManager GetWeaponManager()
void SendCompleteWeaponRaiseJuncture()
AnimBackType GetBackAttachmentType()
void ShowDeadScreen(bool show, float duration)
void OverrideSlidePoseAngle(float value)
movement sliding override, originally for FB gestures
bool IsWeaponRaiseCompleted()
ref DayZPlayerImplementJumpClimb m_JumpClimb
bool m_WeaponRaiseCompleted
measures time from the weapon raise start to complete raise (once per)
bool IsTryingHoldBreath()
void ResetDamageHitState(bool resetTimer)
void SetFallYDiff(float value)
bool IsLanded(int pCurrentCommandID)
void CompleteWeaponRaise()
float m_SprintedTimePerStanceMin
void OnSoundEvent(string pEventType, string pUserString, int pUserInt)
void ShowWeaponDebug(bool show)
bool m_ShouldBeUnconscious
void SetIronsights(bool value)
ref array< AbstractWave > m_PerformedActionSounds
void TriggerPullPlayerOutOfVehicle()
ref Timer m_ADSAutomationTimer
bool IsFBSymptomPlaying()
AbstractWave ProcessVoiceEvent(string pEventType, string pUserString, int pUserInt)
bool CheckForRespawn(EntityAI item)
override bool IsEyeZoom()
Legacy.
bool m_IsShootingFromCamera
void ProcessAttachmentEvent(string pEventType, string pUserString, int pUserInt)
void RequestSoundEventEx(EPlayerSoundEventID id, bool from_server_and_client=false, int param=0)
float GetSlidePoseAngle()
void OnParticleEvent(string pEventType, string pUserString, int pUserInt)
void ~DayZPlayerImplement()
bool HandleDamageHit(int pCurrentCommandID)
override CachedEquipmentStorage GetCachedEquipment()
void HandleCeilingDustStepEffect(SurfaceInfo surfaceInfo, string boneName)
void RequestSoundEventStop(EPlayerSoundEventID id, bool from_server_and_client=false, int param=EPlayerSoundEventParam.STOP_PLAYBACK)
override array< InventoryItem > OnDrawOptics2D()
void SetIsInThirdPerson(bool state)
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
void SetSuicide(bool state)
bool m_CameraOpticsAimOverride
bool ModCommandHandlerBefore(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void HandleWeapons(float pDt, Entity pInHands, HumanInputController pInputs, out bool pExitIronSights)
ref DayZPlayerMeleeFightLogic_LightHeavy m_MeleeFightLogic
void EOnContact(IEntity other, Contact extra)
void CheckAnimationOverrides()
AbstractWave PlaySound(SoundObject so, SoundObjectBuilder sob)
bool IsWeaponObstructionBlockingADS()
override void OnItemInHandsChangedEx(bool pInstant=false, bool pChangeAnimationInstance=true)
bool ProcessJumpOrClimb(float pDt, int pCurrentCommandID)
bool m_IsFireWeaponRaised
ref DayZPlayerImplementAiming m_AimingModel
void RequestSoundEvent(EPlayerSoundEventID id, bool from_server_and_client=false)
bool m_ProcessLiftWeaponState
string GetSurfaceType(SurfaceAnimationBone limbType)
ref DeathEffectTimer m_DeathEffectTimer
void SetClimbingLadderType(string value)
static const float DEFAULT_DYING_TIME
ref DayZPlayerImplementThrowing m_Throwing
override float GetCurrentWaterLevel()
bool ModCommandHandlerAfter(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
void HideClothing(ItemOptics optic, bool state)
bool CanPickupHeavyItemSwap(notnull EntityAI item1, notnull EntityAI item2)
override void SetCurrentWaterLevel(float pWaterLevel)
void TriggerPullPlayerOutOfVehicleImpl()
bool m_ContinueFirearmMelee
float m_fObstructionSmooth
bool m_TriggerPullPlayerOutOfVehicleSynch
bool IsAlreadyInFallingCommand(int pCurrentCommandID)
int m_LastCommandBeforeUnconscious
bool IsInFBEmoteState()
Checks if fullbody animation or specific locked state is active in emote manager.
bool CanConsumeStamina(EStaminaConsumers consumer)
bool OnLand(int pCurrentCommandID, FallDamageData fallDamageData)
float m_TestDamageCounter
override void OnItemInHandsChanged()
static const int DEAD_SCREEN_DELAY
ref DayZPlayerImplementMeleeCombat m_MeleeCombat
override int CameraHandler(int pCameraMode)
int m_DebugWeaponChangeShowSlot
override int GetEyeZoomLevel()
Transport GetTransportCache()
Get the transport that was cached when entering unconsciousness.
string m_DebugWeaponChangeItem
bool CanStartConsumingStamina(EStaminaConsumers consumer)
bool PlaySoundEvent(EPlayerSoundEventID id, bool from_anim_system=false, bool is_from_server=false)
bool ModCommandHandlerInside(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
override bool IsInThirdPerson()
void ProcessFeetDamageServer(int pUserInt)
int m_PullPlayerOutOfVehicleState
void SetVariablesLadderSoundObjectBuilder(SoundObjectBuilder soundObjectBuilder)
DayZPlayerImplementMeleeCombat GetMeleeCombat()
bool StopSoundEvent(EPlayerSoundEventID id, bool is_from_server=false, int param=0)
void SetHandheldOpticsInUse(bool state)
ref array< ref SyncHitInfo > m_SyncedHitDataArray
void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)
DayZPlayerImplementFallDamage GetFallDamage()
ref WeaponDebug m_WeaponDebug
float m_LastHeadingAngleBlock
void OnLadder(float delta_time, HumanMovementState pState)
called every command handler tick when player is on ladder
ref DustEffectCeilingHandlerSynced m_CeilingDustHandler
void AttenuateSoundIfNecessary(SoundObject soundObject)
bool m_ProcessWeaponRaiseCompleted
void EvaluateDamageHit(int pCurrentCommandID)
Must be ran at the start of CommandHandler before Jump is triggered.
void OnMovementChanged()
Event, called when HumanMovementState.m_iMovement changes...walk, run, sprint, etc....
bool CanClimb(int climbType, SHumanCommandClimbResult climbRes)
bool m_PullPlayerOutOfVehicleKeepsInLocalSpace
override bool HeadingModel(float pDt, SDayZPlayerHeadingModel pModel)
is replayed after correction when 'NetworkRewindType.REPLAY' is used
void DeathDropHandEntity()
void SetOptics(bool value)
int m_DebugWeaponChangeStage
bool IsInFullbodyDamageAnimation()
void SetReturnToOptics(bool state)
ref Timer m_FightEndBlendTimer
bool PlaySoundEventType(ESoundEventType soundType, int soundEventID, int param=0)
Handle sound event by respective sound handler based on its type.
void SyncDeferredEventToRemotes()
float m_LastHeadingAngleBlock2
bool m_isFBsymptomPlaying
override void OnInputForRemote(ParamsReadContext ctx)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
event from damage system
override void EEKilled(Object killer)
string m_ClimbingLadderType
float m_ProcessObstructWeapon
float m_DebugDirectionVal
VKOSTIK - tady dat 0 misto -1.
AnimRangedWeaponType GetShoulderAttachmentType()
bool m_AimingFinisherStarted
void CommandHandlerDebug(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
int GetTypeOfDeath(int pCurrentCommandID)
ref HumanMovementState m_MovementState
time step for gradual update of dead screen visibilibty up to full visbility [s]
ref DayZPlayerImplementFallDamage m_FallDamage
int m_ActionSoundCategoryHash
void SendDeathJuncture(int pAnimTypeDeath, float pAnimHitDirDeath)
bool IsHandheldOpticsInUse()
bool m_CameraEyeZoom
DEPRECATED.
override void OnVariablesSynchronized()
int m_LastSurfaceUnderHash
AnimBootsType GetBootsType()
float GetWeaponObstruction()
bool m_IsTryingHoldBreath
void SimulateDeath(bool state)
DayZPlayerInventory GetDayZPlayerInventory()
bool EvaluateDamageHitAnimation(TotalDamageResult pDamageResult, int pDamageType, EntityAI pSource, string pComponent, string pAmmoType, vector pModelPos, out int pAnimType, out float pAnimHitDir, out bool pAnimHitFullbody)
selects animation type and direction based on damage system data
static const float DYING_PROGRESSION_TIME
how long does it take to full death screen [s]
bool IsFireWeaponRaised()
bool HandleDeath(int pCurrentCommandID)
float m_ObstructWeapon_player
const float HIT_INTERVAL_MIN
void DayZPlayerImplement()
constructor
bool CheckForTakeItem(EntityAI item)
override string GetDebugText()
AnimUpperBodyType GetBodyAttachmentType()
void ProcessWeaponEvent(string pEventType, string pUserString, int pUserInt)
bool CanPickupHeavyItem(notnull EntityAI item)
-------------— Checks if player can pick up heavy item ----------------------—
bool m_ProcessFirearmMeleeHit
SHumanCommandMoveSettings m_MoveSettings
void OnJumpEnd(int pLandType=0)
void AddNoise(NoiseParams noisePar, float noiseMultiplier=1.0)
DayZPlayerImplementAiming GetAimingModel()
float m_DeathDarkeningCurrentTime
bool PlaySoundEventEx(EPlayerSoundEventID id, bool from_anim_system=false, bool is_from_server=false, int param=0)
bool CheckForDropItem(EntityAI item)
void HandleOptic(notnull ItemOptics optic, bool inHands, HumanInputController pInputs, out bool pExitOptics)
bool EvaluateDeathAnimation(int pDamageType, EntityAI pSource, string pAmmoType, out int pAnimType, out float pAnimHitDir)
selects animation type and direction based on damage system data
float m_CurrentWaterLevel
void OnStepEvent(string pEventType, string pUserString, int pUserInt)
void ResetDeathStartTime()
override bool AimingModel(float pDt, SDayZPlayerAimingModel pModel)
ref ReplaceSoundEventHandler m_ReplaceSoundEventHandler
DayZPlayerMeleeFightLogic_LightHeavy GetMeleeFightLogic()
void SendSoundEvent(EPlayerSoundEventID id)
float m_fObstructionSmoothVelocity[1]
void SwitchOptics(ItemOptics optic, bool state)
void OnInputUserDataReceived(ParamsReadContext ctx)
override void CommandHandler(float pDt, int pCurrentCommandID, bool pCurrentCommandFinished)
override void OnInputFromServer(ParamsReadContext ctx)
ref DayZPlayerImplementSwimming m_Swimming
void SetDeathDarknessLevel(float duration, float tick_time)
void DepleteStaminaEx(EStaminaModifiers modifier, float dT=-1, float coef=1.0)
ECameraZoomType m_CameraEyeZoomLevel
Transport m_TransportCache
static const int DAYZCAMERA_OPTICS
optics
static const int DAYZCAMERA_1ST
1st person camera
static const int DAYZCAMERA_3RD_PRO_RAISED
3rd - laying raised
static const int DAYZCAMERA_3RD_CLIMB
climb / vault
static const int DAYZCAMERA_3RD_CRO_RAISED
3rd - crouch
static const int DAYZCAMERA_3RD_ERC_SPR
3rd - standing sprint
static const int DAYZCAMERA_3RD_PRO
3rd - laying
static const int DAYZCAMERA_3RD_ERC
3rd - standing
static const int DAYZCAMERA_IRONSIGHTS
ironsights camera
static const int DAYZCAMERA_3RD_CRO
3rd - crouch
static const int DAYZCAMERA_3RD_ERC_RAISED
3rd - standing raised
static const int DAYZCAMERA_1ST_UNCONSCIOUS
unconscious
static const int DAYZCAMERA_3RD_ERC_RAISED_MELEE
3rd - laying raised
static const int DAYZCAMERA_1ST_VEHICLE
vehicle 1st person
static const int DAYZCAMERA_3RD_JUMP
jump
override void OnSimulationEnd()
override bool ShouldSimulationBeDisabled()
at which point does the stabilization start to get affected
static bool NoHeading(float pDt, SDayZPlayerHeadingModel pModel, out float pLastHeadingDiff)
static bool RotateOrient(float pDt, SDayZPlayerHeadingModel pModel, out float pLastHeadingDiff)
static bool ClampHeading(float pDt, SDayZPlayerHeadingModel pModel, out float pLastHeadingDiff)
static void SendDamageHitEx(DayZPlayer pPlayer, int pType, float pHitDir, bool pFullbody, TotalDamageResult pDamageResult, int pDamageType, EntityAI pSource, string pComponent, string pAmmoType, vector pModelPos)
static const int SJ_DEATH
static bool ReadDamageHitParamsEx(ParamsReadContext pCtx, out SyncHitInfo pData)
static void SendDeath(DayZPlayer pPlayer, int pType, float pHitDir)
static const int SJ_DAMAGE_HIT
static bool ReadDeathParams(ParamsReadContext pCtx, out int pType, out float pHitDir)
SoundObjectBuilder GetSoundBuilder(int eventId, string slotName, int attachmentHash)
SoundObjectBuilder GetSoundBuilder(int eventId, int pMovement, int pSurfaceHash, AnimBootsType pBoots)
override SoundObjectBuilder GetSoundBuilder(int eventId, int parameterHash)
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
proto native EntityAI FindAttachment(int slot)
Returns attached entity in slot (you can use InventorySlots.GetSlotIdFromString(name) to get slot id)
script counterpart to engine's class Inventory
void SetVehicleCommand(HumanCommandVehicle hcv)
proto static native bool DoClimbTest(Human pHuman, SHumanCommandClimbResult pResult, int pDebugDrawLevel)
proto native bool IsFinisher()
proto native void Cancel()
cancels command melee and goes to HumanCommandMove
proto native float GetCurrentMovementSpeed()
0,1,2..3 idle, walk, run, sprint
proto native bool IsStandingFromBack()
return true if prone on back is chaning to crounch/stand
proto native bool IsChangingStance()
returns true if character is changing stance
proto native bool IsWakingUp()
proto native bool IsRagdoll()
proto native bool IsInWater()
proto native bool IsOnLand()
proto native Transport GetTransport()
proto native bool IsGettingIn()
proto native void ProcessLeaveEvents()
proto native bool WasGearChange()
proto native int GetVehicleSeat()
proto native bool IsGettingOut()
proto native bool IsActionFinished()
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
proto native void LiftWeapon(bool pState)
command for lifting weapon near obstacles (works only when weapon is raised)
proto native void ObstructWeapon(float pState01)
command for obstruction weapon near obstacles
proto native float GetWeaponObstruction()
return obstruction value
proto native bool IsWeaponLifted()
return if lifting weapon is active
proto native bool StartAction(WeaponActions pAction, int pActionType)
start reload,mechanism,chambering,unjam ...
proto native void SetADS(bool pState)
sets head tilt to optics
proto native int IsEvent()
return -1 when there is no event, otherwise it returns pId of event from animation
proto native EntityAI GetEntityInHands()
inventory for plain man/human
HumanInventory... with FSM (synchronous, no anims)
bool m_bJumpAllowed
default false
int m_StanceRotation[6]
6 stances -> all has movement mask, STANCEIDX_ ... is index
int m_iMovement
current stance (DayZPlayerConstants.STANCEIDX_ERECT, ...), only if the command has a stance
int m_iStanceIdx
current command's id
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
provides access to slot configuration
proto native bool StepZeroingUp()
sets zeroing to next defined (respective to current) value in zeroing config array
proto native bool ExitOptics()
switches out of optics mode (if possible)
bool IsUsingOptics2DModel()
Returns whether this ItemOptics uses the 2D optics model.
proto native bool IsInOptics()
is weapon in optics mode or not
proto native bool IsUsingWeaponIronsightsOverride()
is optics using ironsights override settings or not
proto native bool EnterOptics()
switches to optics mode if possible
proto native bool StepZeroingDown()
sets zeroing to previous (respective to current) defined value in zeroing config array
static bool IsSyncLogEnable()
static void PlayVegetationCollideParticles(Object object, DayZPlayerImplement player)
static float GetNoiseMultiplier(DayZPlayerImplement playerImplement)
static void SetMultiplayState(bool state)
Entity which has the particle instance as an ObjectComponent.
static const float WEAPON_RAISE_BLEND_DELAY
static const float MAX_FINISHER_RANGE
static const float FULL_SPRINT_DELAY_DEFAULT
[meters]
static const float HEAVY_HIT_THRESHOLD
static const int CHECK_EVERY_N_STEP
The class that will be instanced (moddable)
proto bool Read(void value_in)
SoundObjectBuilder GetVegetationSoundBuilderFromEventID(int stepEventID)
proto int GetStepParticleId()
proto string GetSurfaceType()
proto native float GetHighestDamage(string healthType)
Native class for boats - handles physics simulation.
proto native bool SyncedPress_ID(int action, bool check_focus=true)
Returns true just in frame, when action was invoked (button was pressed)
script counterpart to engine's class Weapon
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
proto float Normalize()
Normalizes vector. Returns length.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native void SetVerticalMinimumAimLimit(float value)
sets vertical minimum aim limit for a player
void SDayZPlayerHeadingModel()
cannot be created from script
void ForceStandUpForHeavyItems(notnull EntityAI item)
-------------— Forces player to stand up when swapping to heavy item ----------------------—
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerType GetDayZPlayerType()
returns appropriate DayZPlayerType
proto native DayZPlayerInstanceType GetInstanceType()
proto native float IsPlayerSpeaking()
-------------— speaking anim ----------------------—
DayZPlayerConstants
defined in C++
int GetEyeZoomLevel()
returns eye zoom level, uses ECameraZoomType values
proto native bool IsPlayerInStance(int pStanceMask)
-------------— camera additiona functions ----------------------—
Serializer ParamsReadContext
void Error(string err)
Messagebox with error message.
proto void Print(void var)
Prints content of variable to console/log.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
class array< Class T > TStringArray
void Obsolete(string msg="")
EntityEvent
Entity events for event-mask, or throwing event from code.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Acos(float c)
Returns angle in radians from cosinus.
static proto int AbsInt(int i)
Returns absolute value.
static proto float Atan2(float y, float x)
Returns angle in radians from tangent.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static const float RAD2DEG
static proto float AbsFloat(float f)
Returns absolute value.
static proto float SmoothCD(float val, float target, inout float velocity[], float smoothTime, float maxVelocity, float dt)
Does the CD smoothing function - easy in | easy out / S shaped smoothing.
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
vector GetPosition()
Get the world position of the Effect.
class SoundObject SoundParams(string name)
proto native void SetPosition(vector position)
Note: Sets the position locally if parented, retrieves globally with the sound offset.
proto native void SetKind(WaveKind kind)
proto string Get(int index)
Gets n-th character from string.
proto native int Hash()
Returns hash of string.
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
class HumanCommandLadder HumanCommandSwim()
class HumanCommandMelee2 HumanCommandFall()
proto native bool IsLeavingUncon()
return true if character transitions out of uncon
class HumanCommandWeapons HumanCommandAdditives()
class SHumanGlobalSettings SHumanCommandMoveSettings()
class SHumanCommandSwimSettings SHumanCommandClimbSettings()