// // CPT operator / SondeerGame // This source file is (c) by Deltares. // - October 2014 // //============================================================================= // Ducks, animated and making sounds. // ------------------------------------------------------------ // Created by Maarten Wesselius // © 2007, Geodelft // // Date Id Modification // 200?-??-?? gui Class created // 2007-11-01 Wsl Sound functionality moved to GeoTimedSoundObject //============================================================================= class GeoDuck extends GeoAnimal; var name NeckAnim; var name NoseAnim; var name ScratchAnim; var name DanceAnim; //var GeoTimedSoundObject soundObject; var (Sound) float AverageSecondsBetween; var (Sound) float MaxDeviation; event PreBeginPlay() { //SetTimer(timerInterval, true); //determineNextWaitingTime(1.0); InitSound(); } //============================================================================= // Init sound object, associated sounds and configurable sound variables. // // Date Id Modification // 2006-10-11 Wsl Created this header //============================================================================= function InitSound() { /* local array arr; Log("GeoDuck - Init Sound"); soundObject = Spawn(class'GeoTimedSoundObject', self); soundObject.SetAverageSecondsBetween(AverageSecondsBetween); soundObject.SetMaxDeviation(MaxDeviation); arr.length = 4; arr[0]=Sound'GeoNatureSounds.birds.duck1'; arr[1]=Sound'GeoNatureSounds.birds.duck2'; arr[2]=Sound'GeoNatureSounds.birds.duck3'; arr[3]=Sound'GeoNatureSounds.birds.duck4'; soundObject.SetSounds(arr); */ } simulated function PlayWaiting() { local int Random; if(Physics == PHYS_Falling) LoopAnim(FallingAnim, 1.0, 0.2); else if(Physics == PHYS_Flying) LoopAnim(FlyIdle, 1.0, 0.2); else if(Physics == PHYS_Swimming) LoopAnim(SwimIdle, 1.0, 0.2); else { if(bIsCrouched) { LoopAnim(CrouchIdle, 1.0, 0.2); } else { Random = Rand(100); if(Random<15) LoopAnim(NeckAnim, 1.0, 0.2); else if(Random<30) LoopAnim(NoseAnim, 1.0, 0.2); else if(Random<45) LoopAnim(ScratchAnim, 1.0, 0.2); else if(Random<50) LoopAnim(DanceAnim, 1.0, 0.2); else LoopAnim(StandIdle, 1.0, 0.2); } } } defaultproperties { // Mesh=SkeletalMesh'AnimalsA.Mallard_Duck' Mesh=SkeletalMesh'AnimalA.Duck' TransientSoundRadius=50.0 TransientSoundVolume=0.6 AverageSecondsBetween=6.0 MaxDeviation=3.0 RunningAnims[0]="swim_motion" RunningAnims[1]="swim_motion" RunningAnims[2]="swim_motion" RunningAnims[3]="swim_motion" WalkingAnims[0]="swim_motion" WalkingAnims[1]="swim_motion" WalkingAnims[2]="swim_motion" WalkingAnims[3]="swim_motion" CrouchAnims[0]="swim_motion" CrouchAnims[1]="swim_motion" CrouchAnims[2]="swim_motion" CrouchAnims[3]="swim_motion" FlyingAnims[0]="swim_motion" FlyingAnims[1]="swim_motion" FlyingAnims[2]="swim_motion" FlyingAnims[3]="swim_motion" SwimmingAnims[0]="swim_motion" SwimmingAnims[1]="swim_motion" SwimmingAnims[2]="swim_motion" SwimmingAnims[3]="swim_motion" StandingTurnAnims[0]="swim_motion" StandingTurnAnims[1]="swim_motion" CrouchTurnAnims[0]="swim_motion" CrouchTurnAnims[1]="swim_motion" StandIdle="swim_motion" CrouchIdle="swim_motion" FlyIdle="swim_motion" SwimIdle="swim_motion" JumpStandingAnim="swim_motion" JumpMovingAnim="swim_motion" LandAnim="swim_motion" FallingAnim="swim_motion" NeckAnim="swim_motion" NoseAnim="swim_motion" ScratchAnim="swim_motion" DanceAnim="swim_motion" BaseEyeHeight=16 CollisionRadius=+00032.000000 CollisionHeight=+00016.000000 CrouchHeight=+12.0 WalkingPct=+0.2 }