// September 2015 // Levee Patroller / Dijk Patrouille // This source file is (c) by Deltares. This source file is open source but only available to select users. Do not redistribute without written permission of Stichting Deltares, Delft, The Netherlands. // This header has been automatically generated. //============================================================================= // The moving brush class. // This is a built-in Unreal class and it shouldn't be modified. // Note that movers by default have bNoDelete==true. This makes movers and their default properties // remain on the client side. If a mover subclass has bNoDelete=false, then its default properties must // be replicated //============================================================================= class MeshMover extends Mover; /* StartInterpolation() when this function is called, the actor will start moving along an interpolation path beginning at Dest */ simulated function StartInterpolation() { GotoState(''); bInterpolating = true; SetPhysics(PHYS_None); } function SetNumKeys(int num) { self.Numkeys = num; } simulated function Timer() { if ( Velocity != vect(0,0,0) ) { bClientPause = false; return; } if ( Level.NetMode == NM_Client ) { if ( ClientUpdate == 0 ) // not doing a move { if ( bClientPause ) { if ( VSize(RealPosition - Location) > 3 ) SetLocation(RealPosition); else RealPosition = Location; SetRotation(RealRotation); bClientPause = false; } else if ( RealPosition != Location ) bClientPause = true; } else bClientPause = false; } else { RealPosition = Location; RealRotation = Rotation; } } // Interpolation ended. simulated event KeyFrameReached() { local byte OldKeyNum; OldKeyNum = PrevKeyNum; PrevKeyNum = KeyNum; PhysAlpha = 0; ClientUpdate--; // If more than two keyframes, chain them. //if( KeyNum>0 && KeyNumOldKeyNum ) { // Chain to next. //InterpolateTo(KeyNum+1,MoveTime); } else { // Finished interpolating. AmbientSound = None; if ( (ClientUpdate == 0) && (Level.NetMode != NM_Client) ) { RealPosition = Location; RealRotation = Rotation; } } } //----------------------------------------------------------------------------- // Mover functions. // Notify AI that mover finished movement function FinishNotify() { local Controller C; for ( C=Level.ControllerList; C!=None; C=C.nextController ) if ( (C.Pawn != None) && (C.PendingMover == self) ) C.MoverFinished(); } // Handle when the mover finishes opening. function FinishedOpening() { // Update sound effects. PlaySound( OpenedSound, SLOT_None, SoundVolume / 255.0, false, SoundRadius, SoundPitch / 64.0); // Trigger any chained movers / Events TriggerEvent(Event, Self, Instigator); TriggerEvent(OpenedEvent, Self, Instigator); If ( MyMarker != None ) MyMarker.MoverOpened(); FinishNotify(); } // Open the mover. function DoOpen() { bOpening = true; bDelaying = false; InterpolateTo( KeyNum+1, MoveTime ); MakeNoise(1.0); Log("Do open: Num: " $ KeyNum+1); PlaySound( OpeningSound, SLOT_None, SoundVolume / 255.0, false, SoundRadius, SoundPitch / 64.0); AmbientSound = MoveAmbientSound; TriggerEvent(OpeningEvent, Self, Instigator); if ( Follower != None ) Follower.DoOpen(); } //----------------------------------------------------------------------------- // Engine notifications. // When mover enters gameplay. simulated function BeginPlay() { local AntiPortalActor AntiPortal; if(AntiPortalTag != '') { foreach AllActors(class'AntiPortalActor',AntiPortal,AntiPortalTag) { AntiPortals.Length = AntiPortals.Length + 1; AntiPortals[AntiPortals.Length - 1] = AntiPortal; } } // timer updates real position every second in network play if ( Level.NetMode != NM_Standalone ) { if ( Level.NetMode == NM_Client ) settimer(4.0, true); else settimer(1.0, true); if ( Role < ROLE_Authority ) return; } // Changed by Demiurge Studios (Runtime) RealPosition = Location; RealRotation = Rotation; // End changed by Demiurge Studios (Runtime) // Init key info. Super.BeginPlay(); KeyNum = Clamp( KeyNum, 0, ArrayCount(KeyPos)-1 ); PhysAlpha = 0.0; // Set initial location. Move( BasePos + KeyPos[KeyNum] - Location ); // Initial rotation. SetRotation( BaseRot + KeyRot[KeyNum] ); // find movers in same group if ( ReturnGroup == '' ) ReturnGroup = tag; Leader = None; Follower = None; } // Immediately after mover enters gameplay. function PostBeginPlay() { local mover M; // Initialize all slaves. if( !bSlave ) { foreach DynamicActors( class 'Mover', M, Tag ) { if( M.bSlave ) { M.GotoState(''); M.SetBase( Self ); } } } if ( bIsLeader ) { Leader = self; ForEach DynamicActors( class'Mover', M ) if ( (M != self) && (M.ReturnGroup == ReturnGroup) ) { M.Leader = self; M.Follower = Follower; Follower = M; } } else if ( Leader == None ) { // if no one in returngroup, I am the leader anyway ForEach DynamicActors( class'Mover', M ) { if ( (M != self) && (M.ReturnGroup == ReturnGroup) ) return; } Leader = self; } } function MakeGroupStop() { // Stop moving immediately. bInterpolating = false; AmbientSound = None; GotoState( , '' ); if ( Follower != None ) Follower.MakeGroupStop(); } function MakeGroupReturn() { // Abort move and reverse course. bInterpolating = false; AmbientSound = None; if(bIsLeader || Leader==Self) { if( KeyNum 0 ) { bDelaying = true; Sleep(DelayTime); } DoOpen(); FinishInterpolation(); FinishedOpening(); if ( SavedTrigger != None ) SavedTrigger.EndEvent(); Stop; } defaultproperties { bNoDelete=false bStatic=False bMovable=true bCollideWorld=False MoverEncroachType=ME_IgnoreWhenEncroach InitialState=TriggerToggle DrawType = DT_StaticMesh bDynamicLight = true bDynamicLightMover = true bUseDynamicLights = true bPathColliding=true MoverGlideType=MV_GlideByTime NumKeys=2 BrushRaytraceKey=0 MoveTime=+00001.000000 StayOpenTime=+00004.000000 bHidden=false CollisionRadius=+00160.000000 CollisionHeight=+00160.000000 bCollideActors=True bBlockActors=True bBlockPlayers=True Physics=PHYS_MovingBrush TransientSoundVolume=+00001.000000 SoundVolume=228 NetPriority=2.7 bAlwaysRelevant=true RemoteRole=ROLE_SimulatedProxy bClosed=true bShadowCast=true bEdShouldSnap=true bAcceptsProjectors=true bOnlyDirtyReplication=true }