// // CPT operator / SondeerGame // This source file is (c) by Deltares. // - October 2014 // //============================================================================= // Object that makes sounds of sheep every now and then // ------------------------------------------------------------ // Created by Maarten Wesselius // © 2007, Geodelft // // Date Id Modification // 2007-10-11 Wsl Class created //============================================================================= class GeoAxisSound extends KeyPoint; var float timerInterval; var Pawn playerPawn; var(Sound) int RelativeDistance; var(Sound) enum Axes { AXIS_X, AXIS_Y, AXIS_Z } SoundAxis; //============================================================================= // A timer is needed to accommodate for random intervals between sheep sounds. // Using the function SetTimer() to start a timer that calls the Timer()-function // every 0.2 seconds. // // Date Id Modification // 2006-10-04 Wsl Created this header //============================================================================= event PostBeginPlay() { local PlayerController A; SetTimer(timerInterval, true); ForEach DynamicActors( class 'PlayerController', A,) { playerPawn = A.Pawn; break; } } //============================================================================= // Date Id Modification // 2007-10-04 Wsl Created this function // // This function is called every timerInterval seconds; it sets the coordinate // along the appropriate axis equal to the player's coordinate on that axis. //============================================================================= function Timer() { // set Y of this equal to the Y of the player local Vector v; local PlayerController A; ForEach DynamicActors( class 'PlayerController', A,) { playerPawn = A.Pawn; break; } v = self.Location; if(SoundAxis == AXIS_X) { v.X = playerPawn.Location.X + RelativeDistance; } else if(SoundAxis == AXIS_Y) { v.Y = playerPawn.Location.Y + RelativeDistance; } else { v.Z = playerPawn.Location.Z + RelativeDistance; } SetLocation(v); } defaultproperties { bStatic=false bHidden=true timerInterval=3.0 RelativeDistance=0 SoundRadius=100.0 SoundVolume=255 SoundOcclusion=OCCLUSION_StaticMeshes }