3270 {
3274 HumanMovementState state = new HumanMovementState();
3275 GetMovementState(state);
3276
3278 if (pUserInt < 100)
3279 {
3280 string boneName = "";
3281 if (pUserInt % 2 == 1)
3282 {
3283 boneName = "leftfoot";
3284 surfaceInfo =
g_Game.GetSurfaceInfoUnderObjectByBone(
this, SurfaceAnimationBone.LeftBackLimb);
3285 if (!surfaceInfo)
3286 {
3287 surfaceInfo =
g_Game.GetSurfaceInfoUnderObjectByBone(
this, SurfaceAnimationBone.RightBackLimb);
3288 boneName = "rightfoot";
3289 }
3290 }
3291 else
3292 {
3293 boneName = "rightfoot";
3294 surfaceInfo =
g_Game.GetSurfaceInfoUnderObjectByBone(
this, SurfaceAnimationBone.RightBackLimb);
3295 if (!surfaceInfo)
3296 {
3297 surfaceInfo =
g_Game.GetSurfaceInfoUnderObjectByBone(
this, SurfaceAnimationBone.LeftBackLimb);
3298 boneName = "leftfoot";
3299 }
3300 }
3301
3303 {
3304
3305 if (surfaceInfo)
3306 {
3308 }
3309 }
3310
3311 #ifdef DIAG_DEVELOPER
3313 {
3314 if (DiagMenu.GetBool(
DiagMenuIDs.MISC_PLAYER_SURFACE_DEBUG))
3315 {
3316 string surfaceType = "NULL";
3317 if (surfaceInfo)
3319
3320 CharacterStepsDebug.SetStepData(boneName, surfaceType);
3321 }
3322 }
3323 #endif
3324 }
3325
3326 #ifndef SERVER
3327 #ifndef NO_GUI
3328 DayZPlayerTypeStepSoundLookupTable table = playerType.GetStepSoundLookupTable();
3330 if (pUserInt < 100)
3331 {
3332 if (surfaceInfo)
3333 {
3335
3337 {
3339
3341 float dotWithForward = vector.Dot(surfaceNormal,
orientation);
3342
3343 float pitch = Math.Atan2(-dotWithForward, surfaceNormal[1]) * Math.RAD2DEG;
3344
3345
3348
3350
3353
3354
3356 if (stepParticleID > 0)
3357 {
3359
3361 }
3362 }
3363
3365 }
3366 }
3367 else
3368 {
3369 surfaceInfo =
g_Game.GetSurfaceInfoUnderObject(
this);
3370 if (surfaceInfo)
3372
3374 }
3375
3376 if (soundBuilder != null &&
g_Game.GetPlayer())
3377 {
3378 m_StepCounterVegetation++;
3379
3380 if (m_StepCounterVegetation >= 3)
3381 {
3382 m_StepCounterVegetation = 0;
3383 g_Game.ProfilerStart(
"Player_Vegetation_Sounds");
3384
3386 vector edgeLength =
Vector(0.75, 2.5, 0.75);
3387 array<Object> excludedObjects = new array<Object>();
3388 excludedObjects.Insert(this);
3389 array<Object> collidedObjects = new array<Object>();
3390
3391 if (
g_Game.IsBoxCollidingGeometry(
position,
orientation, edgeLength, ObjIntersectView, ObjIntersectNone, excludedObjects, collidedObjects))
3392 {
3393 foreach (
Object obj : collidedObjects)
3394 {
3396 if (Class.CastTo(colPlant, obj))
3397 {
3399 MiscEffects.PlayVegetationCollideParticles(colPlant, this);
3400
3401 if (colPlant.HasPlayerCollisionSound())
3402 {
3404
3405 StaticObjectType plantType = StaticObjectType.Cast(colPlant.GetEntityType());
3406
3407
3409 if (vegSoundObjectBuilder)
3410 {
3411 vegSoundObject = vegSoundObjectBuilder.BuildSoundObject();
3412 }
3413 else
3414 {
3415 array<ref VegetationSound> vegSoundArray = playerType.GetVegetationSounds();
3417 {
3418 if (vegetationSound.GetAnimEventIds().Find(pUserInt) >= 0)
3419 {
3420 vegSoundObjectBuilder = vegetationSound.GetSoundObjectBuilder();
3421 vegSoundObject = vegSoundObjectBuilder.BuildSoundObject();
3422 break;
3423 }
3424 }
3425 }
3426
3427 if (vegSoundObject != null)
3428 {
3430 PlaySound(vegSoundObject, vegSoundObjectBuilder);
3431 }
3432
3433 break;
3434 }
3435 }
3436 }
3437 }
3438
3439 g_Game.ProfilerStop(
"Player_Vegetation_Sounds");
3440 }
3441
3442 SoundObject soundObject = soundBuilder.BuildSoundObject();
3443 if (soundObject != null)
3444 {
3447 }
3448
3449 }
3450 #endif
3451 #endif
3452
3454 {
3456
3457 float noiseMultiplier = 0;
3458
3461 noiseParams = playerType.GetNoiseParamsStand();
3463 noiseParams = playerType.GetNoiseParamsCrouch();
3465 noiseParams = playerType.GetNoiseParamsProne();
3466 else
3467 {
3468 Debug.Log(
string.Format(
"Wrong stance, id: %1 using backup with stand stance (id: 0)", state.
m_iStanceIdx));
3469 noiseParams = playerType.GetNoiseParamsStand();
3470 }
3471
3472 noiseMultiplier = NoiseAIEvaluate.GetNoiseMultiplier(this);
3473
3474 AddNoise(noiseParams, noiseMultiplier);
3475
3476 if ((
m_StepCounter % PlayerConstants.CHECK_EVERY_N_STEP) == 0)
3477 {
3480 }
3481 }
3482 }
class NoiseSystem NoiseParams()
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void HandleCeilingDustStepEffect(SurfaceInfo surfaceInfo, string boneName)
void ProcessFeetDamageServer(int pUserInt)
void AttenuateSoundIfNecessary(SoundObject soundObject)
int m_LastSurfaceUnderHash
AnimBootsType GetBootsType()
void AddNoise(NoiseParams noisePar, float noiseMultiplier=1.0)
SoundObjectBuilder GetSoundBuilder(int eventId, int pMovement, int pSurfaceHash, AnimBootsType pBoots)
int m_iMovement
current stance (DayZPlayerConstants.STANCEIDX_ERECT, ...), only if the command has a stance
int m_iStanceIdx
current command's id
SoundObjectBuilder GetVegetationSoundBuilderFromEventID(int stepEventID)
proto int GetStepParticleId()
proto string GetSurfaceType()
proto float VectorToYaw()
Returns yaw of vector.
void VegetationSound(SoundObjectBuilder soundObjectBuilder, TIntArray animEventIds)
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerType GetDayZPlayerType()
returns appropriate DayZPlayerType
proto native DayZPlayerInstanceType GetInstanceType()
DayZPlayerConstants
defined in C++
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
void SoundObject(SoundParams soundParams)
vector GetPosition()
Get the world position of the Effect.
proto native int Hash()
Returns hash of string.